diff mbox series

[1/8] net: netronome: constify pointers to hwmon_channel_info

Message ID 20230407145911.79642-1-krzysztof.kozlowski@linaro.org (mailing list archive)
State Accepted
Commit 87f1c15e8759a006e39ddb7556f6829067f8dc3e
Delegated to: Netdev Maintainers
Headers show
Series [1/8] net: netronome: constify pointers to hwmon_channel_info | expand

Checks

Context Check Description
netdev/series_format warning Series does not have a cover letter; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit fail Errors and warnings before: 18 this patch: 20
netdev/cc_maintainers success CCed 8 of 8 maintainers
netdev/build_clang fail Errors and warnings before: 18 this patch: 28
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn fail Errors and warnings before: 18 this patch: 20
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

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

Jakub Kicinski April 7, 2023, 3:47 p.m. UTC | #1
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?
Simon Horman April 7, 2023, 4:07 p.m. UTC | #2
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
>
Guenter Roeck April 7, 2023, 6:05 p.m. UTC | #3
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
Simon Horman April 7, 2023, 6:17 p.m. UTC | #4
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>
Guenter Roeck April 7, 2023, 11:07 p.m. UTC | #5
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,
Jakub Kicinski April 8, 2023, 1:10 a.m. UTC | #6
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.
Krzysztof Kozlowski April 8, 2023, 10:44 a.m. UTC | #7
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
patchwork-bot+netdevbpf@kernel.org April 10, 2023, 2:20 a.m. UTC | #8
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 mbox series

Patch

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,