net: ehea: Mark expected switch fall-through
Subsystems (2)
PATCH 1/1 net: ehea: Mark expected switch fall-through
Mark switch cases where we are expecting to fall through.
This patch fixes the following warning:
drivers/net/ethernet/ibm/ehea/ehea_main.c: In function 'ehea_mem_notifier':include/linux/printk.h:311:2: warning: this statement may fall through [-Wimplicit-fallthrough=]
printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~drivers/net/ethernet/ibm/ehea/ehea_main.c:3253:3: note: in expansion of macro 'pr_info'
pr_info("memory offlining canceled");
^~~~~~~drivers/net/ethernet/ibm/ehea/ehea_main.c:3256:2: note: here
case MEM_ONLINE:
^~~~
Notice that, in this particular case, the code comment is modified in accordance with what GCC is expecting to find.
--- drivers/net/ethernet/ibm/ehea/ehea_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/ibm/ehea/ehea_main.c +1 -1
@@ -3251,7 +3251,7 @@ static int ehea_mem_notifier(struct notifier_block *nb,switch (action) {case MEM_CANCEL_OFFLINE :pr_info ("memory offlining canceled" ); -/* Fall through: re-add canceled memory block */ +/* Fall through - re-add canceled memory block */ case MEM_ONLINE :pr_info ("memory is going online" );
Signature · 1 line
2.22.0
Quoted 15 lines · Gustavo A. R. Silva
Mark switch cases where we are expecting to fall through.
This patch fixes the following warning:
drivers/net/ethernet/ibm/ehea/ehea_main.c: In function 'ehea_mem_notifier':include/linux/printk.h:311:2: warning: this statement may fall through [-Wimplicit-fallthrough=]
printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~drivers/net/ethernet/ibm/ehea/ehea_main.c:3253:3: note: in expansion of macro 'pr_info'pr_info("memory offlining canceled"); ^~~~~~~
drivers/net/ethernet/ibm/ehea/ehea_main.c:3256:2: note: here
caseMEM_ONLINE:
^~~~
Quoted 5 lines
Notice that, in this particular case, the code comment is modified in accordance with what GCC is expecting to find.
Reported-by Stephen Rothwell <[email protected]>Signed-off-by Gustavo A. R. Silva <[email protected]>
-Kees
Quoted 20 lines
--- drivers/net/ethernet/ibm/ehea/ehea_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/ibm/ehea/ehea_main.c +1
-1@@ -3251,7 +3251,7 @@ static int ehea_mem_notifier(struct notifier_block *nb,switch (action) {case MEM_CANCEL_OFFLINE :pr_info ("memory offlining canceled" ); -/* Fall through: re-add canceled memory block */ +/* Fall through - re-add canceled memory block */ case MEM_ONLINE :pr_info ("memory is going online" );Signature · 1 line
2.22.0
Signature · 1 line
Kees Cook
From: "Gustavo A. R. Silva" <[email protected]>
Date: Sun, 28 Jul 2019 19:30:09 -0500
Quoted 15 lines
Mark switch cases where we are expecting to fall through.
This patch fixes the following warning:
drivers/net/ethernet/ibm/ehea/ehea_main.c: In function 'ehea_mem_notifier':include/linux/printk.h:311:2: warning: this statement may fall through [-Wimplicit-fallthrough=]
printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~drivers/net/ethernet/ibm/ehea/ehea_main.c:3253:3: note: in expansion of macro 'pr_info'pr_info("memory offlining canceled"); ^~~~~~~
drivers/net/ethernet/ibm/ehea/ehea_main.c:3256:2: note: here
caseMEM_ONLINE:
^~~~
Quoted 5 lines
Notice that, in this particular case, the code comment is modified in accordance with what GCC is expecting to find.
Reported-by Stephen Rothwell <[email protected]>Signed-off-by Gustavo A. R. Silva <[email protected]>
Applied.