public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa@kernel.org>
To: Justin Stitt <justinstitt@google.com>
Cc: Andi Shyti <andi.shyti@kernel.org>,
	Nathan Chancellor <nathan@kernel.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Tom Rix <trix@redhat.com>,
	linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
	llvm@lists.linux.dev
Subject: Re: [PATCH] i2c: pxa: fix clang -Wvoid-pointer-to-enum-cast warning
Date: Sat, 26 Aug 2023 00:17:33 +0200	[thread overview]
Message-ID: <ZOkofUzv6t9lXyN+@shikoro> (raw)
In-Reply-To: <20230816-void-drivers-i2c-busses-i2c-pxa-v1-1-931634b931ec@google.com>

[-- Attachment #1: Type: text/plain, Size: 462 bytes --]


> Note: I think something like this may be more readable:
> | 	*i2c_types = (enum pxa_i2c_types)(uintptr_t)of_id->data;
> 
> Thoughts on this approach against the one present in this patch?

On the one hand, I think this is more explicit and, thus, more readable.
On the other hand, we still have the loss of precision, between the
first and the second cast. Which gives it a bit of a "let's hide it
somewhat so the compiler will be happy" feeling?


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2023-08-25 22:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-16 19:48 [PATCH] i2c: pxa: fix clang -Wvoid-pointer-to-enum-cast warning Justin Stitt
2023-08-25 22:17 ` Wolfram Sang [this message]
2023-08-25 22:49   ` Justin Stitt
2023-08-25 22:52     ` Nick Desaulniers
2023-08-25 22:59     ` Wolfram Sang
2023-09-03 10:35       ` Andi Shyti

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=ZOkofUzv6t9lXyN+@shikoro \
    --to=wsa@kernel.org \
    --cc=andi.shyti@kernel.org \
    --cc=justinstitt@google.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=trix@redhat.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