Re: [PATCH 2/2] leds: lm3601x: Introduce the lm3601x LED driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Dan,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on robh/for-next]
[also build test WARNING on v4.17-rc4 next-20180507]
[cannot apply to j.anaszewski-leds/for-next]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Dan-Murphy/dt-bindings-lm3601x-Introduce-the-lm3601x-driver/20180508-074439
base:   https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 7.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=ia64 

All warnings (new ones prefixed by >>):

   In file included from drivers/leds/leds-lm3601x.c:13:0:
   drivers/leds/leds-lm3601x.c: In function 'lm3601x_strobe_brightness_set':
>> drivers/leds/leds-lm3601x.c:272:6: warning: large integer implicitly truncated to unsigned type [-Woverflow]
         ~LM3601X_MODE_STROBE, LED_OFF);
         ^
   include/linux/regmap.h:76:36: note: in definition of macro 'regmap_update_bits'
     regmap_update_bits_base(map, reg, mask, val, NULL, false, false)
                                       ^~~~

vim +272 drivers/leds/leds-lm3601x.c

   258	
   259	static int lm3601x_strobe_brightness_set(struct led_classdev *cdev,
   260						 enum led_brightness brightness)
   261	{
   262		struct led_classdev_flash *fled_cdev = lcdev_to_flcdev(cdev);
   263		struct lm3601x_led *led = fled_cdev_to_led(fled_cdev);
   264		int ret;
   265		u8 brightness_val;
   266	
   267		mutex_lock(&led->lock);
   268		ret = lm3601x_read_faults(led);
   269	
   270		if (brightness == LED_OFF) {
   271			ret = regmap_update_bits(led->regmap, LM3601X_ENABLE_REG,
 > 272						~LM3601X_MODE_STROBE, LED_OFF);
   273			goto out;
   274		}
   275	
   276		if (brightness == LED_ON)
   277			brightness_val = LED_ON;
   278		else
   279			brightness_val = (brightness/2);
   280	
   281		ret = regmap_write(led->regmap, LM3601X_LED_FLASH_REG, brightness_val);
   282	
   283	out:
   284		mutex_unlock(&led->lock);
   285		return ret;
   286	}
   287	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux