From: Dan Carpenter <dan.carpenter@oracle.com>
To: Eugene Shalygin <eugene.shalygin@gmail.com>
Cc: Jean Delvare <jdelvare@suse.com>,
Guenter Roeck <linux@roeck-us.net>,
linux-hwmon@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] hwmon: (asus-ec-sensors) fix a typo in asus_ec_probe()
Date: Mon, 7 Feb 2022 10:10:50 +0300 [thread overview]
Message-ID: <20220207071050.GN1978@kadam> (raw)
In-Reply-To: <CAB95QAS8LxMeWGFqZ3MGHBBxxBafz3w9L1GxxdP16XjZKLVAuw@mail.gmail.com>
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@oracle.com> 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
next prev parent reply other threads:[~2022-02-07 7:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-05 9:20 [PATCH] hwmon: (asus-ec-sensors) fix a typo in asus_ec_probe() Dan Carpenter
2022-02-05 9:59 ` Eugene Shalygin
2022-02-05 17:55 ` Guenter Roeck
2022-02-07 7:10 ` Dan Carpenter [this message]
2022-02-05 17:52 ` Guenter Roeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220207071050.GN1978@kadam \
--to=dan.carpenter@oracle.com \
--cc=eugene.shalygin@gmail.com \
--cc=jdelvare@suse.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux@roeck-us.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.