From 84ea4512d986bd6ee5482525880602f76f5d54d3 Mon Sep 17 00:00:00 2001 From: Patrick Pannuto Date: Wed, 4 Aug 2010 14:30:59 -0700 Subject: Checkpatch: Print location when catching return code error Display context so users can see where there error was OLD: ERROR: illegal return value, please use an error code NEW: ERROR: illegal return value, please use an error code #152: test.c:5: + return -1; Change-Id: I098004d9a5dbeb6c39b35b84ac94fd7a861849d7 Signed-off-by: Patrick Pannuto (cherry picked from commit 8d09803de5d629f3ebc9cb357a40b5937a5d171e) Signed-off-by: Stepan Moskovchenko --- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 0939b70a4230..7057ee01178b 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -5590,7 +5590,7 @@ sub process { # check for return codes on error paths if ($line =~ /\breturn\s+-\d+/) { ERROR("NO_ERROR_CODE", - "illegal return value, please use an error code"); + "illegal return value, please use an error code\n" . $herecurr); } # check for gcc specific __FUNCTION__ -- cgit v1.2.3