Skip to contentSkip to conversation

common/rc: remove trailing space from _mread() default map_len

PATCH In review Prabhakar Pujeri 2 participants 2 messages Aug 31

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 common/rc: remove trailing space from _mread() default map_len

The default map_len expansion contains a space before its closing brace, so the variable includes trailing whitespace. Its current unquoted use tolerates that whitespace, but the value should contain only the computed length and may be used differently in the future.

Remove the stray space and leave the surrounding expansion unchanged.

---
 common/rc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/rc +1 -1
index 02bdb31..2db85e5 100644
@@ -176,7 +176,7 @@ _mread()
 	local file=$1
 	local offset=$2
 	local length=$3
-	local map_len=${4:-$(_round_up_to_page_boundary $(_get_filesize $file)) }
+	local map_len=${4:-$(_round_up_to_page_boundary $(_get_filesize $file))}
 
 	# Some callers expect xfs_io to crash with SIGBUS due to the mread,
 	# causing the shell to print "Bus error" to stderr.  To allow this
Signature · 1 line
2.55.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Prabhakar Pujeri

The default map_len expansion contains a space before its closing brace, so the variable includes trailing whitespace. Its current unquoted use tolerates that whitespace, but the value should contain only the computed length and may be used differently in the future.

Remove the stray space and leave the surrounding expansion unchanged.

Heh, whitespace...

--D

Quoted 21 lines
---
 common/rc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/rc +1 -1
index 02bdb31..2db85e5 100644
@@ -176,7 +176,7 @@ _mread()
 	local file=$1
 	local offset=$2
 	local length=$3
-	local map_len=${4:-$(_round_up_to_page_boundary $(_get_filesize $file)) }
+	local map_len=${4:-$(_round_up_to_page_boundary $(_get_filesize $file))}
 
 	# Some callers expect xfs_io to crash with SIGBUS due to the mread,
 	# causing the shell to print "Bus error" to stderr.  To allow this
Signature · 1 line
2.55.0