diff mbox

lib.c: early return from handle_onoff_switch()

Message ID d198c16f-9dcf-3238-942f-889c4322ba54@infradead.org (mailing list archive)
State Mainlined, archived
Headers show

Commit Message

Randy Dunlap Jan. 26, 2018, 2:12 a.m. UTC
From: Randy Dunlap <rdunlap@infradead.org>

When handling "-Wsparse-all" in handle_onoff_switch(), once all
warning flags have been set, the function can return instead of
checking for "no-" or other option names because they won't be
found. Just return NULL, which is what happens when handling
"-Wsparse-all" anyway.

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
---
 lib.c |    1 +
 1 file changed, 1 insertion(+)


--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Luc Van Oostenryck Jan. 26, 2018, 7:21 a.m. UTC | #1
On Thu, Jan 25, 2018 at 06:12:54PM -0800, Randy Dunlap wrote:
> From: Randy Dunlap <rdunlap@infradead.org>
> 
> When handling "-Wsparse-all" in handle_onoff_switch(), once all
> warning flags have been set, the function can return instead of
> checking for "no-" or other option names because they won't be
> found. Just return NULL, which is what happens when handling
> "-Wsparse-all" anyway.
> 
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>

Acked-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

--- sprs-2018-0119.orig/lib.c
+++ sprs-2018-0119/lib.c
@@ -565,6 +565,7 @@  static char **handle_onoff_switch(char *
 			if (*warnings[i].flag != WARNING_FORCE_OFF && warnings[i].flag != &Wsparse_error)
 				*warnings[i].flag = WARNING_ON;
 		}
+		return NULL;
 	}
 
 	// Prefixes "no" and "no-" mean to turn warning off.