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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A0B67C433F5 for ; Sat, 27 Nov 2021 18:07:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355893AbhK0SKX convert rfc822-to-8bit (ORCPT ); Sat, 27 Nov 2021 13:10:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355943AbhK0SIX (ORCPT ); Sat, 27 Nov 2021 13:08:23 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 308BCC061757 for ; Sat, 27 Nov 2021 10:04:32 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 767D1B80919 for ; Sat, 27 Nov 2021 18:04:30 +0000 (UTC) Received: from jic23-huawei (cpc108967-cmbg20-2-0-cust86.5-4.cable.virginm.net [81.101.6.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.kernel.org (Postfix) with ESMTPSA id BEBB3C53FAD; Sat, 27 Nov 2021 18:04:22 +0000 (UTC) Date: Sat, 27 Nov 2021 18:09:23 +0000 From: Jonathan Cameron To: Paul Cercueil Cc: Arnd Bergmann , Jonathan Cameron , linux-iio@vger.kernel.org, Lars-Peter Clausen , Alexandre Belloni , Anson Huang , Brian Masney , Fabrice Gasnier , Hans de Goede , Heiko Stuebner , Icenowy Zheng , Jonathan Albrieux , Krzysztof Kozlowski , Linus Walleij , Luca Weiss , Ludovic Desroches , Manivannan Sadhasivam , Martijn Braam , Maslov Dmitry , Olivier Moysan , Stefan-Gabriel Mirea , Vaishnav M A Subject: Re: [PATCH 00/49] iio: Tree wide switch from CONFIG_PM* to __maybe_unused etc. Message-ID: <20211127180923.4cfce721@jic23-huawei> In-Reply-To: References: <20211123211019.2271440-1-jic23@kernel.org> <20211124101113.000033c6@Huawei.com> X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org On Wed, 24 Nov 2021 15:10:06 +0000 Paul Cercueil wrote: > Le mer., nov. 24 2021 at 13:23:47 +0100, Arnd Bergmann > a écrit : > > On Wed, Nov 24, 2021 at 11:11 AM Jonathan Cameron > > wrote: > >> On Wed, 24 Nov 2021 08:29:40 +0100 Arnd Bergmann > >> wrote: > >> > > >> > > The problem then is that the SET_*_PM_OPS macros are defined > >> > > differently according to CONFIG_PM, so their definition would > >> need to > >> > > be changed to use the (redefined) pm_ptr() macro and a > >> corresponding > >> > > pm_sleep_ptr() macro. Unfortunately since the SET_*_PM_OPS > >> macros are > >> > > used everywhere with code wrapped around #ifdef CONFIG_PM > >> guards, it > >> > > wouldn't be easy to change them, and it would just be easier to > >> > > introduce new macros. > >> > > >> > Right, this is what we've discussed multiple times, and I think > >> everyone > >> > agreed we should do this, but so far we could not come up with a > >> name > >> > for the new macro, and changing the macro in place is not > >> practical unless > >> > we change hundreds of drivers in the same way as the iio series > >> first. > >> > >> Nasty indeed and I'm not sure how scriptable either as lots of > >> subtle variants > >> unfortunately. > > > > The minor variants (late, noirq) are actually the easy part, for the > > macros that > > have fewer users, we can just have one patch per macro that changes > > it treewide. > > For SET_SYSTEM_SLEEP_PM_OPS/SET_RUNTIME_PM_OPS and their > > DEV_PM_OPS variants, this would be a lot harder: > > > > $ for i in SET_SYSTEM_SLEEP_PM_OPS SET_LATE_SYSTEM_SLEEP_PM_OPS > > SET_NOIRQ_SYSTEM_SLEEP_PM_OPS SET_RUNTIME_PM_OPS SIMPLE_DEV_PM_OPS > > UNIVERSAL_DEV_PM_OPS ; do echo `git grep -wl $i | wc -l` $i ; done > > > > 459 SET_SYSTEM_SLEEP_PM_OPS > > 51 SET_LATE_SYSTEM_SLEEP_PM_OPS > > 59 SET_NOIRQ_SYSTEM_SLEEP_PM_OPS > > 497 SET_RUNTIME_PM_OPS > > 797 SIMPLE_DEV_PM_OPS > > 20 UNIVERSAL_DEV_PM_OPS > > > > About half of those actually use an #ifdef, while the other half does > > not: > > > > $ git grep -wl > > 'SET_SYSTEM_SLEEP_PM_OPS\|SET_RUNTIME_PM_OPS\|SIMPLE_DEV_PM_OPS\|UNIVERSAL_DEV_PM_OPS' > > | xargs grep -l CONFIG_PM | wc -l > > 712 > > $ git grep -wl > > 'SET_SYSTEM_SLEEP_PM_OPS\|SET_RUNTIME_PM_OPS\|SIMPLE_DEV_PM_OPS\|UNIVERSAL_DEV_PM_OPS' > > | xargs grep -L CONFIG_PM | wc -l > > 745 > > > > If we rename the macros in the first half of this using a script, > > then we should > > be able to change the behavior of the normal macros to use the new > > pm_ptr(). > > So you want to rename the current macros (to e.g. *_PM_OPS_LEGACY) > everywhere so that new ones can be defined? > > What about we introduce new macros, and just deprecate the old ones > (with e.g. a checkpatch warning)? That would be way less work. Sounds like a sensible approach to me. If Arnd is happy with that we can move forwards and get the bikshedding on the naming started. As ever the true discussion won't start before there is a patch. I'm happy to hold this series for a bit on the basis it'll be simpler without all those __maybe_unused additions, but I don't want to be sitting on it for multiple cycles if it turns out this will take a while to move forwards. Thanks, Jonathan > > -Paul > >