Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp6365038pxb; Mon, 8 Nov 2021 07:27:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJxnii0ncSk68z8CcKZV/5jexu3T/fhhR2kh0oDfQGljlG+jG3vA4AXFGj53xos2LM2RPqqo X-Received: by 2002:a05:6602:2b90:: with SMTP id r16mr30516iov.66.1636385252339; Mon, 08 Nov 2021 07:27:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636385252; cv=none; d=google.com; s=arc-20160816; b=V5xOhgQA98ooThcZVbNCELv80im8WtBrggCFXPrBE1tKkK9a2a1egY9yi7qA5sWhdf ZfJs9y1VA0zQm4DKYRkkKkcdiAO2SxAbBPhVJNvy8I9lIPVDGVVfyDqflek1cBBMFXIt P3ZyNwetHGV6HK/rQQc8BQQwDBWQzQE4xCyKGIYEPcSL5fc/CBxzSHln//ehH3GzI9yu OYHJIXgwUPKay3eR5EYjVBf5GZCoL19AEeKv2vZsipJ5EtgVukBrGTlwl7UB/ZeWk1Ft SjCciFzSNkcsJqhrReJvqYjloC87YAKQk4fxjDbRMgvXgi+PMr5gEgGM26FCLCzFbvvI ThWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=6udaEpyG8h+J9wXmKHEY7Likmk6gPzBuHNHMnjS5i9I=; b=UxfpkDFUUsvgoxM/5kWACKdXfJ9dxUND2C2ysdkKB5c6IyuvKFUdXA41kImyuRSnFp ju21LIr+52QoYj0tCndMh8zF/ll/HqE61slGkDL/R5OHL49ZWNpCh/oiHXa0ZbqH3HWG 534VIsYM+2Ah+/AubXN22k6bN/JfUpKWpy+buo/yYUCI75VJP9rpiPqe/E5MRix1ar/v X9XHY7wAaqA3f3JtnBMsPqdr7y6d1S0PDPU/nWSGO4bty1rb4awoRNnH4adgbsdbA2lu obfCrIQSjC5wK08K+1BCoMju0X8POWXUrBbcPW3nHNjHrjZsNB/5EDNgiv9mAbXRIERu tXQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=G70gieGb; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b68si24040564jab.118.2021.11.08.07.27.17; Mon, 08 Nov 2021 07:27:32 -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; dkim=pass header.i=@alien8.de header.s=dkim header.b=G70gieGb; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238880AbhKHKRo (ORCPT + 99 others); Mon, 8 Nov 2021 05:17:44 -0500 Received: from mail.skyhub.de ([5.9.137.197]:38518 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237913AbhKHKPV (ORCPT ); Mon, 8 Nov 2021 05:15:21 -0500 Received: from zn.tnic (p200300ec2f33110088892b77bd117736.dip0.t-ipconnect.de [IPv6:2003:ec:2f33:1100:8889:2b77:bd11:7736]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id DA9DC1EC0523; Mon, 8 Nov 2021 11:12:35 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1636366356; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6udaEpyG8h+J9wXmKHEY7Likmk6gPzBuHNHMnjS5i9I=; b=G70gieGbrDi80a4ea+alShmWaZEh/CzfR9/ZMcmuuUX2GmpeyZsCEhKNpUW9ELcwZBC6Tf tPumkuqo9DxF2gxOQi3DakERJnbJCkSh87UubytVLuva0Eoyp3J+taG4aMAzuYA98iqCmS +lGzt7IMi0DoDp1t+FC4ceXTSuaUywo= From: Borislav Petkov To: LKML Cc: linux-sh@vger.kernel.org Subject: [PATCH v0 35/42] sh: Check notifier registration return value Date: Mon, 8 Nov 2021 11:11:50 +0100 Message-Id: <20211108101157.15189-36-bp@alien8.de> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20211108101157.15189-1-bp@alien8.de> References: <20211108101157.15189-1-bp@alien8.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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"); - atomic_notifier_chain_register(&sh_mobile_post_sleep_notifier_list, - &sh7724_post_sleep_notifier); return 0; } arch_initcall(sh7724_sleep_setup); -- 2.29.2