netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] idpf: make read-only arrays tx_itr and rx_itr static const
@ 2024-08-22 21:34 Colin Ian King
  2024-08-23 12:39 ` [Intel-wired-lan] " Alexander Lobakin
  0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2024-08-22 21:34 UTC (permalink / raw)
  To: Tony Nguyen, Przemek Kitszel, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, intel-wired-lan, netdev
  Cc: kernel-janitors, linux-kernel

Don't populate the read-only arrays tx_itr and rx_itr on the stack at
run time, instead make them static const.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 drivers/net/ethernet/intel/idpf/idpf_virtchnl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
index 70986e12da28..d50e5cab05fc 100644
--- a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
+++ b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
@@ -3149,8 +3149,8 @@ void idpf_vport_init(struct idpf_vport *vport, struct idpf_vport_max_q *max_q)
 	struct idpf_adapter *adapter = vport->adapter;
 	struct virtchnl2_create_vport *vport_msg;
 	struct idpf_vport_config *vport_config;
-	u16 tx_itr[] = {2, 8, 64, 128, 256};
-	u16 rx_itr[] = {2, 8, 32, 96, 128};
+	static const u16 tx_itr[] = {2, 8, 64, 128, 256};
+	static const u16 rx_itr[] = {2, 8, 32, 96, 128};
 	struct idpf_rss_data *rss_data;
 	u16 idx = vport->idx;
 
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Intel-wired-lan] [PATCH][next] idpf: make read-only arrays tx_itr and rx_itr static const
  2024-08-22 21:34 [PATCH][next] idpf: make read-only arrays tx_itr and rx_itr static const Colin Ian King
@ 2024-08-23 12:39 ` Alexander Lobakin
  0 siblings, 0 replies; 2+ messages in thread
From: Alexander Lobakin @ 2024-08-23 12:39 UTC (permalink / raw)
  To: Colin Ian King
  Cc: Tony Nguyen, Przemek Kitszel, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, intel-wired-lan, netdev,
	kernel-janitors, linux-kernel

From: Colin Ian King <colin.i.king@gmail.com>
Date: Thu, 22 Aug 2024 22:34:10 +0100

> Don't populate the read-only arrays tx_itr and rx_itr on the stack at
> run time, instead make them static const.
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
>  drivers/net/ethernet/intel/idpf/idpf_virtchnl.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
> index 70986e12da28..d50e5cab05fc 100644
> --- a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
> +++ b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
> @@ -3149,8 +3149,8 @@ void idpf_vport_init(struct idpf_vport *vport, struct idpf_vport_max_q *max_q)
>  	struct idpf_adapter *adapter = vport->adapter;
>  	struct virtchnl2_create_vport *vport_msg;
>  	struct idpf_vport_config *vport_config;
> -	u16 tx_itr[] = {2, 8, 64, 128, 256};
> -	u16 rx_itr[] = {2, 8, 32, 96, 128};
> +	static const u16 tx_itr[] = {2, 8, 64, 128, 256};
> +	static const u16 rx_itr[] = {2, 8, 32, 96, 128};

Move it to the top of the function to keep the RCT style?

>  	struct idpf_rss_data *rss_data;
>  	u16 idx = vport->idx;

Thanks,
Olek

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-08-23 12:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-22 21:34 [PATCH][next] idpf: make read-only arrays tx_itr and rx_itr static const Colin Ian King
2024-08-23 12:39 ` [Intel-wired-lan] " Alexander Lobakin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).