Skip to contentSkip to conversation

cpufreq: sc520_freq: add 'fallthrough' to one case

PATCH Applied Randy Dunlap 3 participants 4 messages May 3, 2021 – May 21, 2021 CPU frequency scaling framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cpufreq: sc520_freq: add 'fallthrough' to one case

Quieten an implicit-fallthrough warning in sc520_freq.c:

../drivers/cpufreq/sc520_freq.c: In function 'sc520_freq_get_cpu_frequency':
../include/linux/printk.h:343:2: warning: this statement may fall through [-Wimplicit-fallthrough=]
printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
../drivers/cpufreq/sc520_freq.c:43:3: note: in expansion of macro 'pr_err'
pr_err("error: cpuctl register has unexpected value %02x\n",
../drivers/cpufreq/sc520_freq.c:45:2: note: here
case 0x01:

Fixes bf6fc9fd2d848 ("[CPUFREQ] AMD Elan SC520 cpufreq driver.")
Cc "Rafael J. Wysocki" <[email protected]>
Cc Viresh Kumar <[email protected]>

---
Found in linux-next but applies to mainline.

 drivers/cpufreq/sc520_freq.c |    1 +
 1 file changed, 1 insertion(+)
drivers/cpufreq/sc520_freq.c +1 -0
@@ -42,6 +42,7 @@ static unsigned int sc520_freq_get_cpu_f
 	default:
 		pr_err("error: cpuctl register has unexpected value %02x\n",
 		       clockspeed_reg);
+		fallthrough;
 	case 0x01:
 		return 100000;
 	case 0x02:
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 24 lines · Randy Dunlap

Quieten an implicit-fallthrough warning in sc520_freq.c:

../drivers/cpufreq/sc520_freq.c: In function 'sc520_freq_get_cpu_frequency':
../include/linux/printk.h:343:2: warning: this statement may fall through [-Wimplicit-fallthrough=]
printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
../drivers/cpufreq/sc520_freq.c:43:3: note: in expansion of macro 'pr_err'
pr_err("error: cpuctl register has unexpected value %02x\n",
../drivers/cpufreq/sc520_freq.c:45:2: note: here
case 0x01:

Fixes bf6fc9fd2d848 ("[CPUFREQ] AMD Elan SC520 cpufreq driver.")
Cc "Rafael J. Wysocki" <[email protected]>
Cc Viresh Kumar <[email protected]>

---
Found in linux-next but applies to mainline.

 drivers/cpufreq/sc520_freq.c |    1 +
 1 file changed, 1 insertion(+)

drivers/cpufreq/sc520_freq.c static unsigned int sc520_freq_get_cpu_f · line 48

Quoted 7 lines
drivers/cpufreq/sc520_freq.c +1 -0
@@ -42,6 +42,7 @@ static unsigned int sc520_freq_get_cpu_f
 	default:
 		pr_err("error: cpuctl register has unexpected value %02x\n",
 		       clockspeed_reg);
+		fallthrough;
 	case 0x01:
 		return 100000;
 	case 0x02:
Signature · 1 line
viresh
#2 lore raw
Quoted 22 lines · Viresh Kumar
Quoted 21 lines · Randy Dunlap

Quieten an implicit-fallthrough warning in sc520_freq.c:

../drivers/cpufreq/sc520_freq.c: In function 'sc520_freq_get_cpu_frequency':
../include/linux/printk.h:343:2: warning: this statement may fall through [-Wimplicit-fallthrough=]
printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
../drivers/cpufreq/sc520_freq.c:43:3: note: in expansion of macro 'pr_err'
pr_err("error: cpuctl register has unexpected value %02x\n",
../drivers/cpufreq/sc520_freq.c:45:2: note: here
case 0x01:

Fixes bf6fc9fd2d848 ("[CPUFREQ] AMD Elan SC520 cpufreq driver.")
Cc "Rafael J. Wysocki" <[email protected]>
Cc Viresh Kumar <[email protected]>

---
Found in linux-next but applies to mainline.

 drivers/cpufreq/sc520_freq.c |    1 +
 1 file changed, 1 insertion(+)
Quoted 13 lines

drivers/cpufreq/sc520_freq.c static unsigned int sc520_freq_get_cpu_f · line 48

Quoted 10 lines
drivers/cpufreq/sc520_freq.c +1 -0
@@ -42,6 +42,7 @@ static unsigned int sc520_freq_get_cpu_f
 	default:
 		pr_err("error: cpuctl register has unexpected value %02x\n",
 		       clockspeed_reg);
+		fallthrough;
 	case 0x01:
 		return 100000;
 	case 0x02:

Rafael, ping?

thanks.

Signature · 1 line
~Randy
maintainer Applied
#3 lore raw
Quoted 38 lines · Randy Dunlap
Quoted 22 lines · Viresh Kumar
Quoted 21 lines · Randy Dunlap

Quieten an implicit-fallthrough warning in sc520_freq.c:

../drivers/cpufreq/sc520_freq.c: In function 'sc520_freq_get_cpu_frequency':
../include/linux/printk.h:343:2: warning: this statement may fall through [-Wimplicit-fallthrough=]
printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
../drivers/cpufreq/sc520_freq.c:43:3: note: in expansion of macro 'pr_err'
pr_err("error: cpuctl register has unexpected value %02x\n",
../drivers/cpufreq/sc520_freq.c:45:2: note: here
case 0x01:

Fixes bf6fc9fd2d848 ("[CPUFREQ] AMD Elan SC520 cpufreq driver.")
Cc "Rafael J. Wysocki" <[email protected]>
Cc Viresh Kumar <[email protected]>

---
Found in linux-next but applies to mainline.

 drivers/cpufreq/sc520_freq.c |    1 +
 1 file changed, 1 insertion(+)
Quoted 13 lines

drivers/cpufreq/sc520_freq.c static unsigned int sc520_freq_get_cpu_f · line 48

Quoted 10 lines
drivers/cpufreq/sc520_freq.c +1 -0
@@ -42,6 +42,7 @@ static unsigned int sc520_freq_get_cpu_f
     default:
             pr_err("error: cpuctl register has unexpected value %02x\n",
                    clockspeed_reg);
+            fallthrough;
     case 0x01:
             return 100000;
     case 0x02:
Quoted 1 line

Rafael, ping?

Applied as 5.14 material, thanks!