Skip to contentSkip to conversation

checkpatch-warn-on-unnecessary-void-function-return-statements.patch removed from -mm tree

merged [email protected] 1 participant 1 message Jun 5, 2014 Checkpatch

lore
Share & tools
lore
#0 lore raw

Subject: [merged] checkpatch-warn-on-unnecessary-void-function-return-statements.patch removed from -mm tree
To: [email protected],[email protected]
From: [email protected]
Date: Thu, 05 Jun 2014 13:07:19 -0700

The patch titled
Subject: checkpatch: warn on unnecessary void function return statements
has been removed from the -mm tree. Its filename was
checkpatch-warn-on-unnecessary-void-function-return-statements.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Joe Perches <[email protected]>
Subject: checkpatch: warn on unnecessary void function return statements

void function lines that use a single tab then "return;" are generally unnecessary.

---

 scripts/checkpatch.pl |    7 +++++++
 1 file changed, 7 insertions(+)
scripts/checkpatch.pl renamed from scripts/checkpatch.pl~checkpatch-warn-on-unnecessary-void-function-return-statements +7 -0
diff -puN scripts/checkpatch.pl~checkpatch-warn-on-unnecessary-void-function-return-statements scripts/checkpatch.pl
@@ -3470,6 +3470,13 @@ sub process {
 			}
 		}
 
+# unnecessary return in a void function? (a single leading tab, then return;)
+		if ($sline =~ /^\+\treturn\s*;\s*$/ &&
+		    $prevline =~ /^\+/) {
+			WARN("RETURN_VOID",
+			     "void function return statements are not generally useful\n" . $herecurr);
+		}
+
 # if statements using unnecessary parentheses - ie: if ((foo == bar))
 		if ($^V && $^V ge 5.10.0 &&
 		    $line =~ /\bif\s*((?:\(\s*){2,})/) {

_

Patches currently in -mm which might be from [email protected] are

origin.patch checkpatch-check-git-commit-descriptions.patch mm-utilc-add-kstrimdup.patch fs-isofs-logging-clean-up.patch fs-coda-replace-printk-by-pr_foo.patch fs-coda-logging-prefix-uniformization.patch fs-coda-use-__func__.patch fs-hfsplus-wrapperc-replace-shift-loop-by-ilog2.patch fs-affs-convert-printk-to-pr_foo.patch fs-affs-pr_debug-cleanup.patch fs-pstore-logging-clean-up.patch fs-pstore-logging-clean-up-fix.patch fs-devpts-inodec-convert-printk-to-pr_foo.patch fs-devpts-inodec-convert-printk-to-pr_foo-fix.patch ipc-semc-add-a-printk_once-for-semctlgetncnt-getzcnt.patch linux-next.patch arm-convert-use-of-typedef-ctl_table-to-struct-ctl_table.patch ia64-convert-use-of-typedef-ctl_table-to-struct-ctl_table.patch tile-convert-use-of-typedef-ctl_table-to-struct-ctl_table.patch cdrom-convert-use-of-typedef-ctl_table-to-struct-ctl_table.patch random-convert-use-of-typedef-ctl_table-to-struct-ctl_table.patch parport-convert-use-of-typedef-ctl_table-to-struct-ctl_table.patch scsi-convert-use-of-typedef-ctl_table-to-struct-ctl_table.patch coda-convert-use-of-typedef-ctl_table-to-struct-ctl_table.patch fscache-convert-use-of-typedef-ctl_table-to-struct-ctl_table.patch lockd-convert-use-of-typedef-ctl_table-to-struct-ctl_table.patch nfs-convert-use-of-typedef-ctl_table-to-struct-ctl_table.patch inotify-convert-use-of-typedef-ctl_table-to-struct-ctl_table.patch ntfs-convert-use-of-typedef-ctl_table-to-struct-ctl_table.patch fs-convert-use-of-typedef-ctl_table-to-struct-ctl_table.patch key-convert-use-of-typedef-ctl_table-to-struct-ctl_table.patch ipc-convert-use-of-typedef-ctl_table-to-struct-ctl_table.patch sysctl-convert-use-of-typedef-ctl_table-to-struct-ctl_table.patch mm-convert-use-of-typedef-ctl_table-to-struct-ctl_table.patch maintainers-add-linux-api-for-review-of-api-abi-changes.patch