lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230111062737.GA2257783@roeck-us.net>
Date:   Tue, 10 Jan 2023 22:27:37 -0800
From:   Guenter Roeck <linux@...ck-us.net>
To:     Ammar Faizi <ammarfaizi2@...weeb.org>
Cc:     XU pengfei <xupengfei@...china.com>,
        Jean Delvare <jdelvare@...e.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        linux-hwmon@...r.kernel.org
Subject: Re: [PATCH 1/1] hwmon: powr1220: remove unnecessary (void*)
 conversions

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@...china.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ