[PATCH v3 3/9] selftests: arm, arm64: Use ifdeffery to pull signal infrastructure

Mark Brown broonie at kernel.org
Tue Jun 25 08:42:44 PDT 2024


On Tue, Jun 25, 2024 at 05:54:02PM +0530, Dev Jain wrote:

> Use ifdeffery to guard code chunks meant specifically for arm64, in
> preparation for putting signal tests in selftests/arm.

I've got to say I don't love this but I'm not sure how much better we
could do if we want to share the code.  Though one thing that did jump
out at me was:

> +/* Not used by selftests/arm */
> +#ifdef __aarch64__
>  #define __stringify_1(x...)	#x
>  #define __stringify(x...)	__stringify_1(x)
>  
> @@ -43,6 +45,7 @@ enum {
>  #define FEAT_SME		(1UL << FSME_BIT)
>  #define FEAT_SME_FA64		(1UL << FSME_FA64_BIT)
>  #define FEAT_SME2		(1UL << FSME2_BIT)
> +#endif

There's a lot of ifdefs around feature handling.  Could we reduce the
ifdeffery by instead of removing all the code just removing the
definitions of the features and the bit that initialises them based on
the hwcaps?  In general a stubbing out approach like that tends to be
cleaner and less fragile.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20240625/7cd815ad/attachment.sig>


More information about the linux-arm-kernel mailing list