[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABgtM3gydDb7gv-GQvu6mMku0KLAM+DSXqd4+FQDsk9jcXV3YA@mail.gmail.com>
Date: Fri, 28 Apr 2023 16:15:44 -0300
From: Joaquin Aramendia <samsagax@...il.com>
To: Guenter Roeck <linux@...ck-us.net>
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
> > 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 ?
Said something about an invalid cast of an lvalue? I can´t remember exactly
and couldn't reproduce it again. Will change all to your form after
this patch gets
merged if you like, just to keep things atomic.
>
> > 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.
Yes. I'm taking an enum literal and taking its pointer to cast it to a void*.
A little cumbersome, but maybe it can be avoided by using your proposed
form directly and after making sure it works.
--
Joaquín I. Aramendía
Powered by blists - more mailing lists