Skip to contentSkip to conversation

nvram: annotate implicit fall through

PATCH In review Mathieu Malaterre 3 participants 3 messages Jan 14, 2019 – Jan 22, 2019 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvram: annotate implicit fall through

There is a plan to build the kernel with -Wimplicit-fallthrough and this place in the code produced a warning (W=1).

This commit remove the following warning:

drivers/char/generic_nvram.c:83:3: warning: this statement may fall through [-Wimplicit-fallthrough=]

---
 drivers/char/generic_nvram.c | 1 +
 1 file changed, 1 insertion(+)
drivers/char/generic_nvram.c +1 -0
index ff5394f47587..53123c110f7b 100644
@@ -81,6 +81,7 @@ static int nvram_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 #ifdef CONFIG_PPC_PMAC
 	case OBSOLETE_PMAC_NVRAM_GET_OFFSET:
 		printk(KERN_WARNING "nvram: Using obsolete PMAC_NVRAM_GET_OFFSET ioctl\n");
+		/* fall through */
 	case IOC_NVRAM_GET_OFFSET: {
 		int part, offset;
 
Signature · 1 line
2.19.2
Acked-by on v1 1/1
#1 lore raw
Quoted 17 lines · Mathieu Malaterre

There is a plan to build the kernel with -Wimplicit-fallthrough and this place in the code produced a warning (W=1).

This commit remove the following warning:

drivers/char/generic_nvram.c:83:3: warning: this statement may fall through [-Wimplicit-fallthrough=]

---
  drivers/char/generic_nvram.c | 1 +
  1 file changed, 1 insertion(+)
drivers/char/generic_nvram.c +0 -0
index ff5394f47587..53123c110f7b 100644

drivers/char/generic_nvram.c static int nvram_ioctl(struct file *file, unsigned int cmd, unsigned long arg) · line 83

Quoted 3 lines
drivers/char/generic_nvram.c +0 -0
@@ -81,6 +81,7 @@ static int nvram_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
  #ifdef CONFIG_PPC_PMAC
  	case OBSOLETE_PMAC_NVRAM_GET_OFFSET:
  		printk(KERN_WARNING "nvram: Using obsolete PMAC_NVRAM_GET_OFFSET ioctl\n");

Here you could use the pr_warn() macro instead of the obsolete printk KERN_WARNING, but that'd be another patch.

Anyway:

Thanks
--
Gustavo

Quoted 5 lines
drivers/char/generic_nvram.c +1 -0
+		/* fall through */
  	case IOC_NVRAM_GET_OFFSET: {
  		int part, offset;
 
#2 lore raw
In reply to Mathieu Malaterre
Quoted 18 lines · Mathieu Malaterre

There is a plan to build the kernel with -Wimplicit-fallthrough and this place in the code produced a warning (W=1).

This commit remove the following warning:

drivers/char/generic_nvram.c:83:3: warning: this statement may fall through [-Wimplicit-fallthrough=]

---
 drivers/char/generic_nvram.c | 1 +
 1 file changed, 1 insertion(+)
drivers/char/generic_nvram.c +0 -0
index ff5394f47587..53123c110f7b 100644

drivers/char/generic_nvram.c static int nvram_ioctl(struct file *file, unsigned int cmd, unsigned long arg) · line 87

Quoted 7 lines
drivers/char/generic_nvram.c +1 -0
@@ -81,6 +81,7 @@ static int nvram_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 #ifdef CONFIG_PPC_PMAC
 	case OBSOLETE_PMAC_NVRAM_GET_OFFSET:
 		printk(KERN_WARNING "nvram: Using obsolete PMAC_NVRAM_GET_OFFSET ioctl\n");
+		/* fall through */
 	case IOC_NVRAM_GET_OFFSET: {
 		int part, offset;
 

This file is now gone from my tree, sorry.

greg k-h