• Arnd Bergmann's avatar
    leds: lm355x: avoid enum conversion warning · 985b1f59
    Arnd Bergmann authored
    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 | pdata->ntc_pin;
                              ~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~
    drivers/leds/leds-lm355x.c:178:28: warning: bitwise operation between different enumeration types ('enum lm355x_tx2' and 'enum lm355x_ntc') [-Wenum-enum-conversion]
                    reg_val = pdata->pin_tx2 | pdata->ntc_pin | pdata->pass_mode;
                              ~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~
    
    In this driver, it is intentional, so add a cast to hide the false-positive
    warning. It appears to be the only instance of this warning at the moment.
    
    Fixes: b98d13c7 ("leds: Add new LED driver for lm355x chips")
    Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
    Signed-off-by: default avatarPavel Machek <pavel@ucw.cz>
    985b1f59
leds-lm355x.c 12.6 KB