[PATCH] staging:board: Macros with flow control statements

Greg KH gregkh at linuxfoundation.org
Tue May 3 04:04:46 UTC 2016


On Tue, May 03, 2016 at 06:01:56AM +0300, Nikita Eshkeev wrote:
> This patch fixes the checkpatch.pl warning:
> 
> WARNING: Macros with flow control statements should be avoided
> +#define board_staging(str, fn)			\
> +static int __init runtime_board_check(void)	\
> +{						\
> +	if (of_machine_is_compatible(str))	\
> +		fn();				\
> +						\
> +	return 0;				\
> +}						\
> +						\
> +device_initcall(runtime_board_check)
> +

That's a dumb warning, the code is fine, as you can see.

checkpatch isn't always correct.

sorry,

greg k-h


More information about the devel mailing list