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=-13.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 D5408C433E0 for ; Wed, 23 Dec 2020 10:39:45 +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 1FABA207CD for ; Wed, 23 Dec 2020 10:39:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1FABA207CD Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.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 4D18pk60L3zDqWS for ; Wed, 23 Dec 2020 21:39:42 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=209.85.161.51; helo=mail-oo1-f51.google.com; envelope-from=geert.uytterhoeven@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org Received: from mail-oo1-f51.google.com (mail-oo1-f51.google.com [209.85.161.51]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4D18n270RQzDqRc for ; Wed, 23 Dec 2020 21:38:11 +1100 (AEDT) Received: by mail-oo1-f51.google.com with SMTP id k9so3601088oop.6 for ; Wed, 23 Dec 2020 02:38:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=KihTF5JbxFD42cY1wA7aOsNP35ZO1n0Na3DWL4feoYk=; b=mKTNl9VXCfUQhn+kdUcCTTL9xWgfJTul0TB26slvnpshIA0tGPi9eQTaxb6kr1sFWV 5VXNCx26X0vXFWQKkzcPWeNWknK9STrxlqroW9/gfvJsnQH0zI3hhII0mF+YBX/Bqmin fSSk2MHHnTK5CJWE8aZnEqs0jA9RFoCQVoDbk/SebV3Pln93RcAksJr6C8JMwPcmxkQ/ mvty2e6nvaxSUcoGBPtowi36M1ns0j0LJWnge5y3yX8Vml+B6OqzBKnyNfo0Egek/P8t Qor/Gg+rytJt95MdWi1/b49TdfhHsIDfzOdCvEnL3MpS+oEMulR4B92ht9+lKcLr6Fn4 aTWA== X-Gm-Message-State: AOAM533MKE3YVqxiwZKDX3I/2+8zw+T0qUtNpQAFHoRntq/6bILYyAZl ETH146rMX9v1H91RA4p5qrPYAwKnZ7YArA/iJ+Q= X-Google-Smtp-Source: ABdhPJy9U98CPLOM9qWfCFZui6dO/PQYCRjI00tgXXUEHSfVAWiteZLCs+U7EpAO2soA/tWzSTNFmBBqnM2RmfJo+z4= X-Received: by 2002:a4a:c191:: with SMTP id w17mr18070553oop.1.1608719888011; Wed, 23 Dec 2020 02:38:08 -0800 (PST) MIME-Version: 1.0 References: <20201222184510.19415-1-info@metux.net> <2f1d53e9-0dbb-78ef-22d5-ab230438ddf0@metux.net> In-Reply-To: <2f1d53e9-0dbb-78ef-22d5-ab230438ddf0@metux.net> From: Geert Uytterhoeven Date: Wed, 23 Dec 2020 11:37:56 +0100 Message-ID: Subject: Re: [PATCH] arch: consolidate pm_power_off callback To: "Enrico Weigelt, metux IT consult" Content-Type: text/plain; charset="UTF-8" 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: Rich Felker , "linux-ia64@vger.kernel.org" , Linux-sh list , "open list:BROADCOM NVRAM DRIVER" , James Bottomley , Max Filippov , Paul Mackerras , linux-csky@vger.kernel.org, "H. Peter Anvin" , linux-riscv , Will Deacon , Thomas Gleixner , Jonas Bonn , linux-s390 , Stefano Stabellini , linux-c6x-dev@linux-c6x.org, Yoshinori Sato , "open list:QUALCOMM HEXAGON..." , Helge Deller , the arch/x86 maintainers , Ley Foon Tan , Ingo Molnar , Catalin Marinas , arcml , "open list:TENSILICA XTENSA PORT \(xtensa\)" , Linux PM list , Mark Salter , Aurelien Jacquiot , linux-m68k , Openrisc , Borislav Petkov , Stafford Horne , Stefan Kristiansson , Christian Brauner , Chris Zankel , Thomas Bogendoerfer , Parisc List , linuxppc-dev , Linux Kernel Mailing List , alpha , "Enrico Weigelt, metux IT consult" Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Hi Enrico, On Tue, Dec 22, 2020 at 9:15 PM Enrico Weigelt, metux IT consult wrote: > On 22.12.20 19:54, Geert Uytterhoeven wrote: > > On Tue, Dec 22, 2020 at 7:46 PM 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. > >> > >> Signed-off-by: Enrico Weigelt, metux IT consult > > > > Thanks for your patch! > > > >> --- a/arch/alpha/kernel/process.c > >> +++ b/arch/alpha/kernel/process.c > >> @@ -43,12 +43,6 @@ > >> #include "proto.h" > >> #include "pci_impl.h" > >> > >> -/* > >> - * Power off function, if any > >> - */ > >> -void (*pm_power_off)(void) = machine_power_off; > > > > Assignments like these are lost in the conversion. > > Yes, but this doesn't seem to be ever called anyways. (in arch/alpha) > And, BTW, letting it point to machine_power_off() doesn't make much > sense, since it's the arch's machine_power_off() function, who're > calling pm_power_off(). > > Actually, we could remove pm_power_off completely from here, assuming > nobody would *build* any drivers that register themselves into > pm_power_off. > > If you feel better with it, I could post a patch that just removes > pm_power_off from arch/alpha. This is not limited to alpha, there are similar initializations on m68k, openrisc, and s390. If none of these are called, they can be removed, but you should mention that in the patch description. Thanks! 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