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 C8F66C433EF for ; Sun, 28 Nov 2021 12:46:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352596AbhK1Mt5 convert rfc822-to-8bit (ORCPT ); Sun, 28 Nov 2021 07:49:57 -0500 Received: from aposti.net ([89.234.176.197]:46624 "EHLO aposti.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345845AbhK1Mr5 (ORCPT ); Sun, 28 Nov 2021 07:47:57 -0500 Date: Sun, 28 Nov 2021 12:44:23 +0000 From: Paul Cercueil Subject: Re: [PATCH 00/49] iio: Tree wide switch from CONFIG_PM* to __maybe_unused etc. To: Arnd Bergmann Cc: Jonathan Cameron , 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 Message-Id: In-Reply-To: References: <20211123211019.2271440-1-jic23@kernel.org> <20211124101113.000033c6@Huawei.com> <20211127180923.4cfce721@jic23-huawei> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Hi Arnd, Jonathan, Le dim., nov. 28 2021 at 10:17:55 +0100, Arnd Bergmann a écrit : > On Sat, Nov 27, 2021 at 7:09 PM Jonathan Cameron > wrote: >> On Wed, 24 Nov 2021 15:10:06 +0000 Paul Cercueil >> wrote: >> > Le mer., nov. 24 2021 at 13:23:47 +0100, Arnd Bergmann >> >> > >> > 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. > > I suggested renaming the current macros as a way to avoid having to > come up with new names. If you have an idea for a new name that makes > sense in the long run, please just go ahead with that. Yes, I totally understand that. But renaming such a widespread macro sounds like a huge undertaking... What about: #define SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \ .suspend = pm_sleep_ptr(suspend_fn), \ .resume = pm_sleep_ptr(resume_fn), \ ... #ifndef CONFIG_PM_SLEEP #define SET_SYSTEM_SLEEP_PM_OPS(a, b) SYSTEM_SLEEP_PM_OPS(a, b) #else #define SET_SYSTEM_SLEEP_PM_OPS(a, b) #endif #define DEFINE_SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn) \ static const struct dev_pm_ops name = { \ SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn), \ } SET_SYSTEM_SLEEP_PM_OPS -> SYSTEM_SLEEP_PM_OPS, with the old one now defined from the new one; SIMPLE_DEV_PM_OPS -> DEFINE_SIMPLE_DEV_PM_OPS. Thoughts? Cheers, -Paul