Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp132460pxb; Mon, 8 Nov 2021 10:58:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJy0JWddYm0c9TFAdjdRZ403pZr4gWvXUNCNT6gRNKZspn4G81iDXCgcDWrW6atyeU/CYLra X-Received: by 2002:a17:906:c9cb:: with SMTP id hk11mr1790019ejb.204.1636397917185; Mon, 08 Nov 2021 10:58:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636397917; cv=none; d=google.com; s=arc-20160816; b=YRLKtgb4Bx8MGWK7dL+nrmBGVcFoTQhww34mkJSqy6vRxqPu687B7PpEOMboriEyPB ljc7xOXVK2eOWdlLx3itHsZ57zsYNaS0PClaFegPKGWBNZywSJJZwTf55i/tBAOAGQzj TgflIZ1yC3rWfkGKu34E7Lcc7pHLBQ0yibjhMKM/Gg6XSTx+4wLHM56UUKaaa1Nddcmj hVe/USFuQYRKcq2ejP0h8ntA9n7GbH5BzOMqfltCYbR3JVx9UGDDSDbMWYv4C2fpofrE Rp9M7hrliCWBAEg/ClSONMaMIfVS976ZFzhiXw8a/sFOq6/0XvQ+x17oDaN3HIj3cL0U 88Iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=917ou4i0m8XwTRLtSzLNb+jh838cky8jWcxVoB+CqOM=; b=RPs/PQWim4FRxRRJsnDiL9jDtdyvRR1g0cacBYAj51l6QmyXFipJqprBG2eJAldXLk toXMEFqcpi0Gf8l28xm1Btl0/ntGG1yoC8tacqpuDaPy0V+fx3dbNDdVYJ3wQxstJelc 2gN0H3x1YzwA+oFn9kaUsYqcARwY4wXzNegHLgyaGpNNgcQLFqjYlwk/1fn5GMkcSSKs XQeOhY64Ihhtbbl/soKG1xGHS6cLTK/5/iN+s+323X3MJZuAzrqHCd9iAjC1zDwqw5b1 iIL2OOqf3JkFLRIqdr5LRW/3541p+vvPuJxmmVZ6mRCGOIBmTon9mNnEn9WGwmqj1K5c yzlQ== 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 jg27si31944854ejc.473.2021.11.08.10.58.11; Mon, 08 Nov 2021 10:58:37 -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 S238518AbhKHNej (ORCPT + 99 others); Mon, 8 Nov 2021 08:34:39 -0500 Received: from mail-ua1-f51.google.com ([209.85.222.51]:42832 "EHLO mail-ua1-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235098AbhKHNei (ORCPT ); Mon, 8 Nov 2021 08:34:38 -0500 Received: by mail-ua1-f51.google.com with SMTP id t13so16130248uad.9; Mon, 08 Nov 2021 05:31:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=917ou4i0m8XwTRLtSzLNb+jh838cky8jWcxVoB+CqOM=; b=Pw3i+weyc7+jUFjiqgja4nmIGiQYkp+hTDI9tUVPtfM/z0qZ/4yhUYz846TFW/iUJE 8aZiIZxOJIJtcYDjBO0eZw31R4ld/ywvH5oMBRjH8uCeCTGw3OIYAu0TUmEvL6ueUne/ 1HnChVid6if+SoM/P5I3r6J8pUDJWBSnVKgaEaJiHHeVunGHmT7XqkpyWVFVRUqup7eq /e8uYLF186k+tLqbbRBuWImk5nNh91VBdX1tOA/TDh1l8a3+yBJBR/VZfxG0HOV2YmLi CUKZC9kmBWQP4XrfpDcHA4DirB+LRlijSkYt4jGKbYlX9gm8pPWYVqmwv7U5uBDD/314 XFTg== X-Gm-Message-State: AOAM532clrUNDaatOchmCe/ok3705337hD8ueOonSizazkXGJ/I7V0Af 9ehEs0k4btdHQNvPPOA8Nl/0LxreMt2R3g== X-Received: by 2002:a67:5f47:: with SMTP id t68mr33706564vsb.56.1636378313578; Mon, 08 Nov 2021 05:31:53 -0800 (PST) Received: from mail-ua1-f44.google.com (mail-ua1-f44.google.com. [209.85.222.44]) by smtp.gmail.com with ESMTPSA id q9sm1026020vkn.44.2021.11.08.05.31.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 08 Nov 2021 05:31:53 -0800 (PST) Received: by mail-ua1-f44.google.com with SMTP id l43so31453031uad.4; Mon, 08 Nov 2021 05:31:53 -0800 (PST) X-Received: by 2002:a67:c38f:: with SMTP id s15mr40867953vsj.50.1636378313058; Mon, 08 Nov 2021 05:31:53 -0800 (PST) MIME-Version: 1.0 References: <20211108101157.15189-1-bp@alien8.de> <20211108101157.15189-36-bp@alien8.de> In-Reply-To: <20211108101157.15189-36-bp@alien8.de> From: Geert Uytterhoeven Date: Mon, 8 Nov 2021 14:31:41 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v0 35/42] sh: Check notifier registration return value To: Borislav Petkov Cc: LKML , Linux-sh list Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Borislav, On Mon, Nov 8, 2021 at 1:50 PM Borislav Petkov wrote: > From: Borislav Petkov > > Avoid homegrown notifier registration checks. > > No functional changes. > > Signed-off-by: Borislav Petkov Thanks for your patch! > --- 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"); Do you think these can actually fail? > > - atomic_notifier_chain_register(&sh_mobile_post_sleep_notifier_list, > - &sh7724_post_sleep_notifier); > return 0; > } > arch_initcall(sh7724_sleep_setup); Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds