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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <423fcac8-97cc-88b7-19d8-f93baddea3cd@gnuweeb.org>
Date:   Wed, 11 Jan 2023 13:03:54 +0700
From:   Ammar Faizi <ammarfaizi2@...weeb.org>
To:     XU pengfei <xupengfei@...china.com>,
        Guenter Roeck <linux@...ck-us.net>
Cc:     Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Jean Delvare <jdelvare@...e.com>, linux-hwmon@...r.kernel.org
Subject: Re: [PATCH 1/1] hwmon: remove unnecessary (void*) conversions

On 1/11/23 10:29 AM, Guenter Roeck wrote:
> On 1/10/23 18:07, XU pengfei wrote:
>> 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;

This is wrong. That cast is needed to discard the "const".

   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

-- 
Ammar Faizi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ