[PATCH 3/4] arm64: avoid -Woverride-init warning

Arnd Bergmann arnd at kernel.org
Mon Oct 26 15:30:43 EDT 2020


On Mon, Oct 26, 2020 at 6:01 PM Mark Rutland <mark.rutland at arm.com> wrote:
> On Mon, Oct 26, 2020 at 05:03:30PM +0100, Arnd Bergmann wrote:

> > @@ -335,6 +335,7 @@ static void cpuinfo_detect_icache_policy(struct cpuinfo_arm64 *info)
> >               set_bit(ICACHEF_VPIPT, &__icache_flags);
> >               break;
> >       default:
> > +     case ICACHE_POLICY_RESERVED:
> >       case ICACHE_POLICY_VIPT:
> >               /* Assume aliasing */
> >               set_bit(ICACHEF_ALIASING, &__icache_flags);
> >
> ... but it's a bit weird to have both the default and
> ICACHE_POLICY_RESERVED cases. If we get rid of the default case, does
> any compiler warn? I suspect the masking in CTR_L1IP() might be
> sufficient to let the compiler see we've handled all cases.

It's not an enum, so the compiler doesn't actually know what the
complete set is and doesn't warn without the default. I'll send a v2.

      Arnd



More information about the linux-arm-kernel mailing list