• Guenter Roeck's avatar
    hwmon: (emc2305) Remove unnecessary range check · a31d5359
    Guenter Roeck authored
    Static analyzers report:
    
    drivers/hwmon/emc2305.c:194 emc2305_set_cur_state()
    	warn: impossible condition '(val > 255) => (0-255 > 255)'
    
    'val' is u8 and thus can never be larger than 255. In theory
    the operation calculating 'val' could result in a value larger
    than 255, but this won't happen because its parameter has already
    been range checked and it is guaranteed that the result never exceeds
    255. Remove the unnecessary value check.
    
    Cc: Michael Shych <michaelsh@nvidia.com>
    Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
    a31d5359
emc2305.c 15.4 KB