[PATCH] lib.c: early return from handle_onoff_switch()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>

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@xxxxxxxxxxxxx>
---
 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.

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



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux