[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <dfcd56d1-102d-ace6-c8b3-8f668e5f6872@roeck-us.net>
Date: Thu, 27 Apr 2023 21:05:31 -0700
From: Guenter Roeck <linux@...ck-us.net>
To: Joaquin Aramendia <samsagax@...il.com>
Cc: derekjohn.clark@...il.com, jdelvare@...e.com,
linux-hwmon@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] hwmon: (oxp-sensors) Add AYANEO 2 and Geek models
On 4/27/23 16:16, Joaquin Aramendia wrote:
> Hello Guenter and thanks for your quick review.
>
>> Please run checkpatch --strict on your patches. Never mind, I'll apply the
>> patch anyway - I see the other entries are the same.
> I've run it before on the other patches... did something change in the
> checkpatch?
> Nevermid, After this one I may submit a patch to fix all styling in one go
>
>> That makes me have a closer look at the code. What is the purpose of the
>> odd typecast anyway ? Why not just
>> .driver_data = (void *)aya_neo_2,
>> and
>> board = (enum oxp_board)dmi_entry->driver_data;
>> ?
> I don't know why but the compiler would complain with the casting from
> enum to void*.
Really ? I tried with both 32 bit and 64 bit targets, and the above worked
just fine (with W=1). I tried with gcc 10.3 as well as 11.3. What is
your compiler version, what exactly is the warning/error message you
observed, and how exactly did your code look like ?
> Found out that explicitly casting the enum literal before casting it
> to void* works and
> the compiler stopped complaining so I went with it.
>
You are not casting the enum literal, but a pointer to it.
Guenter
> As a follow up question, since this driver has become more AYANEO than
> OXP since its inception,
> wouldn't it be better to change the description?
>
> Joaquín Aramendía
Powered by blists - more mailing lists