[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <954d6aa4-5dc7-4421-9b92-4cb9a0b9d40c@suswa.mountain>
Date: Fri, 8 Nov 2024 17:34:01 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: oe-kbuild@...ts.linux.dev,
Vicentiu Galanopulo <vicentiu.galanopulo@...ote-tech.co.uk>,
Pavel Machek <pavel@....cz>, Lee Jones <lee@...nel.org>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Jonathan Corbet <corbet@....net>, linux-leds@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-doc@...r.kernel.org
Cc: lkp@...el.com, oe-kbuild-all@...ts.linux.dev
Subject: Re: [PATCH 3/3] [PATCH v6] leds: Add LED1202 I2C driver
Hi Vicentiu,
kernel test robot noticed the following build warnings:
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Vicentiu-Galanopulo/dt-bindings-leds-Add-LED1202-LED-Controller/20241106-142011
base: https://git.kernel.org/pub/scm/linux/kernel/git/lee/leds.git for-leds-next
patch link: https://lore.kernel.org/r/20241106061812.6819-3-vicentiu.galanopulo%40remote-tech.co.uk
patch subject: [PATCH 3/3] [PATCH v6] leds: Add LED1202 I2C driver
config: loongarch-randconfig-r073-20241107 (https://download.01.org/0day-ci/archive/20241108/202411080756.6eYdrM5X-lkp@intel.com/config)
compiler: loongarch64-linux-gcc (GCC) 14.2.0
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@...el.com>
| Reported-by: Dan Carpenter <dan.carpenter@...aro.org>
| Closes: https://lore.kernel.org/r/202411080756.6eYdrM5X-lkp@intel.com/
smatch warnings:
drivers/leds/leds-st1202.c:175 st1202_brightness_get() error: uninitialized symbol 'value'.
vim +/value +175 drivers/leds/leds-st1202.c
7e6780184dc934 Vicentiu Galanopulo 2024-11-06 155 static enum led_brightness st1202_brightness_get(struct led_classdev *led_cdev)
7e6780184dc934 Vicentiu Galanopulo 2024-11-06 156 {
7e6780184dc934 Vicentiu Galanopulo 2024-11-06 157 struct st1202_led *led;
7e6780184dc934 Vicentiu Galanopulo 2024-11-06 158 struct st1202_chip *chip;
7e6780184dc934 Vicentiu Galanopulo 2024-11-06 159 u8 value;
7e6780184dc934 Vicentiu Galanopulo 2024-11-06 160 int ret;
7e6780184dc934 Vicentiu Galanopulo 2024-11-06 161
7e6780184dc934 Vicentiu Galanopulo 2024-11-06 162 led = cdev_to_st1202_led(led_cdev);
7e6780184dc934 Vicentiu Galanopulo 2024-11-06 163 chip = led->chip;
7e6780184dc934 Vicentiu Galanopulo 2024-11-06 164
7e6780184dc934 Vicentiu Galanopulo 2024-11-06 165 mutex_lock(&chip->lock);
7e6780184dc934 Vicentiu Galanopulo 2024-11-06 166
7e6780184dc934 Vicentiu Galanopulo 2024-11-06 167 ret = st1202_read_reg(chip, ST1202_ILED_REG0 + led->led_num,
7e6780184dc934 Vicentiu Galanopulo 2024-11-06 168 &value);
7e6780184dc934 Vicentiu Galanopulo 2024-11-06 169 if (ret != 0)
7e6780184dc934 Vicentiu Galanopulo 2024-11-06 170 dev_err(&chip->client->dev, "Reading register [0x%x] failed, error: %d\n",
7e6780184dc934 Vicentiu Galanopulo 2024-11-06 171 ST1202_ILED_REG0 + led->led_num, ret);
Presumably value is uninitialized if st1202_read_reg() fails. Normally
I would just mark st1202_read_reg() as a no-fail function and not
report it but here there is explicit error checking so it's weird.
7e6780184dc934 Vicentiu Galanopulo 2024-11-06 172
7e6780184dc934 Vicentiu Galanopulo 2024-11-06 173 mutex_unlock(&chip->lock);
7e6780184dc934 Vicentiu Galanopulo 2024-11-06 174
7e6780184dc934 Vicentiu Galanopulo 2024-11-06 @175 return value;
7e6780184dc934 Vicentiu Galanopulo 2024-11-06 176 }
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Powered by blists - more mailing lists