powerpc/64: Used named initialisers for ibm_pa_features
Michael Ellerman
patch-notifications at ellerman.id.au
Tue Nov 22 11:34:21 AEDT 2016
On Fri, 2016-10-28 at 06:39:53 UTC, Michael Ellerman wrote:
> The ibm_pa_features array consists of structures that describe which bit
> and byte in the ibm,pa-features property toggles one or more flags in
> either the CPU, MMU, or user visible feature flags.
>
> Each one consists of 7 values, which are all unsigned long, int or char,
> meaning the compiler gives us no warning if we assign the wrong values
> to the wrong elements. In fact we have had a bug here in the past, where
> we were setting incorrect bits, see commit 6997e57d693b ("powerpc:
> scan_features() updates incorrect bits for REAL_LE").
>
> So switch to using named initialisers for the structure elements, to
> reduce the likelihood of future bugs, and hopefully improve readability
> also.
>
> Signed-off-by: Michael Ellerman <mpe at ellerman.id.au>
> Acked-by: Balbir Singh <bsingharora at gmail.com>
Applied to powerpc next.
https://git.kernel.org/powerpc/c/e9eb0278dad9c7a2631d5432180a13
cheers
More information about the Linuxppc-dev
mailing list