Message ID | 20230530102126.2886766-1-sakari.ailus@linux.intel.com |
---|---|
State | Accepted |
Commit | 9c2dcfc2cf0f2e4e0a0db33bc1a626e35928c475 |
Headers | show |
Series | [1/1] media: tc358746: Address compiler warnings | expand |
Hi Marco, On Wed, May 31, 2023 at 10:18:10AM +0200, Marco Felsch wrote: > Hi Sakari, > > Hans already sent a patch a few months ago: > - https://lore.kernel.org/linux-media/15030a07-3615-fca0-1891-a234dc054b00@xs4all.nl/ > > It turned out that the compiler had a bug albeit the compiler listed in > 'Closes:' is already a gcc-12 and now the warning used is slightly > different. > > I'm not again the patch but we should point out that this patch is only > required to make the compiler happy. Ack, thanks. I'll drop this then. The condition isn't trivial for a compiler to figure out though, even I'm not quite sure this is the case for all parameter values.
diff --git a/drivers/media/i2c/tc358746.c b/drivers/media/i2c/tc358746.c index ec1a193ba161a..25fbce5cabdaa 100644 --- a/drivers/media/i2c/tc358746.c +++ b/drivers/media/i2c/tc358746.c @@ -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) {