[PATCH] lib/crc: make the CPU feature static keys __ro_after_init

Heiko Carstens hca at linux.ibm.com
Thu Apr 17 22:53:18 AEST 2025


On Sun, Apr 13, 2025 at 08:43:50AM -0700, Eric Biggers wrote:
> From: Eric Biggers <ebiggers at google.com>
> 
> All of the CRC library's CPU feature static_keys are initialized by
> initcalls and never change afterwards, so there's no need for them to be
> in the regular .data section.  Put them in .data..ro_after_init instead.
> 
> Signed-off-by: Eric Biggers <ebiggers at google.com>
> ---
> 
> I'm planning to take this via the crc tree.
> 
>  arch/arm/lib/crc-t10dif-glue.c       | 4 ++--
>  arch/arm/lib/crc32-glue.c            | 4 ++--
>  arch/arm64/lib/crc-t10dif-glue.c     | 4 ++--
>  arch/loongarch/lib/crc32-loongarch.c | 2 +-
>  arch/mips/lib/crc32-mips.c           | 2 +-
>  arch/powerpc/lib/crc-t10dif-glue.c   | 2 +-
>  arch/powerpc/lib/crc32-glue.c        | 2 +-
>  arch/s390/lib/crc32-glue.c           | 2 +-


Acked-by: Heiko Carstens <hca at linux.ibm.com> # s390

I just realized that we can get rid of the static key in the s390
piece and end up with slightly better code. Could you add the patch
below to your tree, please? If this would go via the s390 tree this
would result in a merge conflict, which is unnecessary.



More information about the Linuxppc-dev mailing list