lkml.org 
[lkml]   [2023]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] i2c: pxa: fix clang -Wvoid-pointer-to-enum-cast warning

> 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?

[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2023-08-26 00:18    [W:0.058 / U:0.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site