[PATCH][next][V2] ice: make const read-only array dflt_rules static

Colin Ian King posted 1 patch 9 months ago
drivers/net/ethernet/intel/ice/ice_ethtool_fdir.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH][next][V2] ice: make const read-only array dflt_rules static
Posted by Colin Ian King 9 months ago
Don't populate the const read-only array dflt_rules on the stack at run
time, instead make it static.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>

---
V2: Remove additional changes not related to this commit.
---
 drivers/net/ethernet/intel/ice/ice_ethtool_fdir.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool_fdir.c b/drivers/net/ethernet/intel/ice/ice_ethtool_fdir.c
index 1d118171de37..aceec184e89b 100644
--- a/drivers/net/ethernet/intel/ice/ice_ethtool_fdir.c
+++ b/drivers/net/ethernet/intel/ice/ice_ethtool_fdir.c
@@ -1605,7 +1605,7 @@ void ice_fdir_replay_fltrs(struct ice_pf *pf)
  */
 int ice_fdir_create_dflt_rules(struct ice_pf *pf)
 {
-	const enum ice_fltr_ptype dflt_rules[] = {
+	static const enum ice_fltr_ptype dflt_rules[] = {
 		ICE_FLTR_PTYPE_NONF_IPV4_TCP, ICE_FLTR_PTYPE_NONF_IPV4_UDP,
 		ICE_FLTR_PTYPE_NONF_IPV6_TCP, ICE_FLTR_PTYPE_NONF_IPV6_UDP,
 	};
-- 
2.49.0
RE: [Intel-wired-lan] [PATCH][next][V2] ice: make const read-only array dflt_rules static
Posted by Rinitha, SX 8 months, 3 weeks ago
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of Colin Ian King
> Sent: 17 March 2025 22:50
> To: Nguyen, Anthony L <anthony.l.nguyen@intel.com>; Kitszel, Przemyslaw <przemyslaw.kitszel@intel.com>; Andrew Lunn <andrew+netdev@lunn.ch>; David S . Miller <davem@davemloft.net>; Dumazet, Eric <edumazet@google.com>; Jakub Kicinski <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>; intel-wired-lan@lists.osuosl.org; netdev@vger.kernel.org
> Cc: kernel-janitors@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: [Intel-wired-lan] [PATCH][next][V2] ice: make const read-only array dflt_rules static
>
> Don't populate the const read-only array dflt_rules on the stack at run time, instead make it static.
>
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
>
> ---
> V2: Remove additional changes not related to this commit.
> ---
> drivers/net/ethernet/intel/ice/ice_ethtool_fdir.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>

Tested-by: Rinitha S <sx.rinitha@intel.com> (A Contingent worker at Intel)