From: Lei Zhu <redacted>
Replace vmalloc() with the equivalent and more readable
vmallc_array(). This change has no functional impact.
Signed-off-by: Lei Zhu <redacted>
---
drivers/net/ethernet/intel/ixgbevf/ethtool.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbevf/ethtool.c b/drivers/net/ethernet/intel/ixgbevf/ethtool.c
index 537a60d5276f..72bdac8c0075 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ethtool.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ethtool.c
@@ -322,8 +322,9 @@ static int ixgbevf_set_ringparam(struct net_device *netdev,
}
if (new_rx_count != adapter->rx_ring_count) {
- rx_ring = vmalloc(array_size(sizeof(*rx_ring),
- adapter->num_rx_queues));
+ rx_ring = vmalloc_array(adapter->num_rx_queues,
+ sizeof(*rx_ring));
+
if (!rx_ring) {
err = -ENOMEM;
goto clear_reset;--
2.25.1
From: Lei Zhu <redacted>
Sent: Friday, June 12, 2026 8:58 AM
From: Lei Zhu <redacted>
Replace vmalloc() with the equivalent and more readable
vmallc_array(). This change has no functional impact.
Hi,
If there's no functional impact what we want to achieve
through this patch? What's the point of touching
the code which works for ages in that case?
quoted hunk
Signed-off-by: Lei Zhu <redacted>
---
drivers/net/ethernet/intel/ixgbevf/ethtool.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbevf/ethtool.c b/drivers/net/ethernet/intel/ixgbevf/ethtool.c
index 537a60d5276f..72bdac8c0075 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ethtool.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ethtool.c
@@ -322,8 +322,9 @@ static int ixgbevf_set_ringparam(struct net_device *netdev,
}
if (new_rx_count != adapter->rx_ring_count) {
- rx_ring = vmalloc(array_size(sizeof(*rx_ring),
- adapter->num_rx_queues));
+ rx_ring = vmalloc_array(adapter->num_rx_queues,
+ sizeof(*rx_ring));
+
if (!rx_ring) {
err = -ENOMEM;
goto clear_reset;
--
2.25.1
At 2026-06-12 17:11:15, "Jagielski, Jedrzej" [off-list ref] wrote:
From: Lei Zhu <redacted>
Sent: Friday, June 12, 2026 8:58 AM
quoted
From: Lei Zhu <redacted>
Replace vmalloc() with the equivalent and more readable
vmallc_array(). This change has no functional impact.
Hi,
If there's no functional impact what we want to achieve
through this patch? What's the point of touching
the code which works for ages in that case?
While reading the ixgbevf_set_ringparam function, I noticed that
tx_ring is allocated using vmalloc_array(), but rx_ring still use vmalloc().
I found that commit 4490d075c2d9 ("eth: intel: use vmalloc_array() to
simplify code") didn't completely make the change. I saw a similar fix upstream
in commit 1772b7f8045b ("media: pt1: use vmalloc_array to simplify code"),
so I'm trying to make this consistent here.
quoted
Signed-off-by: Lei Zhu <redacted>
---
drivers/net/ethernet/intel/ixgbevf/ethtool.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbevf/ethtool.c b/drivers/net/ethernet/intel/ixgbevf/ethtool.c
index 537a60d5276f..72bdac8c0075 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ethtool.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ethtool.c
@@ -322,8 +322,9 @@ static int ixgbevf_set_ringparam(struct net_device *netdev,
}
if (new_rx_count != adapter->rx_ring_count) {
- rx_ring = vmalloc(array_size(sizeof(*rx_ring),
- adapter->num_rx_queues));
+ rx_ring = vmalloc_array(adapter->num_rx_queues,
+ sizeof(*rx_ring));
+
if (!rx_ring) {
err = -ENOMEM;
goto clear_reset;
--
2.25.1