Re: [PATCH] leds: lm355x: avoid enum conversion warning

2020-06-04 Thread Pavel Machek
Hi! > > > - reg_val = pdata->pass_mode; > > > + reg_val = (u32)pdata->pass_mode; > > > > Is this cast needed? I don't think there should be warning from going > > from an enumerated type to unsigned int. > > This cast is not needed for warnings, I added it for consistency

Re: [PATCH] leds: lm355x: avoid enum conversion warning

2020-05-06 Thread Nathan Chancellor
On Wed, May 06, 2020 at 04:19:45PM +0200, Arnd Bergmann wrote: > On Wed, May 6, 2020 at 4:44 AM Nathan Chancellor > wrote: > > > > On Tue, May 05, 2020 at 04:19:17PM +0200, Arnd Bergmann wrote: > > > clang points out that doing arithmetic between diffent enums is usually > >

Re: [PATCH] leds: lm355x: avoid enum conversion warning

2020-05-06 Thread Arnd Bergmann
On Wed, May 6, 2020 at 4:44 AM Nathan Chancellor wrote: > > On Tue, May 05, 2020 at 04:19:17PM +0200, Arnd Bergmann wrote: > > clang points out that doing arithmetic between diffent enums is usually > ^ different > > a mistake: > > > >

Re: [PATCH] leds: lm355x: avoid enum conversion warning

2020-05-05 Thread Nathan Chancellor
On Tue, May 05, 2020 at 04:19:17PM +0200, Arnd Bergmann wrote: > clang points out that doing arithmetic between diffent enums is usually ^ different > a mistake: > > drivers/leds/leds-lm355x.c:167:28: warning: bitwise operation between > different

[PATCH] leds: lm355x: avoid enum conversion warning

2020-05-05 Thread Arnd Bergmann
clang points out that doing arithmetic between diffent enums is usually a mistake: drivers/leds/leds-lm355x.c:167:28: warning: bitwise operation between different enumeration types ('enum lm355x_tx2' and 'enum lm355x_ntc') [-Wenum-enum-conversion] reg_val = pdata->pin_tx2 |