* [PATCH] lib.c: early return from handle_onoff_switch()
@ 2018-01-26 2:12 Randy Dunlap
2018-01-26 7:21 ` Luc Van Oostenryck
0 siblings, 1 reply; 2+ messages in thread
From: Randy Dunlap @ 2018-01-26 2:12 UTC (permalink / raw)
To: Linux-Sparse, Christopher Li
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(+)
--- 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.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] lib.c: early return from handle_onoff_switch()
2018-01-26 2:12 [PATCH] lib.c: early return from handle_onoff_switch() Randy Dunlap
@ 2018-01-26 7:21 ` Luc Van Oostenryck
0 siblings, 0 replies; 2+ messages in thread
From: Luc Van Oostenryck @ 2018-01-26 7:21 UTC (permalink / raw)
To: Randy Dunlap; +Cc: Linux-Sparse, Christopher Li
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>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-01-26 7:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-26 2:12 [PATCH] lib.c: early return from handle_onoff_switch() Randy Dunlap
2018-01-26 7:21 ` Luc Van Oostenryck
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.