Message ID | 20231211190321.307330-4-andriy.shevchenko@linux.intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp7274131vqy; Mon, 11 Dec 2023 11:03:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IHhXDG60bCRYnV9QMsYIeKjohv9u/A2VC3aVbqmX//lxt5hSImYDwCGVHwHv/PRMsDj3CBk X-Received: by 2002:a17:902:ea0b:b0:1d0:8e08:35be with SMTP id s11-20020a170902ea0b00b001d08e0835bemr4486941plg.7.1702321429824; Mon, 11 Dec 2023 11:03:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702321429; cv=none; d=google.com; s=arc-20160816; b=DD59blKU8FxLcef0j8Ld8PbvY8cVq8R85tAbT6E5wQrE/YBuzykPYnc70pzm3TJs4y EKnY11TQdQvJ9ZhOepB3KeUjQRqnqFrKukqiqK7S1Sh+I+d021g7xFt2uL2aX/uUHRGp XmJ27o6zRRCiCm6qUsy7tBl4V1wkDKnsTf5aZf3zSTnL7p1Y2uKrXqJjtJWWhzIEQMiD lYmJRDjWDBrfWEPMcuKdTibjHmm2Y3v7ns74YRpDkjRsOG6zVUXD6rtyPLMAP81dqUD8 JE2/KHKZcmtE27C4ui04RTeL1UfVX6aWAg9Ba5x/H+FPDLqkkDRaAcgK/3iTnT4tpCNn 8L3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=/F4KkxxcZDASZbFDAtLzUHPjVyFHpZY6rdS9xgN+DqI=; fh=uj0Z2SyYowlbgQPZGFjUvktLAqf7tvIwEfCWEzCNe+c=; b=0vMNteUGeDcLzxdGMOfEZXrZ2Ncuba38v2vp4EjlZfRWudDU9WULsqk2AZcRWHMpYJ pa72TnOt13evfxG1NXb9piE0E9kIGjVfXpTaOCUmJTvUNrbJi6dFpD6zvyIJfRSXbLFm //uNaWYyjk4Apg7I8MPK8ATJF6otio/+JiqLm4+mOuX36gGpirRDej598K1rzG7pHCi5 0lF55iLt5SP/fTMgAXFOdd4M01627kqzvgM8UIiYfB8qQooMZa9hRpJc7h8FEND+iP7i 7n5SseaxXK0MAVG8S3rtojlnouKHji4ZS6z6BxXoiSbUnq8vaKaEjnxnov4x9JnIFW9S HHuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=VN0VLnBk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id a2-20020a170902ee8200b001d2edc630e4si5829752pld.147.2023.12.11.11.03.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 11:03:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=VN0VLnBk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 4CD3680BEDEE; Mon, 11 Dec 2023 11:03:45 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344375AbjLKTDd (ORCPT <rfc822;dexuan.linux@gmail.com> + 99 others); Mon, 11 Dec 2023 14:03:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229539AbjLKTD1 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 11 Dec 2023 14:03:27 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C13CCF; Mon, 11 Dec 2023 11:03:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702321414; x=1733857414; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ACcmTJgIefDIVYbDCBBfrcMa7Src+AAIG2eWNqY+244=; b=VN0VLnBkLVZd56vDxcQq35CzDxiJWdp4aU8EM06q3n+QIa3nbovwOyFd xfrrOjl+7dlXsQa0K/HmqksZWPqB3j0a1ozVC464hqDOgTkwYpgJb4rmK 3ZGpMsrleOAP0Q0NmLAT96A2dkFnLaX9QtmmKa88yW4SOhS14DGkGcmCn cZXGcCuC14nDlD45+1lIX/BqsIcDxjWZSMEUr8TxfV/lIH6RbjOXbYr9N JSgVfHBoCLJEaj2bELxuYAgLCKAUWT51oWLxiVKMGyUctLnqkzOWVEYl+ V1FZKG9aE3HJCksGUlilIKPM569wrDvCRcukAFe1t4DV67Q6vnG1kIDBD Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10921"; a="379692511" X-IronPort-AV: E=Sophos;i="6.04,268,1695711600"; d="scan'208";a="379692511" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Dec 2023 11:03:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10921"; a="946445054" X-IronPort-AV: E=Sophos;i="6.04,268,1695711600"; d="scan'208";a="946445054" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga005.jf.intel.com with ESMTP; 11 Dec 2023 11:03:24 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 7601E3AE; Mon, 11 Dec 2023 21:03:23 +0200 (EET) From: Andy Shevchenko <andriy.shevchenko@linux.intel.com> To: Linus Walleij <linus.walleij@linaro.org>, Bartosz Golaszewski <bartosz.golaszewski@linaro.org>, Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Geert Uytterhoeven <geert+renesas@glider.be>, Rasmus Villemoes <linux@rasmusvillemoes.dk>, Biju Das <biju.das.jz@bp.renesas.com>, Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>, Jianlong Huang <jianlong.huang@starfivetech.com>, linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-mips@vger.kernel.org, linux-renesas-soc@vger.kernel.org Cc: Ray Jui <rjui@broadcom.com>, Scott Branden <sbranden@broadcom.com>, Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, Dong Aisheng <aisheng.dong@nxp.com>, Fabio Estevam <festevam@gmail.com>, Shawn Guo <shawnguo@kernel.org>, Jacky Bai <ping.bai@nxp.com>, Pengutronix Kernel Team <kernel@pengutronix.de>, Sascha Hauer <s.hauer@pengutronix.de>, NXP Linux Team <linux-imx@nxp.com>, Sean Wang <sean.wang@kernel.org>, Paul Cercueil <paul@crapouillou.net>, Lakshmi Sowjanya D <lakshmi.sowjanya.d@intel.com>, Emil Renner Berthing <kernel@esmil.dk>, Hal Feng <hal.feng@starfivetech.com> Subject: [PATCH v5 03/13] pinctrl: ingenic: Use C99 initializers in PINCTRL_PIN_GROUP() Date: Mon, 11 Dec 2023 20:57:56 +0200 Message-ID: <20231211190321.307330-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20231211190321.307330-1-andriy.shevchenko@linux.intel.com> References: <20231211190321.307330-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 11 Dec 2023 11:03:45 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785013395541003078 X-GMAIL-MSGID: 1785013395541003078 |
Series |
pinctrl: Convert struct group_desc to use struct pingroup
|
|
Commit Message
Andy Shevchenko
Dec. 11, 2023, 6:57 p.m. UTC
For the better flexibility use C99 initializers in PINCTRL_PIN_GROUP().
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/pinctrl/pinctrl-ingenic.c | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
Comments
Hi Andy, Le lundi 11 décembre 2023 à 20:57 +0200, Andy Shevchenko a écrit : > For the better flexibility use C99 initializers in > PINCTRL_PIN_GROUP(). > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > --- > drivers/pinctrl/pinctrl-ingenic.c | 21 +++++++++++++-------- > 1 file changed, 13 insertions(+), 8 deletions(-) > > diff --git a/drivers/pinctrl/pinctrl-ingenic.c > b/drivers/pinctrl/pinctrl-ingenic.c > index ee718f6e2556..f5661dcdedf5 100644 > --- a/drivers/pinctrl/pinctrl-ingenic.c > +++ b/drivers/pinctrl/pinctrl-ingenic.c > @@ -82,16 +82,21 @@ > #define PINS_PER_GPIO_CHIP 32 > #define JZ4730_PINS_PER_PAIRED_REG 16 > > -#define INGENIC_PIN_GROUP_FUNCS(name, id, funcs) \ > - { \ > - name, \ > - id##_pins, \ > - ARRAY_SIZE(id##_pins), \ > - funcs, \ > +#define INGENIC_PIN_GROUP_FUNCS(_name_, id, > funcs) \ > + { > \ > + .name = > _name_, \ > + .pins = > id##_pins, \ > + .num_pins = > ARRAY_SIZE(id##_pins), \ > + .data = > funcs, \ > } > > -#define INGENIC_PIN_GROUP(name, id, func) \ > - INGENIC_PIN_GROUP_FUNCS(name, id, (void *)(func)) > +#define INGENIC_PIN_GROUP(_name_, id, > func) \ > + { > \ > + .name = > _name_, \ > + .pins = > id##_pins, \ > + .num_pins = > ARRAY_SIZE(id##_pins), \ > + .data = (void > *)func, \ > + } This INGENIC_PIN_GROUP() macro doesn't need to be modified, does it? Cheers, -Paul > > enum jz_version { > ID_JZ4730,
On Wed, Dec 13, 2023 at 10:55:46AM +0100, Paul Cercueil wrote: > Le lundi 11 décembre 2023 à 20:57 +0200, Andy Shevchenko a écrit : ... > > -#define INGENIC_PIN_GROUP(name, id, func) \ > > - INGENIC_PIN_GROUP_FUNCS(name, id, (void *)(func)) > > +#define INGENIC_PIN_GROUP(_name_, id, > > func) \ > > + { > > \ > > + .name = > > _name_, \ > > + .pins = > > id##_pins, \ > > + .num_pins = > > ARRAY_SIZE(id##_pins), \ > > + .data = (void > > *)func, \ > > + } > > This INGENIC_PIN_GROUP() macro doesn't need to be modified, does it? We can go either way. I prefer to go this way as it reduces level of indirections in the macros. It makes code easier to read and understand. But if you insist, I can drop that change in next version.
Hi Andy, Le mercredi 13 décembre 2023 à 15:21 +0200, Andy Shevchenko a écrit : > On Wed, Dec 13, 2023 at 10:55:46AM +0100, Paul Cercueil wrote: > > Le lundi 11 décembre 2023 à 20:57 +0200, Andy Shevchenko a écrit : > > ... > > > > -#define INGENIC_PIN_GROUP(name, id, func) \ > > > - INGENIC_PIN_GROUP_FUNCS(name, id, (void *)(func)) > > > +#define INGENIC_PIN_GROUP(_name_, id, > > > func) \ > > > + { > > > \ > > > + .name = > > > _name_, \ > > > + .pins = > > > id##_pins, \ > > > + .num_pins = > > > ARRAY_SIZE(id##_pins), \ > > > + .data = (void > > > *)func, \ > > > + } > > > > This INGENIC_PIN_GROUP() macro doesn't need to be modified, does > > it? > > We can go either way. I prefer to go this way as it reduces level of > indirections in the macros. It makes code easier to read and > understand. > But if you insist, I can drop that change in next version. > I like the patches to be minimal. But I understand your point of view as well. If you have to issue a v6, maybe state the reason why you also modify INGENIC_PIN_GROUP() then. But I don't care enough to request a v6 just for that. So: Acked-by: Paul Cercueil <paul@crapouillou.net> Cheers, -Paul
Hi Andy, Le lundi 18 décembre 2023 à 12:41 +0200, Andy Shevchenko a écrit : > On Sun, Dec 17, 2023 at 03:43:24PM +0100, Paul Cercueil wrote: > > Le mercredi 13 décembre 2023 à 15:21 +0200, Andy Shevchenko a > > écrit : > > > On Wed, Dec 13, 2023 at 10:55:46AM +0100, Paul Cercueil wrote: > > > > Le lundi 11 décembre 2023 à 20:57 +0200, Andy Shevchenko a > > > > écrit : > > ... > > > > > > -#define INGENIC_PIN_GROUP(name, id, func) \ > > > > > - INGENIC_PIN_GROUP_FUNCS(name, id, (void *)(func)) > > > > > +#define INGENIC_PIN_GROUP(_name_, id, > > > > > func) \ > > > > > + { > > > > > > > > > > \ > > > > > + .name = > > > > > _name_, > > > > > \ > > > > > + .pins = > > > > > id##_pins, > > > > > \ > > > > > + .num_pins = > > > > > ARRAY_SIZE(id##_pins), \ > > > > > + .data = (void > > > > > *)func, \ > > > > > + } > > > > > > > > This INGENIC_PIN_GROUP() macro doesn't need to be modified, > > > > does > > > > it? > > > > > > We can go either way. I prefer to go this way as it reduces level > > > of > > > indirections in the macros. It makes code easier to read and > > > understand. > > > But if you insist, I can drop that change in next version. > > > > I like the patches to be minimal. But I understand your point of > > view > > as well. > > > > If you have to issue a v6, maybe state the reason why you also > > modify > > INGENIC_PIN_GROUP() then. But I don't care enough to request a v6 > > just > > for that. > > > > So: > > Acked-by: Paul Cercueil <paul@crapouillou.net> > > Thank you! > > But as I already noted, the series had been applied (by Linus W.) > and this does not seem to be a critical to fix, do you agree? > Well I only suggested to change the commit message - so no, it is not critical to fix. Cheers, -Paul
diff --git a/drivers/pinctrl/pinctrl-ingenic.c b/drivers/pinctrl/pinctrl-ingenic.c index ee718f6e2556..f5661dcdedf5 100644 --- a/drivers/pinctrl/pinctrl-ingenic.c +++ b/drivers/pinctrl/pinctrl-ingenic.c @@ -82,16 +82,21 @@ #define PINS_PER_GPIO_CHIP 32 #define JZ4730_PINS_PER_PAIRED_REG 16 -#define INGENIC_PIN_GROUP_FUNCS(name, id, funcs) \ - { \ - name, \ - id##_pins, \ - ARRAY_SIZE(id##_pins), \ - funcs, \ +#define INGENIC_PIN_GROUP_FUNCS(_name_, id, funcs) \ + { \ + .name = _name_, \ + .pins = id##_pins, \ + .num_pins = ARRAY_SIZE(id##_pins), \ + .data = funcs, \ } -#define INGENIC_PIN_GROUP(name, id, func) \ - INGENIC_PIN_GROUP_FUNCS(name, id, (void *)(func)) +#define INGENIC_PIN_GROUP(_name_, id, func) \ + { \ + .name = _name_, \ + .pins = id##_pins, \ + .num_pins = ARRAY_SIZE(id##_pins), \ + .data = (void *)func, \ + } enum jz_version { ID_JZ4730,