Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp6233553iob; Tue, 10 May 2022 13:31:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGfXL1GqTinnpi0IGb7V9coKdw6VL7Yxe8zCMCVlKmGX3o1H3K7eAapLrVXQxuFES4P/ki X-Received: by 2002:a17:907:a042:b0:6f3:b4fc:be3d with SMTP id gz2-20020a170907a04200b006f3b4fcbe3dmr20901654ejc.318.1652214683096; Tue, 10 May 2022 13:31:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652214683; cv=none; d=google.com; s=arc-20160816; b=ro7n0MX4TXv3bXt2AmZB1nkuz+d812AY8MAPscHsPRrSx/5N4e8r2lhMpowaNzAt2z 0XEwF2nVBkACsE6kEVah6Bvv2tVIQdHKdq+AbKttx0G21vRXG8Qp3X+rM/Z6YVJe26pt EPEszALD0kdSug9R3+RjgdwVRaC5IXBpaoylQOUdOWklosDeLy5LjWp28zHZ1wYeNjkq oyb/KRzuXqmkcLFM1YHZuh7qTB5qUQM+7CfiOKADud3+tQK9/rBQ4xM1msHUStkXobFx uFFJPRETPSM+iAgsK+9Zt2giAVR2lq74k1j8jyUFWaBNAf/PJDA7dIPtjCQtKK9L35oq h2vQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=e4wukkdgHyYEEL082h2+8MXPywOa6STdjbSVdRIKUGE=; b=BlaQJ2XBh21dCZu8wmnR11y6HZBiLoF0ljIkq/1qZCaQFLC6kDGU92o6N8Cyvdrq9+ O5cpMn4zfNg0n4Q0WgQwRyi9lC5AmPlBmciC2P4F/HFb29UoA0lfwX7HCDOKLtfejPiH 9RKE9w8YrjRPaNspQJQi377BWxlPeC1BTSGG1sG2AQCe35g739BqMezbWuGyQ/KWipPY BzY12IYs1G9I9z0v4h3CtLsWxDwlBQUo1IOLHznVOWSPdWdgp7GuKcoGnNuCW0KVt/hz Y+A0N4lbjGUMwrJlACgCWtUwSPLkonfM/Xw2X/QGLAo3hcyHFdrMWKMnvAaVc2ms3GFg 068g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="rR4mS/+o"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dp2-20020a170906c14200b006e858ba51f7si308215ejc.558.2022.05.10.13.30.58; Tue, 10 May 2022 13:31:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="rR4mS/+o"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345565AbiEJPen (ORCPT + 99 others); Tue, 10 May 2022 11:34:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345657AbiEJPeW (ORCPT ); Tue, 10 May 2022 11:34:22 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E31CF3B009; Tue, 10 May 2022 08:28:44 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id BDCE21F8C1; Tue, 10 May 2022 15:28:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1652196522; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=e4wukkdgHyYEEL082h2+8MXPywOa6STdjbSVdRIKUGE=; b=rR4mS/+oT4jH07pNjBmARAg7zdRtaoeIif/UACNxEBTH30BjG7Bppc3qvkDfJRoCh4TawW 6luoRejPAMFZr+z9Kvz9iubCA5AxZw1bIiLsMXPqeMDKaF9ra8TkGI7FOIFKW72kOoldt+ xkdV40YW6dtF4zTHXKWuKX4kUttIYC0= Received: from suse.cz (unknown [10.100.208.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 913582C141; Tue, 10 May 2022 15:28:41 +0000 (UTC) Date: Tue, 10 May 2022 17:28:40 +0200 From: Petr Mladek To: "Guilherme G. Piccoli" Cc: akpm@linux-foundation.org, bhe@redhat.com, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, coresight@lists.linaro.org, linuxppc-dev@lists.ozlabs.org, linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-edac@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-leds@vger.kernel.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linux-pm@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-s390@vger.kernel.org, linux-tegra@vger.kernel.org, linux-um@lists.infradead.org, linux-xtensa@linux-xtensa.org, netdev@vger.kernel.org, openipmi-developer@lists.sourceforge.net, rcu@vger.kernel.org, sparclinux@vger.kernel.org, xen-devel@lists.xenproject.org, x86@kernel.org, kernel-dev@igalia.com, kernel@gpiccoli.net, halves@canonical.com, fabiomirmar@gmail.com, alejandro.j.jimenez@oracle.com, andriy.shevchenko@linux.intel.com, arnd@arndb.de, bp@alien8.de, corbet@lwn.net, d.hatayama@jp.fujitsu.com, dave.hansen@linux.intel.com, dyoung@redhat.com, feng.tang@intel.com, gregkh@linuxfoundation.org, mikelley@microsoft.com, hidehiro.kawai.ez@hitachi.com, jgross@suse.com, john.ogness@linutronix.de, keescook@chromium.org, luto@kernel.org, mhiramat@kernel.org, mingo@redhat.com, paulmck@kernel.org, peterz@infradead.org, rostedt@goodmis.org, senozhatsky@chromium.org, stern@rowland.harvard.edu, tglx@linutronix.de, vgoyal@redhat.com, vkuznets@redhat.com, will@kernel.org, Brian Norris , Florian Fainelli Subject: Re: [PATCH 15/30] bus: brcmstb_gisb: Clean-up panic/die notifiers Message-ID: References: <20220427224924.592546-1-gpiccoli@igalia.com> <20220427224924.592546-16-gpiccoli@igalia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220427224924.592546-16-gpiccoli@igalia.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 2022-04-27 19:49:09, Guilherme G. Piccoli wrote: > This patch improves the panic/die notifiers in this driver by > making use of a passed "id" instead of comparing pointer > address; also, it removes an useless prototype declaration > and unnecessary header inclusion. > > This is part of a panic notifiers refactor - this notifier in > the future will be moved to a new list, that encompass the > information notifiers only. > > --- a/drivers/bus/brcmstb_gisb.c > +++ b/drivers/bus/brcmstb_gisb.c > @@ -347,25 +346,14 @@ static irqreturn_t brcmstb_gisb_bp_handler(int irq, void *dev_id) > /* > * Dump out gisb errors on die or panic. > */ > -static int dump_gisb_error(struct notifier_block *self, unsigned long v, > - void *p); > - > -static struct notifier_block gisb_die_notifier = { > - .notifier_call = dump_gisb_error, > -}; > - > -static struct notifier_block gisb_panic_notifier = { > - .notifier_call = dump_gisb_error, > -}; > - > static int dump_gisb_error(struct notifier_block *self, unsigned long v, > void *p) > { > struct brcmstb_gisb_arb_device *gdev; > - const char *reason = "panic"; > + const char *reason = "die"; > > - if (self == &gisb_die_notifier) > - reason = "die"; > + if (v == PANIC_NOTIFIER) > + reason = "panic"; IMHO, the check of the @self parameter was the proper solution. "gisb_die_notifier" list uses @val from enum die_val. "gisb_panic_notifier" list uses @val from enum panic_notifier_val. These are unrelated types. It might easily break when someone defines the same constant also in enum die_val. Best Regards, Petr