netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Buesch <mb@bu3sch.de>
To: Andreas Schwab <schwab@suse.de>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] Avoid switch on long long in s2io driver
Date: Sat, 26 May 2007 19:04:08 +0200	[thread overview]
Message-ID: <200705261904.09028.mb@bu3sch.de> (raw)
In-Reply-To: <jebqg8kllk.fsf@sykes.suse.de>

On Saturday 26 May 2007 10:58:15 Andreas Schwab wrote:
> A switch on long long causes gcc to generate a reference to __ucmpdi2 on
> ppc32.  Avoid that by casting to int, since the value is only a small
> integer anyway.
> 
> Signed-off-by: Andreas Schwab <schwab@suse.de>
> 
> ---
>  drivers/net/s2io.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> Index: linux-2.6.22-rc1/drivers/net/s2io.c
> ===================================================================
> --- linux-2.6.22-rc1.orig/drivers/net/s2io.c	2007-05-13 11:03:28.000000000 +0200
> +++ linux-2.6.22-rc1/drivers/net/s2io.c	2007-05-13 12:52:49.000000000 +0200
> @@ -2898,7 +2898,7 @@ static void tx_intr_handler(struct fifo_
>  
>  			/* update t_code statistics */
>  			err >>= 48;
> -			switch(err) {
> +			switch((int)err) {

Hm, maybe add a comment, too?
This cast looks redundant at the first look and someone
who doesn't understand it might submit a patch to remove it again.

>  				case 2:
>  					nic->mac_control.stats_info->sw_stat.
>  							tx_buf_abort_cnt++;
> @@ -6825,7 +6825,7 @@ static int rx_osm_handler(struct ring_in
>  			sp->mac_control.stats_info->sw_stat.parity_err_cnt++;
>  		}
>  		err >>= 48;
> -		switch(err) {
> +		switch((int)err) {
>  			case 1:
>  				sp->mac_control.stats_info->sw_stat.
>  				rx_parity_err_cnt++;
> 
> Andreas.
> 



-- 
Greetings Michael.

  reply	other threads:[~2007-05-26 17:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-26  8:58 [PATCH] Avoid switch on long long in s2io driver Andreas Schwab
2007-05-26 17:04 ` Michael Buesch [this message]
2007-05-30 19:37   ` Ramkrishna Vepa

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=200705261904.09028.mb@bu3sch.de \
    --to=mb@bu3sch.de \
    --cc=netdev@vger.kernel.org \
    --cc=schwab@suse.de \
    /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).