Message ID | 20230407145911.79642-1-krzysztof.kozlowski@linaro.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp355345vqo; Fri, 7 Apr 2023 08:17:31 -0700 (PDT) X-Google-Smtp-Source: AKy350a2nGJs4yRYwvqIB7WfxV0lCH/O/yF62N1mwxdzAnp0sL6tBovjHjH8PmiBxah0DQecsEP5 X-Received: by 2002:a17:90b:792:b0:23d:1b82:7236 with SMTP id l18-20020a17090b079200b0023d1b827236mr3006904pjz.16.1680880651051; Fri, 07 Apr 2023 08:17:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680880651; cv=none; d=google.com; s=arc-20160816; b=qyUUNgcvz423FyQKPRA1aaBD546bSaJgPgHfacBR6C2yHcYNxZlSg+KXQa3XHL54as judE1vs9tlY2IgaZ54X5njdmTfB3Alt8krVGaCsNvry7aaKuN28ipH7qauE6w/YFQNyd mM6Phdk8KJdP1FN68GGXF4/zgzuimLFiYWsYTpbmOjGqnK0wovFFo+o/e5MF3yx/26gv nS6lfALJsZJTUSmyTqutw9z/ghfe7d3aARUi5DOSIQcohGBvbjmSH/fVpIUX+cmDgwg1 EIwBndNHqceHX9d1J6NbCKp7kTiCWqRXgtZub376nkvVr0CeS4WN8teUlkAav4TPKhoe U+Qw== 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; bh=ouAafH+krnDju3cDx0dVXvaHAGeBW02eHtT9Z/Gm7OA=; b=PsR2aLcOzhKOcyUhNQU26huF6xgLAtU5z5ZPM8JSjdZ8QRT0ewzamWuELINwuw0DXi j+QmzsgPzCqexrVwjI5RIIzQYKsI+yRC1hWV3/7fBQYD+FIKuzQVeSlp5MfB1IYKLuW4 tr7tps8z5xWhg5/IsLIHPzg393Yz9RRnyVqK/H+LQt/nWnTMHsdNJW/FxczK1x7ERcCf JGdbP8JIELo/TzykUUA7xMfiHJQx7UVOftS2BSNj/AjBL4QN/Qpja4QCm3YU6dsQy1ch r7PhaBrMHg+dZs8D5+qNpUTDZBOEQ5ntKmYJcbsbEx3FPHgCMz/QafJj8wyqfcAbu3tJ gEZg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h7-20020a170902ac8700b001a516964a28si1231350plr.650.2023.04.07.08.17.18; Fri, 07 Apr 2023 08:17:31 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231330AbjDGO7c (ORCPT <rfc822;a1648639935@gmail.com> + 99 others); Fri, 7 Apr 2023 10:59:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230474AbjDGO7Y (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 7 Apr 2023 10:59:24 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E752AD21; Fri, 7 Apr 2023 07:59:23 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 2A410611A9; Fri, 7 Apr 2023 14:59:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 13DF9C433EF; Fri, 7 Apr 2023 14:59:17 +0000 (UTC) From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> To: Igor Russkikh <irusskikh@marvell.com>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Simon Horman <simon.horman@corigine.com>, Andrew Lunn <andrew@lunn.ch>, Heiner Kallweit <hkallweit1@gmail.com>, Russell King <linux@armlinux.org.uk>, Florian Fainelli <f.fainelli@gmail.com>, Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, =?utf-8?q?Marek_Beh=C3=BAn?= <kabel@kernel.org>, Xu Liang <lxu@maxlinear.com>, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, oss-drivers@corigine.com Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>, Jean Delvare <jdelvare@suse.com>, Guenter Roeck <linux@roeck-us.net>, linux-hwmon@vger.kernel.org Subject: [PATCH 1/8] net: netronome: constify pointers to hwmon_channel_info Date: Fri, 7 Apr 2023 16:59:04 +0200 Message-Id: <20230407145911.79642-1-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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?1762531109731500496?= X-GMAIL-MSGID: =?utf-8?q?1762531109731500496?= |
Series |
[1/8] net: netronome: constify pointers to hwmon_channel_info
|
|
Commit Message
Krzysztof Kozlowski
April 7, 2023, 2:59 p.m. UTC
Statically allocated array of pointed to hwmon_channel_info can be made
const for safety.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
This depends on hwmon core patch:
https://lore.kernel.org/all/20230406203103.3011503-2-krzysztof.kozlowski@linaro.org/
Therefore I propose this should also go via hwmon tree.
Cc: Jean Delvare <jdelvare@suse.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: linux-hwmon@vger.kernel.org
---
drivers/net/ethernet/netronome/nfp/nfp_hwmon.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Fri, Apr 07, 2023 at 04:59:11PM +0200, Krzysztof Kozlowski wrote: > Statically allocated array of pointed to hwmon_channel_info can be made > const for safety. > > Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Andrew
On Fri, 7 Apr 2023 16:59:04 +0200 Krzysztof Kozlowski wrote: > This depends on hwmon core patch: > https://lore.kernel.org/all/20230406203103.3011503-2-krzysztof.kozlowski@linaro.org/ That patch should have been put on a stable branch we can pull and avoid any conflict risks... Next time?
On Fri, Apr 07, 2023 at 04:59:04PM +0200, Krzysztof Kozlowski wrote: > Statically allocated array of pointed to hwmon_channel_info can be made > const for safety. > > Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> > > --- > > This depends on hwmon core patch: > https://lore.kernel.org/all/20230406203103.3011503-2-krzysztof.kozlowski@linaro.org/ > > Therefore I propose this should also go via hwmon tree. > > Cc: Jean Delvare <jdelvare@suse.com> > Cc: Guenter Roeck <linux@roeck-us.net> > Cc: linux-hwmon@vger.kernel.org Subject prefix should be 'nfp: ' Other than that, this looks ok to me. Though I am at a loss as to what tree the patches at the URL above apply to and thus am unable to verify this code in any way other than visually. > --- > drivers/net/ethernet/netronome/nfp/nfp_hwmon.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/netronome/nfp/nfp_hwmon.c b/drivers/net/ethernet/netronome/nfp/nfp_hwmon.c > index 5cabb1aa9c0c..0d6c59d6d4ae 100644 > --- a/drivers/net/ethernet/netronome/nfp/nfp_hwmon.c > +++ b/drivers/net/ethernet/netronome/nfp/nfp_hwmon.c > @@ -115,7 +115,7 @@ static const struct hwmon_channel_info nfp_power = { > .config = nfp_power_config, > }; > > -static const struct hwmon_channel_info *nfp_hwmon_info[] = { > +static const struct hwmon_channel_info * const nfp_hwmon_info[] = { > &nfp_chip, > &nfp_temp, > &nfp_power, > -- > 2.34.1 >
On Fri, Apr 07, 2023 at 08:47:45AM -0700, Jakub Kicinski wrote: > On Fri, 7 Apr 2023 16:59:04 +0200 Krzysztof Kozlowski wrote: > > This depends on hwmon core patch: > > https://lore.kernel.org/all/20230406203103.3011503-2-krzysztof.kozlowski@linaro.org/ > > That patch should have been put on a stable branch we can pull > and avoid any conflict risks... Next time? Yes, and I don't feel comfortable applying all those patches through the hwmon tree since I have zero means to test them. I created a stable branch at git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-const Feel free to use it. Guenter
On Fri, Apr 07, 2023 at 06:07:56PM +0200, Simon Horman wrote: > On Fri, Apr 07, 2023 at 04:59:04PM +0200, Krzysztof Kozlowski wrote: > > Statically allocated array of pointed to hwmon_channel_info can be made > > const for safety. > > > > Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> > > > > --- > > > > This depends on hwmon core patch: > > https://lore.kernel.org/all/20230406203103.3011503-2-krzysztof.kozlowski@linaro.org/ > > > > Therefore I propose this should also go via hwmon tree. > > > > Cc: Jean Delvare <jdelvare@suse.com> > > Cc: Guenter Roeck <linux@roeck-us.net> > > Cc: linux-hwmon@vger.kernel.org > > Subject prefix should be 'nfp: ' > > Other than that, this looks ok to me. > Though I am at a loss as to what tree the patches at the URL above apply to > and thus am unable to verify this code in any way other than visually. I've now been able to apply and build the patch on top of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-const Thanks to Guenter for supplying the branch. And thanks to Krzysztof for the patch. My nit about the subject prefix not withstanding, Acked-by: Simon Horman <simon.horman@corigine.com>
On 4/7/23 07:59, Krzysztof Kozlowski wrote: > Statically allocated array of pointed to hwmon_channel_info can be made > const for safety. > > Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> > > --- > > This depends on hwmon core patch: > https://lore.kernel.org/all/20230406203103.3011503-2-krzysztof.kozlowski@linaro.org/ > > Therefore I propose this should also go via hwmon tree. I am not going to apply patches for 10+ subsystems through the hwmon tree. This can only result in chaos. The dependent patch is available at git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-const or wait until after the next commit window to apply this series. Thanks, Guenter > > Cc: Jean Delvare <jdelvare@suse.com> > Cc: Guenter Roeck <linux@roeck-us.net> > Cc: linux-hwmon@vger.kernel.org > --- > drivers/net/ethernet/netronome/nfp/nfp_hwmon.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/netronome/nfp/nfp_hwmon.c b/drivers/net/ethernet/netronome/nfp/nfp_hwmon.c > index 5cabb1aa9c0c..0d6c59d6d4ae 100644 > --- a/drivers/net/ethernet/netronome/nfp/nfp_hwmon.c > +++ b/drivers/net/ethernet/netronome/nfp/nfp_hwmon.c > @@ -115,7 +115,7 @@ static const struct hwmon_channel_info nfp_power = { > .config = nfp_power_config, > }; > > -static const struct hwmon_channel_info *nfp_hwmon_info[] = { > +static const struct hwmon_channel_info * const nfp_hwmon_info[] = { > &nfp_chip, > &nfp_temp, > &nfp_power,
On Fri, 7 Apr 2023 11:05:06 -0700 Guenter Roeck wrote: > On Fri, Apr 07, 2023 at 08:47:45AM -0700, Jakub Kicinski wrote: > > On Fri, 7 Apr 2023 16:59:04 +0200 Krzysztof Kozlowski wrote: > > > This depends on hwmon core patch: > > > https://lore.kernel.org/all/20230406203103.3011503-2-krzysztof.kozlowski@linaro.org/ > > > > That patch should have been put on a stable branch we can pull > > and avoid any conflict risks... Next time? > > Yes, and I don't feel comfortable applying all those patches through > the hwmon tree since I have zero means to test them. > > I created a stable branch at > > git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-const Thanks! Krzysztof, give us a nod and we'll take the series to net-next.
On 08/04/2023 03:10, Jakub Kicinski wrote: > On Fri, 7 Apr 2023 11:05:06 -0700 Guenter Roeck wrote: >> On Fri, Apr 07, 2023 at 08:47:45AM -0700, Jakub Kicinski wrote: >>> On Fri, 7 Apr 2023 16:59:04 +0200 Krzysztof Kozlowski wrote: >>>> This depends on hwmon core patch: >>>> https://lore.kernel.org/all/20230406203103.3011503-2-krzysztof.kozlowski@linaro.org/ >>> >>> That patch should have been put on a stable branch we can pull >>> and avoid any conflict risks... Next time? >> >> Yes, and I don't feel comfortable applying all those patches through >> the hwmon tree since I have zero means to test them. >> >> I created a stable branch at >> >> git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-const > > Thanks! Krzysztof, give us a nod and we'll take the series to net-next. Sure, go ahead, that's even better solution. Best regards, Krzysztof
Hello: This series was applied to netdev/net-next.git (main) by Jakub Kicinski <kuba@kernel.org>: On Fri, 7 Apr 2023 16:59:04 +0200 you wrote: > Statically allocated array of pointed to hwmon_channel_info can be made > const for safety. > > Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> > > --- > > [...] Here is the summary with links: - [1/8] net: netronome: constify pointers to hwmon_channel_info https://git.kernel.org/netdev/net-next/c/87f1c15e8759 - [2/8] net: aquantia: constify pointers to hwmon_channel_info https://git.kernel.org/netdev/net-next/c/bc1585f611b2 - [3/8] net: phy: aquantia: constify pointers to hwmon_channel_info https://git.kernel.org/netdev/net-next/c/234d79a5f826 - [4/8] net: phy: bcm54140: constify pointers to hwmon_channel_info https://git.kernel.org/netdev/net-next/c/211f70be2577 - [5/8] net: phy: marvell: constify pointers to hwmon_channel_info https://git.kernel.org/netdev/net-next/c/ff0805e2bde0 - [6/8] net: phy: mxl: constify pointers to hwmon_channel_info https://git.kernel.org/netdev/net-next/c/2ed84c0c6f75 - [7/8] net: phy: nxp-tja11xx: constify pointers to hwmon_channel_info https://git.kernel.org/netdev/net-next/c/0e76f1dcf487 - [8/8] net: phy: sfp: constify pointers to hwmon_channel_info https://git.kernel.org/netdev/net-next/c/490fde262f17 You are awesome, thank you!
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_hwmon.c b/drivers/net/ethernet/netronome/nfp/nfp_hwmon.c index 5cabb1aa9c0c..0d6c59d6d4ae 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_hwmon.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_hwmon.c @@ -115,7 +115,7 @@ static const struct hwmon_channel_info nfp_power = { .config = nfp_power_config, }; -static const struct hwmon_channel_info *nfp_hwmon_info[] = { +static const struct hwmon_channel_info * const nfp_hwmon_info[] = { &nfp_chip, &nfp_temp, &nfp_power,