netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Hutchings <bhutchings@solarflare.com>
To: Asbjoern Sloth Toennesen <asbjorn@asbjorn.biz>
Cc: e1000-devel@lists.sourceforge.net, netdev@vger.kernel.org,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 6/7] e1000e: cleanup: swap arguments to avoid checkpatch errors
Date: Thu, 09 Dec 2010 03:32:28 +0000	[thread overview]
Message-ID: <1291865548.19763.1.camel@localhost> (raw)
In-Reply-To: <1291862457-16671-7-git-send-email-asbjorn@asbjorn.biz>

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);

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


------------------------------------------------------------------------------
This SF Dev2Dev email is sponsored by:

WikiLeaks The End of the Free Internet
http://p.sf.net/sfu/therealnews-com
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel&#174; Ethernet, visit http://communities.intel.com/community/wired

  reply	other threads:[~2010-12-09  3:32 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-09  2:40 [PATCH 0/7] e1000e: cleanup Asbjoern Sloth Toennesen
2010-12-09  2:40 ` [PATCH 1/7] e1000e: cleanup: fix spacing issues Asbjoern Sloth Toennesen
2010-12-09  2:40 ` Asbjoern Sloth Toennesen
2010-12-09  2:40 ` Asbjoern Sloth Toennesen
2010-12-09  2:40 ` [PATCH 2/7] e1000e: cleanup: fix bracket issues Asbjoern Sloth Toennesen
2010-12-09  2:40 ` Asbjoern Sloth Toennesen
2010-12-09  2:40 ` Asbjoern Sloth Toennesen
2010-12-09  2:40 ` [PATCH 3/7] e1000e: cleanup: simplify E1000_ALL_* defines Asbjoern Sloth Toennesen
2010-12-09  2:40 ` Asbjoern Sloth Toennesen
2010-12-09  2:40 ` Asbjoern Sloth Toennesen
2010-12-09  2:40 ` [PATCH 4/7] e1000e: cleanup: fix long lines Asbjoern Sloth Toennesen
2010-12-09  2:40 ` Asbjoern Sloth Toennesen
2010-12-09  3:34   ` Ben Hutchings
2010-12-09  2:40 ` Asbjoern Sloth Toennesen
2010-12-09  2:40 ` [PATCH 5/7] e1000e: cleanup: fix space issues in ich8_* structs Asbjoern Sloth Toennesen
2010-12-09  2:40 ` Asbjoern Sloth Toennesen
2010-12-09  2:40 ` Asbjoern Sloth Toennesen
2010-12-09  2:40 ` [PATCH 6/7] e1000e: cleanup: swap arguments to avoid checkpatch errors Asbjoern Sloth Toennesen
2010-12-09  3:32   ` Ben Hutchings [this message]
2010-12-09 10:34     ` Florian Mickler
2010-12-09  2:40 ` Asbjoern Sloth Toennesen
2010-12-09  2:40 ` Asbjoern Sloth Toennesen
2010-12-09  2:40 ` [PATCH 7/7] e1000e: cleanup: fix copyright notices to preferred style Asbjoern Sloth Toennesen
2010-12-09  2:40 ` Asbjoern Sloth Toennesen
2010-12-09  2:40 ` Asbjoern Sloth Toennesen
2010-12-09  3:37 ` [PATCH 0/7] e1000e: cleanup Stephen Hemminger
2010-12-10  5:20 ` Kirsher, Jeffrey T

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1291865548.19763.1.camel@localhost \
    --to=bhutchings@solarflare.com \
    --cc=asbjorn@asbjorn.biz \
    --cc=e1000-devel@lists.sourceforge.net \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).