public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org, Fabio Estevam <festevam@gmail.com>
Cc: lkp@intel.com, kbuild-all@lists.01.org,
	linux-kernel@vger.kernel.org,
	Sakari Ailus <sakari.ailus@linux.intel.com>
Subject: [sailus-media-tree:master 55/60] drivers/media/i2c/adv7180.c:573 adv7180_test_pattern() error: uninitialized symbol 'reg'.
Date: Fri, 29 Apr 2022 13:30:14 +0300	[thread overview]
Message-ID: <202204290610.SVJgr8qV-lkp@intel.com> (raw)

tree:   git://linuxtv.org/sailus/media_tree.git master
head:   ea1280040a678f38a4ce6f1817933c04cfe74552
commit: f3b4b140d87dc7f256229f20a8d70429a7549aca [55/60] media: i2c: adv7180: Add support for the test patterns
config: microblaze-randconfig-m031-20220427 (https://download.01.org/0day-ci/archive/20220429/202204290610.SVJgr8qV-lkp@intel.com/config)
compiler: microblaze-linux-gcc (GCC) 11.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
drivers/media/i2c/adv7180.c:573 adv7180_test_pattern() error: uninitialized symbol 'reg'.

vim +/reg +573 drivers/media/i2c/adv7180.c

f3b4b140d87dc7f Fabio Estevam 2022-04-27  563  static int adv7180_test_pattern(struct adv7180_state *state, int value)
f3b4b140d87dc7f Fabio Estevam 2022-04-27  564  {
f3b4b140d87dc7f Fabio Estevam 2022-04-27  565  	unsigned int reg;
f3b4b140d87dc7f Fabio Estevam 2022-04-27  566  
f3b4b140d87dc7f Fabio Estevam 2022-04-27  567  	/* Map menu value into register value */
f3b4b140d87dc7f Fabio Estevam 2022-04-27  568  	if (value < 3)
f3b4b140d87dc7f Fabio Estevam 2022-04-27  569  		reg = value;
f3b4b140d87dc7f Fabio Estevam 2022-04-27  570  	if (value == 3)
f3b4b140d87dc7f Fabio Estevam 2022-04-27  571  		reg = 5;

Just write something like:

	if (value < 3)
		reg = value;
	else
		reg = 3;

f3b4b140d87dc7f Fabio Estevam 2022-04-27  572  
f3b4b140d87dc7f Fabio Estevam 2022-04-27 @573  	adv7180_write(state, ADV7180_REG_ANALOG_CLAMP_CTL, reg);
                                                                                                   ^^^
Uninitialized

f3b4b140d87dc7f Fabio Estevam 2022-04-27  574  
f3b4b140d87dc7f Fabio Estevam 2022-04-27  575  	if (value == ARRAY_SIZE(test_pattern_menu) - 1) {
f3b4b140d87dc7f Fabio Estevam 2022-04-27  576  		reg = adv7180_read(state, ADV7180_REG_DEF_VALUE_Y);
f3b4b140d87dc7f Fabio Estevam 2022-04-27  577  		reg &= ~ADV7180_DEF_VAL_EN;
f3b4b140d87dc7f Fabio Estevam 2022-04-27  578  		adv7180_write(state, ADV7180_REG_DEF_VALUE_Y, reg);
f3b4b140d87dc7f Fabio Estevam 2022-04-27  579  		return 0;
f3b4b140d87dc7f Fabio Estevam 2022-04-27  580  	}
f3b4b140d87dc7f Fabio Estevam 2022-04-27  581  
f3b4b140d87dc7f Fabio Estevam 2022-04-27  582  	reg = adv7180_read(state, ADV7180_REG_DEF_VALUE_Y);
f3b4b140d87dc7f Fabio Estevam 2022-04-27  583  	reg |= ADV7180_DEF_VAL_EN | ADV7180_DEF_VAL_AUTO_EN;
f3b4b140d87dc7f Fabio Estevam 2022-04-27  584  	adv7180_write(state, ADV7180_REG_DEF_VALUE_Y, reg);
f3b4b140d87dc7f Fabio Estevam 2022-04-27  585  
f3b4b140d87dc7f Fabio Estevam 2022-04-27  586  	return 0;
f3b4b140d87dc7f Fabio Estevam 2022-04-27  587  }

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp


             reply	other threads:[~2022-04-29 10:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-29 10:30 Dan Carpenter [this message]
2022-04-29 10:57 ` [sailus-media-tree:master 55/60] drivers/media/i2c/adv7180.c:573 adv7180_test_pattern() error: uninitialized symbol 'reg' Fabio Estevam
2022-04-29 11:27   ` Sakari Ailus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202204290610.SVJgr8qV-lkp@intel.com \
    --to=dan.carpenter@oracle.com \
    --cc=festevam@gmail.com \
    --cc=kbuild-all@lists.01.org \
    --cc=kbuild@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=sakari.ailus@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox