Re: [PATCH] hwmon: (asus-ec-sensors) fix a typo in asus_ec_probe()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Feb 05, 2022 at 10:59:10AM +0100, Eugene Shalygin wrote:
> On Sat, 5 Feb 2022 at 10:20, Dan Carpenter <dan.carpenter@xxxxxxxxxx> wrote:
> >
> > There is no such struct as "asus_ec_sensors", it was supposed to be
> > "ec_sensors_data".  This typo does not affect either build or runtime.
> 
> Thank you for the fix! Perhaps you could also replace the sizeof
> argument below with *state to make the compiler check the declaration
> type?

No one likes resending patches especially for style issues that they
didn't introduce.

The sizeof() is how I noticed this, because I look at it whenever
someone allocates a different size or different type struct from
expected.  I did want to change it, but it wasn't necessary and I
couldn't find a compelling excuse to override the original author's
style choices.  ;)

The kind of bugs where someone allocates the wrong size seldom reach
real users.  Normally they would show up in your testing.  KASan is very
good at detecting them.  And we have a bunch of static analysis around
this issue as well.  It would be interesting to do a proper study on
this to look at bugs which only changed a sizeof() and see the time
since the Fixes tag.

regards,
dan carpenter



[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux