Re: [PATCH] platform/surface: aggregator: shut up clang -Wconstantn-conversion warning

From: Arnd Bergmann
Date: Fri May 14 2021 - 16:05:58 EST


On Fri, May 14, 2021 at 9:41 PM Hans de Goede <hdegoede@xxxxxxxxxx> wrote:
> On 5/14/21 9:38 PM, Hans de Goede wrote:
> > On 5/14/21 4:21 PM, Maximilian Luz wrote:
> >> On 5/14/21 4:05 PM, Arnd Bergmann wrote:
> >>> From: Arnd Bergmann <arnd@xxxxxxxx>
> >>>
> >>> The assignment doesn't actually happen, but clang checks the type limits
> >>> before checking whether this assignment is reached. Shut up the warning
> >>> using an explicit type cast.
> >>
> >> I'm not too happy about this fix as (I believe) it will also shut up any
> >> valid GCC error message in case those macros are used with non-u8 (and
> >> non-SSAM_ANY_xxx) values.
> >
> > Since you're the maintainer of this code, I'll go with your judgement here,

Thanks for taking a careful look. After a little experimentation I managed to
come up with a different workaround that avoids the cast.

> I just went to patchwork to drop this patch from the queue:
>
> https://patchwork.kernel.org/projecat/platform-driver-x86/list/
>
> But it never got added there because platform-driver-x86@xxxxxxxxxxxxxxx
> was missing from the Cc even though get_maintainer.pl lists it.

I checked this as well now: the entries for the various surface drivers all
contain a reference to platform-driver-x86@xxxxxxxxxxxxxxx, but (at least
in v5.13-rc1) the entry for that subsystem that lists the include file
does not list this email.

Sending v2 to the list now.

Arnd