Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* Re: [PATCH v8 1/4] iio: pressure: bmp280: Use sleep and forced mode for oneshot captures
       [not found] <20241007194945.66192-2-vassilisamir@gmail.com>
@ 2024-10-11  4:32 ` kernel test robot
  2024-10-11 10:53   ` Andy Shevchenko
  0 siblings, 1 reply; 3+ messages in thread
From: kernel test robot @ 2024-10-11  4:32 UTC (permalink / raw)
  To: Vasileios Amoiridis, jic23, lars, robh, krzk+dt, conor+dt,
	andriy.shevchenko
  Cc: llvm, oe-kbuild-all, vassilisamir, ang.iglesiasg, linus.walleij,
	biju.das.jz, javier.carrasco.cruz, semen.protsenko, 579lpy, ak,
	linux-iio, devicetree, linux-kernel, christophe.jaillet

Hi Vasileios,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 96be67caa0f0420d4128cb67f07bbd7a6f49e03a]

url:    https://github.com/intel-lab-lkp/linux/commits/Vasileios-Amoiridis/iio-pressure-bmp280-Use-sleep-and-forced-mode-for-oneshot-captures/20241008-035238
base:   96be67caa0f0420d4128cb67f07bbd7a6f49e03a
patch link:    https://lore.kernel.org/r/20241007194945.66192-2-vassilisamir%40gmail.com
patch subject: [PATCH v8 1/4] iio: pressure: bmp280: Use sleep and forced mode for oneshot captures
config: i386-randconfig-006-20241011 (https://download.01.org/0day-ci/archive/20241011/202410111221.YIeXHxOv-lkp@intel.com/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241011/202410111221.YIeXHxOv-lkp@intel.com/reproduce)

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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202410111221.YIeXHxOv-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/iio/pressure/bmp280-core.c:1051:3: warning: variable 'meas_time_us' is uninitialized when used here [-Wuninitialized]
    1051 |                 meas_time_us += BMP280_PRESS_HUMID_MEAS_OFFSET +
         |                 ^~~~~~~~~~~~
   drivers/iio/pressure/bmp280-core.c:1046:32: note: initialize the variable 'meas_time_us' to silence this warning
    1046 |         unsigned int reg, meas_time_us;
         |                                       ^
         |                                        = 0
   drivers/iio/pressure/bmp280-core.c:2452:2: warning: variable 'offset' is uninitialized when used here [-Wuninitialized]
    2452 |         offset += sizeof(s32);
         |         ^~~~~~
   drivers/iio/pressure/bmp280-core.c:2437:17: note: initialize the variable 'offset' to silence this warning
    2437 |         int ret, offset;
         |                        ^
         |                         = 0
   2 warnings generated.


vim +/meas_time_us +1051 drivers/iio/pressure/bmp280-core.c

  1043	
  1044	static int bmp280_wait_conv(struct bmp280_data *data)
  1045	{
  1046		unsigned int reg, meas_time_us;
  1047		int ret;
  1048	
  1049		/* Check if we are using a BME280 device */
  1050		if (data->oversampling_humid)
> 1051			meas_time_us += BMP280_PRESS_HUMID_MEAS_OFFSET +
  1052					BIT(data->oversampling_humid) * BMP280_MEAS_DUR;
  1053	
  1054		/* Pressure measurement time */
  1055		meas_time_us += BMP280_PRESS_HUMID_MEAS_OFFSET +
  1056				BIT(data->oversampling_press) * BMP280_MEAS_DUR;
  1057	
  1058		/* Temperature measurement time */
  1059		meas_time_us += BIT(data->oversampling_temp) * BMP280_MEAS_DUR;
  1060	
  1061		/* Waiting time according to the BM(P/E)2 Sensor API */
  1062		fsleep(meas_time_us);
  1063	
  1064		ret = regmap_read(data->regmap, BMP280_REG_STATUS, &reg);
  1065		if (ret) {
  1066			dev_err(data->dev, "failed to read status register.\n");
  1067			return ret;
  1068		}
  1069	
  1070		if (reg & BMP280_REG_STATUS_MEAS_BIT) {
  1071			dev_err(data->dev, "Measurement cycle didn't complete.\n");
  1072			return -EBUSY;
  1073		}
  1074	
  1075		return 0;
  1076	}
  1077	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v8 1/4] iio: pressure: bmp280: Use sleep and forced mode for oneshot captures
  2024-10-11  4:32 ` [PATCH v8 1/4] iio: pressure: bmp280: Use sleep and forced mode for oneshot captures kernel test robot
@ 2024-10-11 10:53   ` Andy Shevchenko
  2024-10-11 17:35     ` Vasileios Aoiridis
  0 siblings, 1 reply; 3+ messages in thread
From: Andy Shevchenko @ 2024-10-11 10:53 UTC (permalink / raw)
  To: kernel test robot
  Cc: Vasileios Amoiridis, jic23, lars, robh, krzk+dt, conor+dt, llvm,
	oe-kbuild-all, ang.iglesiasg, linus.walleij, biju.das.jz,
	javier.carrasco.cruz, semen.protsenko, 579lpy, ak, linux-iio,
	devicetree, linux-kernel, christophe.jaillet

On Fri, Oct 11, 2024 at 12:32:12PM +0800, kernel test robot wrote:
> Hi Vasileios,
> 
> kernel test robot noticed the following build warnings:
> 
> [auto build test WARNING on 96be67caa0f0420d4128cb67f07bbd7a6f49e03a]
> 
> url:    https://github.com/intel-lab-lkp/linux/commits/Vasileios-Amoiridis/iio-pressure-bmp280-Use-sleep-and-forced-mode-for-oneshot-captures/20241008-035238
> base:   96be67caa0f0420d4128cb67f07bbd7a6f49e03a
> patch link:    https://lore.kernel.org/r/20241007194945.66192-2-vassilisamir%40gmail.com
> patch subject: [PATCH v8 1/4] iio: pressure: bmp280: Use sleep and forced mode for oneshot captures
> config: i386-randconfig-006-20241011 (https://download.01.org/0day-ci/archive/20241011/202410111221.YIeXHxOv-lkp@intel.com/config)
> compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241011/202410111221.YIeXHxOv-lkp@intel.com/reproduce)
> 
> 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@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202410111221.YIeXHxOv-lkp@intel.com/
> 
> All warnings (new ones prefixed by >>):
> 
> >> drivers/iio/pressure/bmp280-core.c:1051:3: warning: variable 'meas_time_us' is uninitialized when used here [-Wuninitialized]
>     1051 |                 meas_time_us += BMP280_PRESS_HUMID_MEAS_OFFSET +
>          |                 ^~~~~~~~~~~~
>    drivers/iio/pressure/bmp280-core.c:1046:32: note: initialize the variable 'meas_time_us' to silence this warning
>     1046 |         unsigned int reg, meas_time_us;
>          |                                       ^
>          |                                        = 0
>    drivers/iio/pressure/bmp280-core.c:2452:2: warning: variable 'offset' is uninitialized when used here [-Wuninitialized]
>     2452 |         offset += sizeof(s32);
>          |         ^~~~~~
>    drivers/iio/pressure/bmp280-core.c:2437:17: note: initialize the variable 'offset' to silence this warning
>     2437 |         int ret, offset;
>          |                        ^
>          |                         = 0

Rarely, but looks like this suggestion is okay, rather I would do it as 'else'
branch and convert '+=' in the 'if' part to be '='.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v8 1/4] iio: pressure: bmp280: Use sleep and forced mode for oneshot captures
  2024-10-11 10:53   ` Andy Shevchenko
@ 2024-10-11 17:35     ` Vasileios Aoiridis
  0 siblings, 0 replies; 3+ messages in thread
From: Vasileios Aoiridis @ 2024-10-11 17:35 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: kernel test robot, jic23, lars, robh, krzk+dt, conor+dt, llvm,
	oe-kbuild-all, ang.iglesiasg, linus.walleij, biju.das.jz,
	javier.carrasco.cruz, semen.protsenko, 579lpy, ak, linux-iio,
	devicetree, linux-kernel, christophe.jaillet

On Fri, Oct 11, 2024 at 01:53:21PM +0300, Andy Shevchenko wrote:
> On Fri, Oct 11, 2024 at 12:32:12PM +0800, kernel test robot wrote:
> > Hi Vasileios,
> > 
> > kernel test robot noticed the following build warnings:
> > 
> > [auto build test WARNING on 96be67caa0f0420d4128cb67f07bbd7a6f49e03a]
> > 
> > url:    https://github.com/intel-lab-lkp/linux/commits/Vasileios-Amoiridis/iio-pressure-bmp280-Use-sleep-and-forced-mode-for-oneshot-captures/20241008-035238
> > base:   96be67caa0f0420d4128cb67f07bbd7a6f49e03a
> > patch link:    https://lore.kernel.org/r/20241007194945.66192-2-vassilisamir%40gmail.com
> > patch subject: [PATCH v8 1/4] iio: pressure: bmp280: Use sleep and forced mode for oneshot captures
> > config: i386-randconfig-006-20241011 (https://download.01.org/0day-ci/archive/20241011/202410111221.YIeXHxOv-lkp@intel.com/config)
> > compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
> > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241011/202410111221.YIeXHxOv-lkp@intel.com/reproduce)
> > 
> > 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@intel.com>
> > | Closes: https://lore.kernel.org/oe-kbuild-all/202410111221.YIeXHxOv-lkp@intel.com/
> > 
> > All warnings (new ones prefixed by >>):
> > 
> > >> drivers/iio/pressure/bmp280-core.c:1051:3: warning: variable 'meas_time_us' is uninitialized when used here [-Wuninitialized]
> >     1051 |                 meas_time_us += BMP280_PRESS_HUMID_MEAS_OFFSET +
> >          |                 ^~~~~~~~~~~~
> >    drivers/iio/pressure/bmp280-core.c:1046:32: note: initialize the variable 'meas_time_us' to silence this warning
> >     1046 |         unsigned int reg, meas_time_us;
> >          |                                       ^
> >          |                                        = 0
> >    drivers/iio/pressure/bmp280-core.c:2452:2: warning: variable 'offset' is uninitialized when used here [-Wuninitialized]
> >     2452 |         offset += sizeof(s32);
> >          |         ^~~~~~
> >    drivers/iio/pressure/bmp280-core.c:2437:17: note: initialize the variable 'offset' to silence this warning
> >     2437 |         int ret, offset;
> >          |                        ^
> >          |                         = 0
> 
> Rarely, but looks like this suggestion is okay, rather I would do it as 'else'
> branch and convert '+=' in the 'if' part to be '='.

Hi Andy,

I though exactly the same, thanks for confirming my thoughts and thanks
for taking the time to suggest it!

Cheers,
Vasilis

> 
> -- 
> With Best Regards,
> Andy Shevchenko
> 
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-10-11 17:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20241007194945.66192-2-vassilisamir@gmail.com>
2024-10-11  4:32 ` [PATCH v8 1/4] iio: pressure: bmp280: Use sleep and forced mode for oneshot captures kernel test robot
2024-10-11 10:53   ` Andy Shevchenko
2024-10-11 17:35     ` Vasileios Aoiridis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox