Skip to content

Commit 9c2dcfc

Browse files
Sakari Ailusmchehab
authored andcommitted
media: tc358746: Address compiler warnings
Address these compiler warnings by initialising the m_best and p_best values to 0 and 1 respectively (as latter is used as a divisor): drivers/media/i2c/tc358746.c: In function 'tc358746_find_pll_settings': >> drivers/media/i2c/tc358746.c:817:13: warning: 'p_best' is used uninitialized [-Wuninitialized] 817 | u16 p_best, p; | ^~~~~~ >> drivers/media/i2c/tc358746.c:816:13: warning: 'm_best' is used uninitialized [-Wuninitialized] 816 | u16 m_best, mul; | ^~~~~~ The warnings may well be a false positive but it is difficult for a compiler to find out whether that truly is the case. Closes: https://lore.kernel.org/oe-kbuild-all/202305301627.fLT3Bkds-lkp@intel.com/ Reported-by: kernel test robot <lkp@intel.com> Fixes: 80a21da ("media: tc358746: add Toshiba TC358746 Parallel to CSI-2 bridge driver") Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
1 parent 06c2afb commit 9c2dcfc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/media/i2c/tc358746.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -813,8 +813,8 @@ static unsigned long tc358746_find_pll_settings(struct tc358746 *tc358746,
813813
u32 min_delta = 0xffffffff;
814814
u16 prediv_max = 17;
815815
u16 prediv_min = 1;
816-
u16 m_best, mul;
817-
u16 p_best, p;
816+
u16 m_best = 0, mul;
817+
u16 p_best = 1, p;
818818
u8 postdiv;
819819

820820
if (fout > 1000 * HZ_PER_MHZ) {

0 commit comments

Comments
 (0)