From: Thomas Monjalon <thomas@monjalon.net>
To: dev@dpdk.org
Cc: Maxime Coquelin <maxime.coquelin@redhat.com>
Subject: [PATCH 1/6] devtools: remove superfluous curly braces in uAPI script
Date: Wed, 27 Aug 2025 10:21:44 +0200 [thread overview]
Message-ID: <20250827082413.1417226-2-thomas@monjalon.net> (raw)
In-Reply-To: <20250827082413.1417226-1-thomas@monjalon.net>
The use of curly braces for variables is inconsistent
in the Linux uAPI script.
It is chosen to remove all of them if not required.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
devtools/linux-uapi.sh | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/devtools/linux-uapi.sh b/devtools/linux-uapi.sh
index ccd8b6816e..2000152607 100755
--- a/devtools/linux-uapi.sh
+++ b/devtools/linux-uapi.sh
@@ -30,7 +30,7 @@ download_header()
local header=$1
local path=$2
- local url="${base_url}${header}?h=${version}"
+ local url="$base_url$header?h=$version"
if ! curl -s -f --create-dirs -o $path $url; then
echo "Failed to download $url"
@@ -61,12 +61,12 @@ import_header()
local import
local header=$1
- local path="${base_path}${header}"
+ local path="$base_path$header"
download_header $header $path || return 1
for include in $(sed -ne 's/^#include <\(.*\)>$/\1/p' $path); do
- if [ ! -f "${base_path}${include}" ]; then
+ if [ ! -f "$base_path$include" ]; then
read -p "Import $include (y/n): " import && [ "$import" = 'y' ] || continue
echo "Importing $include for $path"
import_header "$include" || return 1
@@ -85,8 +85,8 @@ fixup_includes()
# Prepend include path with "uapi/" if the header is imported
for include in $(sed -ne 's/^#include <\(.*\)>$/\1/p' $path); do
- if [ -f "${base_path}${include}" ]; then
- sed -i "s|${include}|uapi/${include}|g" $path
+ if [ -f "$base_path$include" ]; then
+ sed -i "s|$include|uapi/$include|g" $path
fi
done
}
@@ -106,7 +106,7 @@ check_header() {
}
while getopts i:u:ch opt ; do
- case ${opt} in
+ case $opt in
i ) file=$OPTARG ;;
u ) version=$OPTARG ;;
c ) check_headers=1 ;;
@@ -123,9 +123,9 @@ fi
cd $(dirname $0)/..
-current_version=$(< ${base_path}/version)
+current_version=$(< $base_path/version)
-if [ -n "${version}" ]; then
+if [ -n "$version" ]; then
if version_older_than "$version" "$current_version"; then
echo "Headers already up to date ($current_version >= $version)"
version=$current_version
@@ -137,7 +137,7 @@ else
version=$current_version
fi
-if [ -n "${file}" ]; then
+if [ -n "$file" ]; then
import_header $file || exit 1
fi
@@ -145,7 +145,7 @@ for filename in $(find $base_path -name "*.h" -type f); do
fixup_includes $filename || exit 1
done
-echo $version > ${base_path}/version
+echo $version > $base_path/version
if [ $check_headers -eq 0 ]; then
exit 0
@@ -154,7 +154,7 @@ fi
tmpheader="$(mktemp -t dpdk.checkuapi.XXXXXX)"
trap "rm -f '$tmpheader'" INT
-echo "Checking imported headers for version ${version}"
+echo "Checking imported headers for version $version"
for filename in $(find $base_path -name "*.h" -type f); do
header=${filename#$base_path}
--
2.47.1
next prev parent reply other threads:[~2025-08-27 8:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-27 8:21 [PATCH 0/6] devtools: improve Linux " Thomas Monjalon
2025-08-27 8:21 ` Thomas Monjalon [this message]
2025-08-27 8:21 ` [PATCH 2/6] devtools: remove superfluous fallbacks in " Thomas Monjalon
2025-08-27 8:21 ` [PATCH 3/6] devtools: move uAPI processing into functions Thomas Monjalon
2025-08-27 8:21 ` [PATCH 4/6] devtools: remove unused variables in uAPI script Thomas Monjalon
2025-08-27 8:21 ` [PATCH 5/6] devtools: make uAPI check exclusive to other options Thomas Monjalon
2025-08-27 8:21 ` [PATCH 6/6] devtools: add quiet mode in uAPI script Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250827082413.1417226-2-thomas@monjalon.net \
--to=thomas@monjalon.net \
--cc=dev@dpdk.org \
--cc=maxime.coquelin@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).