Skip to contentSkip to conversation

net/intel/e100: Make read-only param_range struct static const

PATCH RESEND New Jakub Raczynski 1 participant 1 message Apr 28 1 message not in the archive

Subsystems (4)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): CGME20260428102655eucas1p1786b9974056b896017eed056a1fbac91@eucas1p1.samsung.com

#1 lore raw

PATCH RESEND 1/1 net/intel/e100: Make read-only param_range struct static const

No need to use stack for single use read-only struct, just make it static const.

---
 drivers/net/ethernet/intel/e100.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/e100.c +2 -2
index 9074b558de35..6bce22e15a97 100644
@@ -1034,8 +1034,8 @@ static inline int e100_phy_supports_mii(struct nic *nic)
 
 static void e100_get_defaults(struct nic *nic)
 {
-	struct param_range rfds = { .min = 16, .max = 256, .count = 256 };
-	struct param_range cbs  = { .min = 64, .max = 256, .count = 128 };
+	static const struct param_range rfds = { .min = 16, .max = 256, .count = 256 };
+	static const struct param_range cbs  = { .min = 64, .max = 256, .count = 128 };
 
 	/* MAC type is encoded as rev ID; exception: ICH is treated as 82559 */
 	nic->mac = (nic->flags & ich) ? mac_82559_D101M : nic->pdev->revision;
Signature · 1 line
2.34.1