Re: [PATCH] backlight: lp855x: Switch to atomic PWM API

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

 



Hi "Maíra,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on lee-backlight/for-backlight-next]
[also build test ERROR on v5.15-rc7 next-20211026]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Ma-ra-Canal/backlight-lp855x-Switch-to-atomic-PWM-API/20211024-103835
base:   https://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight.git for-backlight-next
config: riscv-buildonly-randconfig-r005-20211026 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project e5fb79b31424267704e9d2d9674089fd7316453e)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install riscv cross compiling tool for clang build
        # apt-get install binutils-riscv64-linux-gnu
        # https://github.com/0day-ci/linux/commit/f79ab2c306d1c5d666df34f3062f9f1a0b8e4448
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Ma-ra-Canal/backlight-lp855x-Switch-to-atomic-PWM-API/20211024-103835
        git checkout f79ab2c306d1c5d666df34f3062f9f1a0b8e4448
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=riscv 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

   In file included from drivers/video/backlight/lp855x_bl.c:10:
   In file included from include/linux/i2c.h:18:
   In file included from include/linux/regulator/consumer.h:35:
   In file included from include/linux/suspend.h:5:
   In file included from include/linux/swap.h:9:
   In file included from include/linux/memcontrol.h:13:
   In file included from include/linux/cgroup.h:26:
   In file included from include/linux/kernel_stat.h:9:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:11:
   In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/riscv/include/asm/io.h:136:
   include/asm-generic/io.h:464:31: error: performing pointer arithmetic on a null pointer has undefined behavior [-Werror,-Wnull-pointer-arithmetic]
           val = __raw_readb(PCI_IOBASE + addr);
                             ~~~~~~~~~~ ^
   include/asm-generic/io.h:477:61: error: performing pointer arithmetic on a null pointer has undefined behavior [-Werror,-Wnull-pointer-arithmetic]
           val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
                                                           ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:36:51: note: expanded from macro '__le16_to_cpu'
   #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
                                                     ^
   In file included from drivers/video/backlight/lp855x_bl.c:10:
   In file included from include/linux/i2c.h:18:
   In file included from include/linux/regulator/consumer.h:35:
   In file included from include/linux/suspend.h:5:
   In file included from include/linux/swap.h:9:
   In file included from include/linux/memcontrol.h:13:
   In file included from include/linux/cgroup.h:26:
   In file included from include/linux/kernel_stat.h:9:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:11:
   In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/riscv/include/asm/io.h:136:
   include/asm-generic/io.h:490:61: error: performing pointer arithmetic on a null pointer has undefined behavior [-Werror,-Wnull-pointer-arithmetic]
           val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
                                                           ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:34:51: note: expanded from macro '__le32_to_cpu'
   #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                                                     ^
   In file included from drivers/video/backlight/lp855x_bl.c:10:
   In file included from include/linux/i2c.h:18:
   In file included from include/linux/regulator/consumer.h:35:
   In file included from include/linux/suspend.h:5:
   In file included from include/linux/swap.h:9:
   In file included from include/linux/memcontrol.h:13:
   In file included from include/linux/cgroup.h:26:
   In file included from include/linux/kernel_stat.h:9:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:11:
   In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/riscv/include/asm/io.h:136:
   include/asm-generic/io.h:501:33: error: performing pointer arithmetic on a null pointer has undefined behavior [-Werror,-Wnull-pointer-arithmetic]
           __raw_writeb(value, PCI_IOBASE + addr);
                               ~~~~~~~~~~ ^
   include/asm-generic/io.h:511:59: error: performing pointer arithmetic on a null pointer has undefined behavior [-Werror,-Wnull-pointer-arithmetic]
           __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
                                                         ~~~~~~~~~~ ^
   include/asm-generic/io.h:521:59: error: performing pointer arithmetic on a null pointer has undefined behavior [-Werror,-Wnull-pointer-arithmetic]
           __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
                                                         ~~~~~~~~~~ ^
   include/asm-generic/io.h:1024:55: error: performing pointer arithmetic on a null pointer has undefined behavior [-Werror,-Wnull-pointer-arithmetic]
           return (port > MMIO_UPPER_LIMIT) ? NULL : PCI_IOBASE + port;
                                                     ~~~~~~~~~~ ^
>> drivers/video/backlight/lp855x_bl.c:242:6: error: variable 'pwm' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
           if (!lp->pwm) {
               ^~~~~~~~
   drivers/video/backlight/lp855x_bl.c:260:18: note: uninitialized use occurs here
           pwm_apply_state(pwm, &state);
                           ^~~
   drivers/video/backlight/lp855x_bl.c:242:2: note: remove the 'if' if its condition is always true
           if (!lp->pwm) {
           ^~~~~~~~~~~~~~
   drivers/video/backlight/lp855x_bl.c:238:24: note: initialize the variable 'pwm' to silence this warning
           struct pwm_device *pwm;
                                 ^
                                  = NULL
   8 errors generated.


vim +242 drivers/video/backlight/lp855x_bl.c

7be865ab8634d4e Kim, Milo   2012-03-23  233  
8cc9764c9c7d01a Kim, Milo   2012-12-17  234  static void lp855x_pwm_ctrl(struct lp855x *lp, int br, int max_br)
8cc9764c9c7d01a Kim, Milo   2012-12-17  235  {
8cc9764c9c7d01a Kim, Milo   2012-12-17  236  	unsigned int period = lp->pdata->period_ns;
8cc9764c9c7d01a Kim, Milo   2012-12-17  237  	unsigned int duty = br * period / max_br;
8cc9764c9c7d01a Kim, Milo   2012-12-17  238  	struct pwm_device *pwm;
f79ab2c306d1c5d Maíra Canal 2021-10-23  239  	struct pwm_state state;
8cc9764c9c7d01a Kim, Milo   2012-12-17  240  
8cc9764c9c7d01a Kim, Milo   2012-12-17  241  	/* request pwm device with the consumer name */
8cc9764c9c7d01a Kim, Milo   2012-12-17 @242  	if (!lp->pwm) {
8cc9764c9c7d01a Kim, Milo   2012-12-17  243  		pwm = devm_pwm_get(lp->dev, lp->chipname);
8cc9764c9c7d01a Kim, Milo   2012-12-17  244  		if (IS_ERR(pwm))
8cc9764c9c7d01a Kim, Milo   2012-12-17  245  			return;
8cc9764c9c7d01a Kim, Milo   2012-12-17  246  
8cc9764c9c7d01a Kim, Milo   2012-12-17  247  		lp->pwm = pwm;
8cc9764c9c7d01a Kim, Milo   2012-12-17  248  	}
8cc9764c9c7d01a Kim, Milo   2012-12-17  249  
f79ab2c306d1c5d Maíra Canal 2021-10-23  250  	pwm_init_state(pwm, &state);
f79ab2c306d1c5d Maíra Canal 2021-10-23  251  
f79ab2c306d1c5d Maíra Canal 2021-10-23  252  	state.duty_cycle = duty;
f79ab2c306d1c5d Maíra Canal 2021-10-23  253  	state.period = period;
f79ab2c306d1c5d Maíra Canal 2021-10-23  254  
8cc9764c9c7d01a Kim, Milo   2012-12-17  255  	if (duty)
f79ab2c306d1c5d Maíra Canal 2021-10-23  256  		state.enabled = true;
8cc9764c9c7d01a Kim, Milo   2012-12-17  257  	else
f79ab2c306d1c5d Maíra Canal 2021-10-23  258  		state.enabled = false;
f79ab2c306d1c5d Maíra Canal 2021-10-23  259  
f79ab2c306d1c5d Maíra Canal 2021-10-23  260  	pwm_apply_state(pwm, &state);
8cc9764c9c7d01a Kim, Milo   2012-12-17  261  }
8cc9764c9c7d01a Kim, Milo   2012-12-17  262  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux