Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp235394pxb; Mon, 8 Nov 2021 12:45:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJwxdQGntbcdY2FDnWGChbi0YDUd/7gZ1Hwl/5N0EG7Eknndc/WmvUfv7226xxhc2NBfwQ5N X-Received: by 2002:a50:e041:: with SMTP id g1mr2653869edl.4.1636404350419; Mon, 08 Nov 2021 12:45:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636404350; cv=none; d=google.com; s=arc-20160816; b=dE/U6uttw9RltFplmfTD9JRxK4eTMiwdd0GOkP+qepsRfkts4PbQ6X/LSxstMQUygT euAYxNmgpDg6fcLBYR5/0h9YmeUU3U7tD5mJ9PjHPmEVe/XBd8y8I4WhXfExrSNNJ/Pi 3XmrWnd4+5RFXoSl6MUqCdKdF/9cLdDmA9LFq+EhoUhMV/aPIJoT0N5PaZsZ7o1xd1LL um49cv2vpNQ5aG9QrQIwsiwRKNGS0sSYdiJZXwZk7KFcQ5I5koWbCpcniHZ4mCpDBZ2s qCnHtBtvHmaaLIX62dhRebyC1uY/qXC4wq+V9R4zZ1kHWX580z5xHtjwuc3yUoXEMa5z IREg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-filter; bh=ZuoPepjzQlKuzPcv/Wy5NZ3xeRGjhPfoLOnz8Itdbfg=; b=eGUnTmow1BEGK3cJ5aejQBXXI94x5BYhOw+wRDKKCJZgqZ2yodCTdshqg6OjO0FK9i 1ksyaxKH93izOJ6OHnkUu55OnI9GVry/9z8xoHvIhpo0V68Z2WcLNSsLV7ERZDtZqDYV VEGpEL9tlpTLQivnU8z90GwNNulRUc5sLOYxtuyK2/6lzunXYo3uUmRo7rbQn7UpTuG6 CfxISwOWNFjR/7jb2Ayr9BrQ+7Nl5D9TzIWNhq2lCKnybrzujRWaN0FlCSxNi7CuqfDo o46kSZyICPpN2QCq5hj+CTPlIrr8v8B0MK+k7Us7pOMRHjpBLOQrERZDekyZvJzFqUtc Yh3w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m5si35909619edc.80.2021.11.08.12.45.24; Mon, 08 Nov 2021 12:45:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240593AbhKHOvM (ORCPT + 99 others); Mon, 8 Nov 2021 09:51:12 -0500 Received: from mxout01.lancloud.ru ([45.84.86.81]:37842 "EHLO mxout01.lancloud.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237063AbhKHOvK (ORCPT ); Mon, 8 Nov 2021 09:51:10 -0500 Received: from LanCloud DKIM-Filter: OpenDKIM Filter v2.11.0 mxout01.lancloud.ru 9841620E927D Received: from LanCloud Received: from LanCloud Received: from LanCloud Message-ID: Date: Mon, 8 Nov 2021 17:48:11 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Subject: Re: [PATCH v0 35/42] sh: Check notifier registration return value Content-Language: en-US To: Borislav Petkov , LKML CC: References: <20211108101157.15189-1-bp@alien8.de> <20211108101157.15189-36-bp@alien8.de> From: Sergey Shtylyov Organization: Open Mobile Platform In-Reply-To: <20211108101157.15189-36-bp@alien8.de> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [192.168.11.198] X-ClientProxiedBy: LFEXT02.lancloud.ru (fd00:f066::142) To LFEX1907.lancloud.ru (fd00:f066::207) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08.11.2021 13:11, Borislav Petkov wrote: > From: Borislav Petkov > > Avoid homegrown notifier registration checks. > > No functional changes. > > Signed-off-by: Borislav Petkov > Cc: linux-sh@vger.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