diff mbox series

cpufreq: sc520_freq: add 'fallthrough' to one case

Message ID 20210503161840.26771-1-rdunlap@infradead.org (mailing list archive)
State Mainlined, archived
Headers show
Series cpufreq: sc520_freq: add 'fallthrough' to one case | expand

Commit Message

Randy Dunlap May 3, 2021, 4:18 p.m. UTC
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.")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: linux-pm@vger.kernel.org
---
Found in linux-next but applies to mainline.

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

Comments

Viresh Kumar May 4, 2021, 6:22 a.m. UTC | #1
On 03-05-21, 09:18, Randy Dunlap wrote:
> 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.")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> Cc: Viresh Kumar <viresh.kumar@linaro.org>
> Cc: linux-pm@vger.kernel.org
> ---
> Found in linux-next but applies to mainline.
> 
>  drivers/cpufreq/sc520_freq.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> --- linux-next-20210503.orig/drivers/cpufreq/sc520_freq.c
> +++ linux-next-20210503/drivers/cpufreq/sc520_freq.c
> @@ -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:

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Randy Dunlap May 18, 2021, 10:19 p.m. UTC | #2
On 5/3/21 11:22 PM, Viresh Kumar wrote:
> On 03-05-21, 09:18, Randy Dunlap wrote:
>> 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.")
>> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
>> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
>> Cc: Viresh Kumar <viresh.kumar@linaro.org>
>> Cc: linux-pm@vger.kernel.org
>> ---
>> Found in linux-next but applies to mainline.
>>
>>  drivers/cpufreq/sc520_freq.c |    1 +
>>  1 file changed, 1 insertion(+)
>>
>> --- linux-next-20210503.orig/drivers/cpufreq/sc520_freq.c
>> +++ linux-next-20210503/drivers/cpufreq/sc520_freq.c
>> @@ -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:
> 
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
> 

Rafael, ping?

thanks.
Rafael J. Wysocki May 21, 2021, 4:53 p.m. UTC | #3
On Wed, May 19, 2021 at 12:19 AM Randy Dunlap <rdunlap@infradead.org> wrote:
>
> On 5/3/21 11:22 PM, Viresh Kumar wrote:
> > On 03-05-21, 09:18, Randy Dunlap wrote:
> >> 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.")
> >> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> >> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> >> Cc: Viresh Kumar <viresh.kumar@linaro.org>
> >> Cc: linux-pm@vger.kernel.org
> >> ---
> >> Found in linux-next but applies to mainline.
> >>
> >>  drivers/cpufreq/sc520_freq.c |    1 +
> >>  1 file changed, 1 insertion(+)
> >>
> >> --- linux-next-20210503.orig/drivers/cpufreq/sc520_freq.c
> >> +++ linux-next-20210503/drivers/cpufreq/sc520_freq.c
> >> @@ -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:
> >
> > Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
> >
>
> Rafael, ping?

Applied as 5.14 material, thanks!
diff mbox series

Patch

--- linux-next-20210503.orig/drivers/cpufreq/sc520_freq.c
+++ linux-next-20210503/drivers/cpufreq/sc520_freq.c
@@ -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: