Skip to content

Commit 05eadcc

Browse files
committed
devtools: remove superfluous curly braces in uAPI script
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 <[email protected]> Reviewed-by: Maxime Coquelin <[email protected]>
1 parent 00092e9 commit 05eadcc

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

devtools/linux-uapi.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ download_header()
3030
local header=$1
3131
local path=$2
3232

33-
local url="${base_url}${header}?h=${version}"
33+
local url="$base_url$header?h=$version"
3434

3535
if ! curl -s -f --create-dirs -o $path $url; then
3636
echo "Failed to download $url"
@@ -61,12 +61,12 @@ import_header()
6161
local import
6262
local header=$1
6363

64-
local path="${base_path}${header}"
64+
local path="$base_path$header"
6565

6666
download_header $header $path || return 1
6767

6868
for include in $(sed -ne 's/^#include <\(.*\)>$/\1/p' $path); do
69-
if [ ! -f "${base_path}${include}" ]; then
69+
if [ ! -f "$base_path$include" ]; then
7070
read -p "Import $include (y/n): " import && [ "$import" = 'y' ] || continue
7171
echo "Importing $include for $path"
7272
import_header "$include" || return 1
@@ -85,8 +85,8 @@ fixup_includes()
8585

8686
# Prepend include path with "uapi/" if the header is imported
8787
for include in $(sed -ne 's/^#include <\(.*\)>$/\1/p' $path); do
88-
if [ -f "${base_path}${include}" ]; then
89-
sed -i "s|${include}|uapi/${include}|g" $path
88+
if [ -f "$base_path$include" ]; then
89+
sed -i "s|$include|uapi/$include|g" $path
9090
fi
9191
done
9292
}
@@ -106,7 +106,7 @@ check_header() {
106106
}
107107

108108
while getopts i:u:ch opt ; do
109-
case ${opt} in
109+
case $opt in
110110
i ) file=$OPTARG ;;
111111
u ) version=$OPTARG ;;
112112
c ) check_headers=1 ;;
@@ -123,9 +123,9 @@ fi
123123

124124
cd $(dirname $0)/..
125125

126-
current_version=$(< ${base_path}/version)
126+
current_version=$(< $base_path/version)
127127

128-
if [ -n "${version}" ]; then
128+
if [ -n "$version" ]; then
129129
if version_older_than "$version" "$current_version"; then
130130
echo "Headers already up to date ($current_version >= $version)"
131131
version=$current_version
@@ -137,15 +137,15 @@ else
137137
version=$current_version
138138
fi
139139

140-
if [ -n "${file}" ]; then
140+
if [ -n "$file" ]; then
141141
import_header $file || exit 1
142142
fi
143143

144144
for filename in $(find $base_path -name "*.h" -type f); do
145145
fixup_includes $filename || exit 1
146146
done
147147

148-
echo $version > ${base_path}/version
148+
echo $version > $base_path/version
149149

150150
if [ $check_headers -eq 0 ]; then
151151
exit 0
@@ -154,7 +154,7 @@ fi
154154
tmpheader="$(mktemp -t dpdk.checkuapi.XXXXXX)"
155155
trap "rm -f '$tmpheader'" INT
156156

157-
echo "Checking imported headers for version ${version}"
157+
echo "Checking imported headers for version $version"
158158

159159
for filename in $(find $base_path -name "*.h" -type f); do
160160
header=${filename#$base_path}

0 commit comments

Comments
 (0)