lkml.org 
[lkml]   [2023]   [Apr]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [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

\
 
 \ /
  Last update: 2023-04-28 21:17    [W:0.032 / U:1.524 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site