Message ID | 20230616161603.1127687-1-arnd@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1470801vqr; Fri, 16 Jun 2023 09:35:30 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5SdUN3qB3BNkWYyI0Xj/YXqeIlySjlIfE92VNT6D8pafkdYTa6BJGc8igDORu3hRCSVAy6 X-Received: by 2002:a05:6a20:429f:b0:10f:8f2e:edc0 with SMTP id o31-20020a056a20429f00b0010f8f2eedc0mr2979486pzj.55.1686933329635; Fri, 16 Jun 2023 09:35:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686933329; cv=none; d=google.com; s=arc-20160816; b=nEJfw1CyzqsvfgXqN3Wpn1CFNI0QW2A9JilCwPvuzDghBJKe333RJUiObOYLwQ3yvD mV+YMRa2MyWmKLWVu43dde+mlFyO2guZX4wZJL/YD7rsTz2Gdnu0lqzKIR7Cqtq+/TDZ UN7KuBGbC7w0nwdGzOg0RppBapvsj6nlvAzN8L27A0fUBA4Kx2F+JVSy2cA46aOXj63p pVpV1Nkx8tAESBpubtR0BdkSGKFm6hpWHEMo+55toV7S49MPbEnsG8NBuFw5FlLDHLPF CK1xdQhAj9hYEBwxqhYT/hFXosyE9U3d9mwnDfdB7J/6VbLstJNOPvIyqrPC2FpoyQVK lL8w== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=YYKJT18ikLlvNqi59UdSeMCqNH1RaM/xRNRzMDMXWE8=; b=bXs6Kdh0Y3JUVoASx9jeENtv+nCDe2H6xYJKk3YtY+JhXcqKf/I1r+Jqj8axwmC8MD 2n/MqzFV9CE9t6ey9aq1gtO4UYT8CZ+9y4I2gnZtRrEMbcKMdrkJGVAoE33dsqLk2Mmi LuZAcg3sOUEFtMVwyPxcJfhA1YqLA+Fr2h7/u0h2OUzXURU3SP5S9uzWZ4Up3V0xyKDV MR6jSdEfoN+/+5Mow3pu3V2sWkqDwOY13Cdkd/brcLPZ2AgBjm5Z7Kr+KgAkuVxh+Rlr jOoDCfr0QQA+YwXPw00A/DJmbaLrLXtrIiE2Tw8CmAYy4I1vOCWMGeue32/iK/J2y4R5 1gQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=el0IlpyA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u199-20020a6279d0000000b00666737b2b8bsi5520451pfc.383.2023.06.16.09.35.14; Fri, 16 Jun 2023 09:35:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=el0IlpyA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343695AbjFPQTG (ORCPT <rfc822;maxin.john@gmail.com> + 99 others); Fri, 16 Jun 2023 12:19:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345619AbjFPQSh (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 16 Jun 2023 12:18:37 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D3994EF6; Fri, 16 Jun 2023 09:16:44 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9297961479; Fri, 16 Jun 2023 16:16:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E8D17C433C0; Fri, 16 Jun 2023 16:16:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686932169; bh=V6jMrEt+FXDoE/Ml8OcTXnxM+sj50uwyqWWQ98+Wug8=; h=From:To:Cc:Subject:Date:From; b=el0IlpyAFVeltCcnsKIGmQaegZOmK7k1IBfPrcVInRdLQwK9umuSEBRwNaoMFbzGa hvYURaDEE68HtVWCyNYu5DIMS3jQPu1Q0NhjTJnB/wjfWulslj1iA2R24lZAqHE3jE bRSicMCbr4ljoMRUlXRCEzA2WF41GpV2HUKva3mcrnbNalf3FFDwQqgWypkPVZ57ba Mx3xq30xQTtt+8bviOkzIz541V0H12kOzDtN4ovGDCMtGFJ1XzIAkYPdD2JYJnVY+7 eZGab1DZ49tOOOe6KWEM056OqWQ9U830G4TJjhzGzrMmRntXFH+UK2TJu0UeZmSQsb 60Cz8lUj8Seew== From: Arnd Bergmann <arnd@kernel.org> To: Linus Walleij <linus.walleij@linaro.org>, Thierry Reding <thierry.reding@gmail.com>, Jonathan Hunter <jonathanh@nvidia.com> Cc: Arnd Bergmann <arnd@arndb.de>, Prathamesh Shete <pshete@nvidia.com>, Andy Shevchenko <andriy.shevchenko@linux.intel.com>, linux-gpio@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] pinctrl: tegra: avoid duplicate field initializers Date: Fri, 16 Jun 2023 18:15:55 +0200 Message-Id: <20230616161603.1127687-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768877802830682738?= X-GMAIL-MSGID: =?utf-8?q?1768877802830682738?= |
Series |
pinctrl: tegra: avoid duplicate field initializers
|
|
Commit Message
Arnd Bergmann
June 16, 2023, 4:15 p.m. UTC
From: Arnd Bergmann <arnd@arndb.de> The drv_reg field is initialized both in the DRV_PINGROUP_ENTRY_N/DRV_PINGROUP_ENTRY_Y macros and in DRV_PINGROUP_Y. Since each pingroup expands both macros, the are always duplicate and turning on -Woverride-init (which is disabled by default) causes a huge amount of warnings like: drivers/pinctrl/tegra/pinctrl-tegra234.c:1384:27: error: initialized field overwritten [-Werror=override-init] 1384 | #define DRV_PINGROUP_Y(r) ((r)) | ^ drivers/pinctrl/tegra/pinctrl-tegra234.c:1397:28: note: in expansion of macro 'DRV_PINGROUP_Y' 1397 | .drv_reg = DRV_PINGROUP_Y(r), \ | ^~~~~~~~~~~~~~ drivers/pinctrl/tegra/pinctrl-tegra234.c:1447:49: note: in expansion of macro 'DRV_PINGROUP_ENTRY_Y' 1447 | #define drive_soc_gpio08_pb0 DRV_PINGROUP_ENTRY_Y(0x500c, 12, 5, 20, 5, -1, -1, -1, -1, 0) | ^~~~~~~~~~~~~~~~~~~~ ... Remove the intialization that is never used here. Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- drivers/pinctrl/tegra/pinctrl-tegra234.c | 1 - 1 file changed, 1 deletion(-)
Comments
On Fri, Jun 16, 2023 at 6:16 PM Arnd Bergmann <arnd@kernel.org> wrote: > From: Arnd Bergmann <arnd@arndb.de> > > The drv_reg field is initialized both in the DRV_PINGROUP_ENTRY_N/DRV_PINGROUP_ENTRY_Y > macros and in DRV_PINGROUP_Y. Since each pingroup expands both macros, the are > always duplicate and turning on -Woverride-init (which is disabled by default) > causes a huge amount of warnings like: > > drivers/pinctrl/tegra/pinctrl-tegra234.c:1384:27: error: initialized field overwritten [-Werror=override-init] > 1384 | #define DRV_PINGROUP_Y(r) ((r)) > | ^ > drivers/pinctrl/tegra/pinctrl-tegra234.c:1397:28: note: in expansion of macro 'DRV_PINGROUP_Y' > 1397 | .drv_reg = DRV_PINGROUP_Y(r), \ > | ^~~~~~~~~~~~~~ > drivers/pinctrl/tegra/pinctrl-tegra234.c:1447:49: note: in expansion of macro 'DRV_PINGROUP_ENTRY_Y' > 1447 | #define drive_soc_gpio08_pb0 DRV_PINGROUP_ENTRY_Y(0x500c, 12, 5, 20, 5, -1, -1, -1, -1, 0) > | ^~~~~~~~~~~~~~~~~~~~ > ... > > Remove the intialization that is never used here. > > Signed-off-by: Arnd Bergmann <arnd@arndb.de> Patch applied! Yours, Linus Walleij
diff --git a/drivers/pinctrl/tegra/pinctrl-tegra234.c b/drivers/pinctrl/tegra/pinctrl-tegra234.c index fd70725392162..86c2b84e792d9 100644 --- a/drivers/pinctrl/tegra/pinctrl-tegra234.c +++ b/drivers/pinctrl/tegra/pinctrl-tegra234.c @@ -1442,7 +1442,6 @@ static const char * const tegra234_functions[] = { .schmitt_bit = schmitt_b, \ .drvtype_bit = 13, \ .lpdr_bit = e_lpdr, \ - .drv_reg = -1, \ /* main drive pin groups */ #define drive_soc_gpio08_pb0 DRV_PINGROUP_ENTRY_Y(0x500c, 12, 5, 20, 5, -1, -1, -1, -1, 0)