[Intel-gfx] [PATCH 1/8] dim: declare and assign separately

Jani Nikula jani.nikula at intel.com
Tue Mar 21 10:14:27 UTC 2017


Fixes shellcheck SC2155: Declare and assign separately to avoid masking
return values.

Signed-off-by: Jani Nikula <jani.nikula at intel.com>
---
 dim | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dim b/dim
index 94bdce9dd6cd..c36ebdc7f7d8 100755
--- a/dim
+++ b/dim
@@ -1079,7 +1079,7 @@ function checkpatch_commit
 
 	# FIXME: this relies on local assignment not failing on command
 	# substitution failures
-	local bug_lines=$($cmd | grep -m 1 -B 1 '^\+.*\WBUG' | grep -c '^[+-].*\WBUG')
+	bug_lines=$($cmd | grep -m 1 -B 1 '^\+.*\WBUG' | grep -c '^[+-].*\WBUG')
 	if test "$bug_lines" -eq 1; then
 		warn_or_fail "New BUG macro added"
 	fi
@@ -1087,7 +1087,7 @@ function checkpatch_commit
         if [ "$branch" = "drm-intel-next-queued" ]; then
 		# FIXME: this relies on local assignment not failing on command
 		# substitution failures
-		local non_i915_files=$(git diff-tree --no-commit-id --name-only -r $commit | \
+		non_i915_files=$(git diff-tree --no-commit-id --name-only -r $commit | \
 			grep -v "^\(drivers/gpu/drm/i915/\|include/drm/i915\|include/uapi/drm/i915\)")
 
 		if [ -n "$non_i915_files" ]; then
-- 
2.1.4



More information about the Intel-gfx mailing list