media: tc358746: Address compiler warnings
PATCH v2 1/1 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':
Quoted 1 line
Quoted 1 line
drivers/media/i2c/tc358746.c:817:13: warning: 'p_best' is used uninitialized
[-Wuninitialized]
817 | u16 p_best, p;
| ^~~~~~Quoted 1 line
Quoted 1 line
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.
---
since v1:
- Note that this may be a false positive.
drivers/media/i2c/tc358746.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/i2c/tc358746.c +2 -2
@@ -813,8 +813,8 @@ static unsigned long tc358746_find_pll_settings(struct tc358746 *tc358746,u32 min_delta =0xffffffff ;u16 prediv_max =17 ;u16 prediv_min =1 ; -u16 m_best, mul; -u16 p_best, p; +u16 m_best =0 , mul; +u16 p_best =1 , p;u8 postdiv;if (fout >1000 *HZ_PER_MHZ ) {
Signature · 1 line
2.30.2
Quoted 13 lines · Sakari Ailus
Address these compiler warnings by initialising the
m_bestandp_bestvalues to 0 and 1 respectively (as latter is used as a divisor):drivers/media/i2c/tc358746.c: In function 'tc358746_find_pll_settings':Quoted 1 line
Quoted 1 line
drivers/media/i2c/tc358746.c:817:13: warning: 'p_best' is used uninitialized[-Wuninitialized]
817 | u16 p_best, p; | ^~~~~~Quoted 1 line
Quoted 1 line
drivers/media/i2c/tc358746.c:816:13: warning: 'm_best' is used uninitialized[-Wuninitialized]
816 | u16 m_best, mul; | ^~~~~~
Quoted 6 lines
The warnings may well be a false positive but it is difficult for a compiler to find out whether that truly is the case.
Reported-by kernel test robot <[email protected]>Signed-off-by Sakari Ailus <[email protected]>
Quoted 27 lines
---
since v1:- Note that this may be a false positive.
drivers/media/i2c/tc358746.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/media/i2c/tc358746.c +2
-2@@ -813,8 +813,8 @@ static unsigned long tc358746_find_pll_settings(struct tc358746 *tc358746,u32 min_delta =0xffffffff ;u16 prediv_max =17 ;u16 prediv_min =1 ; -u16 m_best, mul; -u16 p_best, p; +u16 m_best =0 , mul; +u16 p_best =1 , p;u8 postdiv;if (fout >1000 *HZ_PER_MHZ ) {Signature · 1 line
2.30.2