Re: [PATCH] staging: atomisp: avoid false-positive maybe-uninitialized warning

From: Arnd Bergmann
Date: Tue Mar 28 2017 - 16:40:40 EST


On Tue, Mar 28, 2017 at 10:10 PM, kbuild test robot <lkp@xxxxxxxxx> wrote:
> Hi Arnd,
>
> [auto build test ERROR on staging/staging-testing]
> [also build test ERROR on next-20170328]
> [cannot apply to linuxtv-media/master v4.11-rc4]
> [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/Arnd-Bergmann/staging-atomisp-avoid-false-positive-maybe-uninitialized-warning/20170329-023715
> config: i386-allmodconfig (attached as .config)
> compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
> reproduce:
> # save the attached .config to linux build tree
> make ARCH=i386
>
> All errors (new ones prefixed by >>):
>
> drivers/staging/media/atomisp/i2c/mt9m114.c: In function 'mt9m114_get_fmt':
>>> drivers/staging/media/atomisp/i2c/mt9m114.c:818:25: error: unused variable 'dev' [-Werror=unused-variable]
> struct mt9m114_device *dev = to_mt9m114_sensor(sd);
> ^~~
> drivers/staging/media/atomisp/i2c/mt9m114.c: In function 'mt9m114_s_exposure_selection':
> drivers/staging/media/atomisp/i2c/mt9m114.c:1179:25: error: unused variable 'dev' [-Werror=unused-variable]
> struct mt9m114_device *dev = to_mt9m114_sensor(sd);
> ^~~
> cc1: all warnings being treated as errors
>

Very odd, I should obviouly have run into these when verifying my patch.
I guess

I'm preparing an v2 patch and will send that once I've built some more
randconfigs on top of recreating the bug and fix.

Arnd