diff mbox

[6/7] e1000e: cleanup: swap arguments to avoid checkpatch errors

Message ID 1291862457-16671-7-git-send-email-asbjorn@asbjorn.biz
State Awaiting Upstream, archived
Delegated to: David Miller
Headers show

Commit Message

Asbjoern Sloth Toennesen Dec. 9, 2010, 2:40 a.m. UTC
Swap argument order in order to avoid checkpatch treating it as an
unary operation, instead of an binary one, and obtain consistency
with the 3 other similar assignments in netdev.c (tdlen & rdlen).

This patch fixes 3 checkpatch errors.

Signed-off-by: Asbjoern Sloth Toennesen <asbjorn@asbjorn.biz>
---
 drivers/net/e1000e/netdev.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

Comments

Ben Hutchings Dec. 9, 2010, 3:32 a.m. UTC | #1
On Thu, 2010-12-09 at 02:40 +0000, Asbjoern Sloth Toennesen wrote:
> Swap argument order in order to avoid checkpatch treating it as an
> unary operation, instead of an binary one, and obtain consistency
> with the 3 other similar assignments in netdev.c (tdlen & rdlen).
> 
> This patch fixes 3 checkpatch errors.

You have got to be kidding.  If the checkpatch warning offends you, fix
the bug in checkpatch instead of changing perfectly good code.

Ben.

> Signed-off-by: Asbjoern Sloth Toennesen <asbjorn@asbjorn.biz>
> ---
>  drivers/net/e1000e/netdev.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
> index bb6a1f5..bdd3774 100644
> --- a/drivers/net/e1000e/netdev.c
> +++ b/drivers/net/e1000e/netdev.c
> @@ -2059,7 +2059,7 @@ int e1000e_setup_tx_resources(struct e1000_adapter *adapter)
>  	struct e1000_ring *tx_ring = adapter->tx_ring;
>  	int err = -ENOMEM, size;
>  
> -	size = sizeof(struct e1000_buffer) * tx_ring->count;
> +	size = tx_ring->count * sizeof(struct e1000_buffer);
>  	tx_ring->buffer_info = vzalloc(size);
>  	if (!tx_ring->buffer_info)
>  		goto err;
> @@ -2094,7 +2094,7 @@ int e1000e_setup_rx_resources(struct e1000_adapter *adapter)
>  	struct e1000_buffer *buffer_info;
>  	int i, size, desc_len, err = -ENOMEM;
>  
> -	size = sizeof(struct e1000_buffer) * rx_ring->count;
> +	size = rx_ring->count * sizeof(struct e1000_buffer);
>  	rx_ring->buffer_info = vzalloc(size);
>  	if (!rx_ring->buffer_info)
>  		goto err;
> @@ -2151,7 +2151,7 @@ static void e1000_clean_tx_ring(struct e1000_adapter *adapter)
>  		e1000_put_txbuf(adapter, buffer_info);
>  	}
>  
> -	size = sizeof(struct e1000_buffer) * tx_ring->count;
> +	size = tx_ring->count * sizeof(struct e1000_buffer);
>  	memset(tx_ring->buffer_info, 0, size);
>  
>  	memset(tx_ring->desc, 0, tx_ring->size);
florian@mickler.org Dec. 9, 2010, 10:34 a.m. UTC | #2
On Thu, 09 Dec 2010 03:32:28 +0000
Ben Hutchings <bhutchings@solarflare.com> wrote:

> On Thu, 2010-12-09 at 02:40 +0000, Asbjoern Sloth Toennesen wrote:
> > Swap argument order in order to avoid checkpatch treating it as an
> > unary operation, instead of an binary one, and obtain consistency
> > with the 3 other similar assignments in netdev.c (tdlen & rdlen).
> > 
> > This patch fixes 3 checkpatch errors.
> 
> You have got to be kidding.  If the checkpatch warning offends you, fix
> the bug in checkpatch instead of changing perfectly good code.
> 
> Ben.

That bug is fixed already:
 https://patchwork.kernel.org/patch/299172/

Andrew picked it up.

Regards,
Flo
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index bb6a1f5..bdd3774 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -2059,7 +2059,7 @@  int e1000e_setup_tx_resources(struct e1000_adapter *adapter)
 	struct e1000_ring *tx_ring = adapter->tx_ring;
 	int err = -ENOMEM, size;
 
-	size = sizeof(struct e1000_buffer) * tx_ring->count;
+	size = tx_ring->count * sizeof(struct e1000_buffer);
 	tx_ring->buffer_info = vzalloc(size);
 	if (!tx_ring->buffer_info)
 		goto err;
@@ -2094,7 +2094,7 @@  int e1000e_setup_rx_resources(struct e1000_adapter *adapter)
 	struct e1000_buffer *buffer_info;
 	int i, size, desc_len, err = -ENOMEM;
 
-	size = sizeof(struct e1000_buffer) * rx_ring->count;
+	size = rx_ring->count * sizeof(struct e1000_buffer);
 	rx_ring->buffer_info = vzalloc(size);
 	if (!rx_ring->buffer_info)
 		goto err;
@@ -2151,7 +2151,7 @@  static void e1000_clean_tx_ring(struct e1000_adapter *adapter)
 		e1000_put_txbuf(adapter, buffer_info);
 	}
 
-	size = sizeof(struct e1000_buffer) * tx_ring->count;
+	size = tx_ring->count * sizeof(struct e1000_buffer);
 	memset(tx_ring->buffer_info, 0, size);
 
 	memset(tx_ring->desc, 0, tx_ring->size);