Re: [PATCH 23/35] media: dvb-frontends: tda10048: Use the right div

From: Dan Carpenter
Date: Tue Apr 16 2024 - 06:57:00 EST


On Tue, Apr 16, 2024 at 12:39:33PM +0200, Ricardo Ribalda wrote:
> Hi Dan
>
> What about going the safe way?
>
> --- a/drivers/media/dvb-frontends/tda10048.c
> +++ b/drivers/media/dvb-frontends/tda10048.c
> @@ -341,7 +341,7 @@ static int tda10048_set_wref(struct dvb_frontend
> *fe, u32 sample_freq_hz,
> /* t *= 2147483648 on 32bit platforms */
> t *= (2048 * 1024);
> t *= 1024;
> - z = 7 * sample_freq_hz;
> + z = (u64)7 * sample_freq_hz;

I think your patch works, but it might be nicer without the casts. We
end up having the discussion where it's like "Can this hz be above 4GHz?"
And, here, I think we're safe but a lot of stuff is pushing up against
that limit these days...

regards,
dan carpenter