From: Guenter Roeck <linux@roeck-us.net>
To: Ammar Faizi <ammarfaizi2@gnuweeb.org>
Cc: XU pengfei <xupengfei@nfschina.com>,
Jean Delvare <jdelvare@suse.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
linux-hwmon@vger.kernel.org
Subject: Re: [PATCH 1/1] hwmon: powr1220: remove unnecessary (void*) conversions
Date: Tue, 10 Jan 2023 22:27:37 -0800 [thread overview]
Message-ID: <20230111062737.GA2257783@roeck-us.net> (raw)
In-Reply-To: <efbc4e6f-b583-239b-439b-6ebc01ffe44d@gnuweeb.org>
On Wed, Jan 11, 2023 at 01:15:17PM +0700, Ammar Faizi wrote:
> On 1/11/23 11:37 AM, XU pengfei wrote:
> > Pointer variables of void * type do not require type cast.
> >
> > Signed-off-by: XU pengfei <xupengfei@nfschina.com>
> > ---
> > drivers/hwmon/powr1220.c | 2 +-
> > 1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/drivers/hwmon/powr1220.c b/drivers/hwmon/powr1220.c
> > index f77dc6db31ac..501337ee5aa3 100644
> > --- a/drivers/hwmon/powr1220.c
> > +++ b/drivers/hwmon/powr1220.c
> > @@ -174,7 +174,7 @@ static umode_t
> > powr1220_is_visible(const void *data, enum hwmon_sensor_types type, u32
> > attr, int channel)
> > {
> > - struct powr1220_data *chip_data = (struct powr1220_data *)data;
> > + struct powr1220_data *chip_data = data;
>
> Broken:
>
> CC [M] drivers/hwmon/powr1220.o
> drivers/hwmon/powr1220.c: In function ‘powr1220_is_visible’:
> drivers/hwmon/powr1220.c:177:43: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
> 177 | struct powr1220_data *chip_data = data;
> | ^~~~
> cc1: all warnings being treated as errors
> make[2]: *** [scripts/Makefile.build:249: drivers/hwmon/powr1220.o] Error 1
> make[1]: *** [scripts/Makefile.build:465: drivers/hwmon] Error 2
> make: *** [Makefile:1853: drivers] Error 2
>
Thanks for catching. Sigh. Wouldn't it be nice if submitters would
at least build test their patches ?
Guenter
next prev parent reply other threads:[~2023-01-11 6:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-11 4:37 [PATCH 1/1] hwmon: powr1220: remove unnecessary (void*) conversions XU pengfei
2023-01-11 6:15 ` Ammar Faizi
2023-01-11 6:27 ` Guenter Roeck [this message]
2023-01-20 18:26 ` kernel test robot
2023-01-20 19:08 ` kernel test robot
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=20230111062737.GA2257783@roeck-us.net \
--to=linux@roeck-us.net \
--cc=ammarfaizi2@gnuweeb.org \
--cc=jdelvare@suse.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=xupengfei@nfschina.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).