From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A5624C433E0 for ; Tue, 12 Jan 2021 14:13:29 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A9EA722CE3 for ; Tue, 12 Jan 2021 14:13:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A9EA722CE3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4DFXc61s40zDr2c for ; Wed, 13 Jan 2021 01:13:26 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=198.145.29.99; helo=mail.kernel.org; envelope-from=will@kernel.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=S+ljzYYL; dkim-atps=neutral Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4DFXQd579MzDrQ7 for ; Wed, 13 Jan 2021 01:05:13 +1100 (AEDT) Received: by mail.kernel.org (Postfix) with ESMTPSA id A42AE22CE3; Tue, 12 Jan 2021 14:05:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1610460310; bh=YIZSFd4ngdBu3d+V+tCrhUDlUF7epBaWbFsCZCkzGJs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=S+ljzYYL3QMPhhApX5VwhFNyceVrA27EHM0FStNvwzUR1cQ7GFOIPOcEYTO0fdDaA Kj7O7lmy0yWuWK+AZisJL2LrmlkoM/j63MxdM7S787vyvaT4LD71jTgKDStmGrzxuQ L0/NqqEzqp6wU8ndgl0gsmTuxMJL2Vz98cUyPebone1iHGoyH3HLXEv/yY8kVzE9/C 3JxXpkug6tFhHh2/KJ9Ii5coAgelm+gr542ObqppAE3GEOphOgXDNiAJFxaofg4s3u N68pjfATVrUXDVMPlwIcydiug5iK5JLd2AIK2alwIqlmLf7Si7Qy4TLd2kqk9nbCgG c2IYKYoLXP3bw== Date: Tue, 12 Jan 2021 14:05:00 +0000 From: Will Deacon To: "Enrico Weigelt, metux IT consult" Subject: Re: [PATCH v2] arch: consolidate pm_power_off callback Message-ID: <20210112140459.GC9277@willie-the-truck> References: <20201227140129.19932-1-info@metux.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201227140129.19932-1-info@metux.net> User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dalias@libc.org, linux-ia64@vger.kernel.org, linux-sh@vger.kernel.org, linux-mips@vger.kernel.org, James.Bottomley@HansenPartnership.com, jcmvbkbc@gmail.com, paulus@samba.org, linux-csky@vger.kernel.org, hpa@zytor.com, linux-riscv@lists.infradead.org, tglx@linutronix.de, jonas@southpole.se, linux-s390@vger.kernel.org, sstabellini@kernel.org, linux-c6x-dev@linux-c6x.org, ysato@users.sourceforge.jp, linux-hexagon@vger.kernel.org, deller@gmx.de, x86@kernel.org, ley.foon.tan@intel.com, mingo@redhat.com, geert@linux-m68k.org, catalin.marinas@arm.com, linux-snps-arc@lists.infradead.org, linux-xtensa@linux-xtensa.org, linux-pm@vger.kernel.org, msalter@redhat.com, jacquiot.aurelien@gmail.com, linux-m68k@lists.linux-m68k.org, openrisc@lists.librecores.org, bp@alien8.de, shorne@gmail.com, stefan.kristiansson@saunalahti.fi, christian@brauner.io, chris@zankel.net, tsbogend@alpha.franken.de, linux-parisc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Sun, Dec 27, 2020 at 03:01:28PM +0100, Enrico Weigelt, metux IT consult wrote: > Move the pm_power_off callback into one global place and also add an > function for conditionally calling it (when not NULL), in order to remove > code duplication in all individual archs. > > Reported-by: kernel test robot > Signed-off-by: Enrico Weigelt, metux IT consult [...] > diff --git a/kernel/reboot.c b/kernel/reboot.c > index eb1b15850761..ec4cd66dd1ae 100644 > --- a/kernel/reboot.c > +++ b/kernel/reboot.c > @@ -53,6 +53,16 @@ int reboot_force; > void (*pm_power_off_prepare)(void); > EXPORT_SYMBOL_GPL(pm_power_off_prepare); > > +void (*pm_power_off)(void); > +EXPORT_SYMBOL_GPL(pm_power_off); > + > +void do_power_off(void) > +{ > + if (pm_power_off) > + pm_power_off(); > +} > +EXPORT_SYMBOL_GPL(do_power_off); Could this just live as a static inline in pm.h to avoid having to export the extra symbol? Will