[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ea08bd47-63cc-459f-4703-fc60c728bd02@omp.ru>
Date: Mon, 8 Nov 2021 17:48:11 +0300
From: Sergey Shtylyov <s.shtylyov@....ru>
To: Borislav Petkov <bp@...en8.de>, LKML <linux-kernel@...r.kernel.org>
CC: <linux-sh@...r.kernel.org>
Subject: Re: [PATCH v0 35/42] sh: Check notifier registration return value
On 08.11.2021 13:11, Borislav Petkov wrote:
> From: Borislav Petkov <bp@...e.de>
>
> Avoid homegrown notifier registration checks.
>
> No functional changes.
>
> Signed-off-by: Borislav Petkov <bp@...e.de>
> Cc: linux-sh@...r.kernel.org
> ---
> arch/sh/kernel/cpu/sh4a/setup-sh7724.c | 11 +++++++----
> 1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
> index 0d990ab1ba2a..8dfbb8149f66 100644
> --- a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
> +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
> @@ -1277,11 +1277,14 @@ static struct notifier_block sh7724_post_sleep_notifier = {
>
> static int __init sh7724_sleep_setup(void)
> {
> - atomic_notifier_chain_register(&sh_mobile_pre_sleep_notifier_list,
> - &sh7724_pre_sleep_notifier);
> + if (atomic_notifier_chain_register(&sh_mobile_pre_sleep_notifier_list,
> + &sh7724_pre_sleep_notifier))
> + pr_warn("SH7724 pre-sleep notifier already registered\n");
> +
> + if (atomic_notifier_chain_register(&sh_mobile_post_sleep_notifier_list,
> + &sh7724_post_sleep_notifier))
> + pr_warn("SH7724 pre-sleep notifier already registered\n");
s/pre/post/? :-)
>
> - atomic_notifier_chain_register(&sh_mobile_post_sleep_notifier_list,
> - &sh7724_post_sleep_notifier);
> return 0;
> }
> arch_initcall(sh7724_sleep_setup);
MBR, Sergey
Powered by blists - more mailing lists