[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZMuWF71x0thq/aTs@smile.fi.intel.com>
Date: Thu, 3 Aug 2023 14:57:11 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Tomi Valkeinen <tomi.valkeinen@...asonboard.com>
Cc: Mauro Carvalho Chehab <mchehab@...nel.org>,
Laurent Pinchart <laurent.pinchart@...asonboard.com>,
Sakari Ailus <sakari.ailus@...ux.intel.com>,
Hans Verkuil <hverkuil@...all.nl>, linux-media@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] media: i2c: ds90ub9x3: Fix use of uninitialized
variables
On Thu, Aug 03, 2023 at 11:41:38AM +0300, Tomi Valkeinen wrote:
> smatch reports some uninitialized variables:
>
> drivers/media/i2c/ds90ub913.c:481 ub913_log_status() error: uninitialized symbol 'v1'.
> drivers/media/i2c/ds90ub913.c:481 ub913_log_status() error: uninitialized symbol 'v2'.
> drivers/media/i2c/ds90ub953.c:655 ub953_log_status() error: uninitialized symbol 'gpio_local_data'.
> drivers/media/i2c/ds90ub953.c:655 ub953_log_status() error: uninitialized symbol 'gpio_input_ctrl'.
> drivers/media/i2c/ds90ub953.c:655 ub953_log_status() error: uninitialized symbol 'gpio_pin_sts'.
>
> These are used only for printing debug information, and the use of an
> uninitialized variable only happens if an i2c transaction has failed,
> which will print an error. Thus, fix the errors just by initializing the
> variables to 0.
>
> Fixes: 6363db1c9d45 ("media: i2c: add DS90UB953 driver")
> Fixes: c158d0d4ff15 ("media: i2c: add DS90UB913 driver")
I would prefer two separate changes on per driver basis. This is a good
practice to make backporting easier (generally speaking).
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists