[PATCH] thermal/drivers/mediatek/lvts_thermal: fix memcpy's number of bytes in lvts_calibration_init()

Dan Carpenter error27 at gmail.com
Thu Mar 9 04:37:44 PST 2023


On Wed, Mar 08, 2023 at 10:10:34AM +0100, AngeloGioacchino Del Regno wrote:
> Il 07/03/23 14:42, bchihi at baylibre.com ha scritto:
> > From: Balsam CHIHI <bchihi at baylibre.com>
> > 
> > Replace memcpy 2 bytes by sizeof(int) bytes of LVTS calibration data.
> 
> sizeof(int) is architecture dependant...
> 

On Linux sizeof(int) is always 4.

I'm just so confused what you are talking about.  Are you thinking about
sizeof(long)?  Are you thinking about CPUs from the 1970s?  Linux wasn't
invented until the 90s so the old CPUs were already in museums at that
point.

> please use a fixed size type instead.

This is an unusual style opinion that I have not heard before.
Hopefully, you just got ints and longs confused so we can move on
without discussing it too much.  We're copying an int so sizeof(int) is
obviously correct.  It's hard to know how to respond.

> Also, shouldn't this be u16?!

What? Why would you think that?

regards,
dan carpenter




More information about the linux-arm-kernel mailing list