mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Joaquin Aramendia <samsagax@gmail.com>
Cc: derekjohn.clark@gmail.com, jdelvare@suse.com,
	linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hwmon: (oxp-sensors) Add AYANEO 2 and Geek models
Date: Thu, 27 Apr 2023 21:05:31 -0700	[thread overview]
Message-ID: <dfcd56d1-102d-ace6-c8b3-8f668e5f6872@roeck-us.net> (raw)
In-Reply-To: <CABgtM3i+HZJDearvBK-sBrWnfqdrsuNCDYfxASC3QVsn8rAy-Q@mail.gmail.com>

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


  reply	other threads:[~2023-04-28  4:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-26 18:44 Joaquín Ignacio Aramendía
2023-04-27 17:35 ` Guenter Roeck
2023-04-27 23:16   ` Joaquin Aramendia
2023-04-28  4:05     ` Guenter Roeck [this message]
2023-04-28 19:15       ` Joaquin Aramendia
2023-04-28 19:33         ` Guenter Roeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dfcd56d1-102d-ace6-c8b3-8f668e5f6872@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=derekjohn.clark@gmail.com \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=samsagax@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®