[PATCH v8 2/6] powerpc/code-patching: Use WARN_ON and fix check in poking_init
Russell Currey
ruscur at russell.cc
Mon Oct 24 14:08:28 AEDT 2022
On Fri, 2022-10-21 at 16:22 +1100, Benjamin Gray wrote:
> From: "Christopher M. Riedl" <cmr at bluescreens.de>
>
> The latest kernel docs list BUG_ON() as 'deprecated' and that they
> should be replaced with WARN_ON() (or pr_warn()) when possible. The
> BUG_ON() in poking_init() warrants a WARN_ON() rather than a
> pr_warn()
> since the error condition is deemed "unreachable".
>
> Also take this opportunity to fix the failure check in the WARN_ON():
> cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, ...) returns a positive
> integer
> on success and a negative integer on failure.
>
> Signed-off-by: Benjamin Gray <bgray at linux.ibm.com>
Reviewed-by: Russell Currey <ruscur at russell.cc>
More information about the Linuxppc-dev
mailing list