Re: [PATCH] 2.4.5pre3 warning fixes

2001-05-17 Thread Albert D. Cahalan

Bingner Sam J. Con writes:

> Looks to me like it's adding { and } on each side of the
> "c->devices->prev=d;" statement... so changing from:
> 
> if (c->devices != NULL)
>   c->devices->prev=d;
> 
> to 
> 
> if (c->devices != NULL){
>   c->devices->prev=d;
> }
> 
> I assume the new compiler likes the if to have explicit
> brackets instead of using the next statement...

Maybe one of these will make it happy:

(void)(c->devices && (c->devices->prev=d));

!c->devices ?: (c->devices->prev=d);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: [PATCH] 2.4.5pre3 warning fixes

2001-05-17 Thread Alan Cox

> if (c->devices != NULL){
>   c->devices->prev=d;
> }
> 
> I assume the new compiler likes the if to have explicit brackets instead of
> using the next statement...

Then its not a C compiler
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: [PATCH] 2.4.5pre3 warning fixes -- fixed

2001-05-17 Thread Rich Baum

In my previous patch I got  drivers/i2c/i2c-core.c confused with 
drivers/i2o/i2o_core.c  i2o_core.c did not have a warning at that line.  
Also, Jeff Garzik suggested I change the fixes for labels at the end of 
compound statements.  It also includes Petr 
Vandrovec's patch to rwsem.h so that 2.4.5preX would compile under gcc 3.0 
snapshots. Here is the new patch.

diff -urN -X /linux/dontdiff linux/arch/i386/math-emu/fpu_trig.c 
rb/arch/i386/math-emu/fpu_trig.c
--- linux/arch/i386/math-emu/fpu_trig.c Sat Apr 28 18:13:25 2001
+++ rb/arch/i386/math-emu/fpu_trig.cThu May 17 15:38:40 2001
@@ -1543,6 +1543,7 @@
  EXCEPTION(EX_INTERNAL | 0x116);
  return;
 #endif /* PARANOID */
+ break;
}
 }
   else if ( (st0_tag == TAG_Valid) || (st0_tag == TW_Denormal) )
diff -urN -X /linux/dontdiff linux/drivers/atm/fore200e.c 
rb/drivers/atm/fore200e.c
--- linux/drivers/atm/fore200e.cFri Feb  9 14:30:22 2001
+++ rb/drivers/atm/fore200e.c   Thu May 17 15:39:17 2001
@@ -439,6 +439,7 @@
 
 case FORE200E_STATE_BLANK:
/* nothing to do for that state */
+   break;
 }
 }
 
diff -urN -X /linux/dontdiff linux/drivers/cdrom/sbpcd.c 
rb/drivers/cdrom/sbpcd.c
--- linux/drivers/cdrom/sbpcd.c Sat Apr 28 18:13:35 2001
+++ rb/drivers/cdrom/sbpcd.cTue May 15 21:39:47 2001
@@ -1118,7 +1118,7 @@
return (0);
 }
 /*==*
/
-#endif 0
+#endif /* 0 */
 /*==*
/
 static int ResponseInfo(void)
 {
diff -urN -X /linux/dontdiff linux/drivers/i2o/i2o_lan.c 
rb/drivers/i2o/i2o_lan.c
--- linux/drivers/i2o/i2o_lan.c Fri Feb  9 14:30:23 2001
+++ rb/drivers/i2o/i2o_lan.cTue May 15 21:38:19 2001
@@ -938,7 +938,7 @@
spin_unlock_irq(>tx_lock);
return 0;
 }
-#endif CONFIG_NET_FC
+#endif /* CONFIG_NET_FC */
 
 /*
  * i2o_lan_packet_send(): Send a packet as is, including the MAC header.
diff -urN -X /linux/dontdiff linux/drivers/media/video/tuner.c 
rb/drivers/media/video/tuner.c
--- linux/drivers/media/video/tuner.c   Mon Feb 19 17:43:36 2001
+++ rb/drivers/media/video/tuner.c  Thu May 17 15:39:50 2001
@@ -558,6 +558,7 @@
 #endif
default:
/* nothing */
+   break;
}

return 0;
diff -urN -X /linux/dontdiff linux/drivers/net/tokenring/ibmtr.c 
rb/drivers/net/tokenring/ibmtr.c
--- linux/drivers/net/tokenring/ibmtr.c Tue Mar 20 15:05:00 2001
+++ rb/drivers/net/tokenring/ibmtr.cThu May 17 15:40:19 2001
@@ -1186,6 +1186,7 @@
isa_writeb(~SRB_RESP_INT, ti->mmio + ACA_OFFSET + 
ACA_RESET + ISRP_ODD);
 
  skip_reset:
+   break;
} /* SRB response */
 
if (status & ASB_FREE_INT) { /* ASB response */
diff -urN -X /linux/dontdiff linux/drivers/net/wan/hdlc.c 
rb/drivers/net/wan/hdlc.c
--- linux/drivers/net/wan/hdlc.cSat Apr 28 18:13:46 2001
+++ rb/drivers/net/wan/hdlc.c   Thu May 17 15:41:50 2001
@@ -1082,7 +1082,9 @@
}
break;
 
-   default:/* to be defined */
+   default:
+   /* to be defined */
+   break;
}
 
dev_kfree_skb(skb);
diff -urN -X /linux/dontdiff linux/drivers/net/wan/sdla_fr.c 
rb/drivers/net/wan/sdla_fr.c
--- linux/drivers/net/wan/sdla_fr.c Sat Apr 28 18:13:46 2001
+++ rb/drivers/net/wan/sdla_fr.cThu May 17 15:42:34 2001
@@ -4435,7 +4435,8 @@
trigger_fr_poll(dev);

break;
-   default:  // ARP's and RARP's -- Shouldn't happen.
+   default:
+   break;  // ARP's and RARP's -- Shouldn't happen.
}
 
return 0;   
diff -urN -X /linux/dontdiff linux/drivers/net/wan/sdla_x25.c 
rb/drivers/net/wan/sdla_x25.c
--- linux/drivers/net/wan/sdla_x25.cSat Apr 28 18:13:47 2001
+++ rb/drivers/net/wan/sdla_x25.c   Tue May 15 21:40:42 2001
@@ -3108,7 +3108,7 @@
case 0x08:  /* modem failure */
 #ifndef MODEM_NOT_LOG
printk(KERN_INFO "%s: modem failure!\n", card->devname);
-#endif MODEM_NOT_LOG
+#endif /* MODEM_NOT_LOG */
api_oob_event(card,mb);
break;
 
diff -urN -X /linux/dontdiff linux/drivers/scsi/NCR53c406a.c 
rb/drivers/scsi/NCR53c406a.c
--- linux/drivers/scsi/NCR53c406a.c Fri Mar  2 14:12:11 2001
+++ rb/drivers/scsi/NCR53c406a.cTue May 15 21:47:25 2001
@@ -221,7 +221,7 @@
 (void *)0xc8000
 };
 #define ADDRESS_COUNT (sizeof( addresses ) / sizeof( unsigned ))
-#endif USE_BIOS
+#endif /* USE_BIOS */
   
 /* possible i/o port addresses */
 static unsigned short ports[] =
@@ -244,7 +244,7 @@
 { "Copyright (C) Acculogic, Inc.\r\n2.8M Diskette Extension Bios ver 
4.04.03 

Re: [PATCH] 2.4.5pre3 warning fixes

2001-05-17 Thread Mohammad A. Haque

On Thu, 17 May 2001, Rich Baum wrote:

> This patch fixes warnings in 2.4.5pre3 about extra tokens at the end of
> #endif statements and labels at the end of compound statements when using gcc
> 3.0 snapshots.
>
> - if (c->devices != NULL)
> + if (c->devices != NULL){
>   c->devices->prev=d;
> + }
>   c->devices=d;
>

It didn't really complain about this one did it? Braces are optional
here or is that not part of ANSI C?

--

=
Mohammad A. Haque  http://www.haque.net/
   [EMAIL PROTECTED]

  "Alcohol and calculus don't mix. Project Lead
   Don't drink and derive." --Unknown  http://wm.themes.org/
   [EMAIL PROTECTED]
=

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: [PATCH] 2.4.5pre3 warning fixes

2001-05-17 Thread Jeff Garzik

Rich Baum wrote:
> @@ -1543,6 +1543,7 @@
>   EXCEPTION(EX_INTERNAL | 0x116);
>   return;
>  #endif /* PARANOID */
> + ;
> }
>  }
>else if ( (st0_tag == TAG_Valid) || (st0_tag == TW_Denormal) )
> @@ -437,7 +437,7 @@
> /* XXX shouldn't we *start* by deregistering the device? */
> atm_dev_deregister(fore200e->atm_dev);
> 
> -case FORE200E_STATE_BLANK:
> +case FORE200E_STATE_BLANK:;
> /* nothing to do for that state */
>  }
>  }
> @@ -556,7 +556,7 @@
> }
> break;
>  #endif
> -   default:
> +   default:;
> /* nothing */
> }
> 

IMHO the ":;" form is really easy to miss or mistake.

Can't you put a "break;" after the "nothing" comment instead?  The
compiled code is not bigger, and while the source gets a bit bigger, I
think the extra "break;" helps maintenance in the long term.

Jeff


-- 
Jeff Garzik  | Game called on account of naked chick
Building 1024|
MandrakeSoft |
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



RE: [PATCH] 2.4.5pre3 warning fixes

2001-05-17 Thread Bingner Sam J. Contractor RSIS

Looks to me like it's adding { and } on each side of the
"c->devices->prev=d;" statement... so changing from:

if (c->devices != NULL)
c->devices->prev=d;

to 

if (c->devices != NULL){
c->devices->prev=d;
}

I assume the new compiler likes the if to have explicit brackets instead of
using the next statement...

Sam Bingner

-Original Message-
From: Alan Cox [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 17, 2001 9:40 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: Re: [PATCH] 2.4.5pre3 warning fixes


> --- linux/drivers/i2o/i2o_core.c  Thu May 17 11:38:28 2001
> +++ rb/drivers/i2o/i2o_core.c Thu May 17 11:48:08 2001
> @@ -380,8 +380,9 @@
>   d->owner=NULL;
>   d->next=c->devices;
>   d->prev=NULL;
> - if (c->devices != NULL)
> + if (c->devices != NULL){
>   c->devices->prev=d;
> + }

What does this have to do with gcc compiler warnings ?

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: [PATCH] 2.4.5pre3 warning fixes

2001-05-17 Thread Alan Cox

> --- linux/drivers/i2o/i2o_core.c  Thu May 17 11:38:28 2001
> +++ rb/drivers/i2o/i2o_core.c Thu May 17 11:48:08 2001
> @@ -380,8 +380,9 @@
>   d->owner=NULL;
>   d->next=c->devices;
>   d->prev=NULL;
> - if (c->devices != NULL)
> + if (c->devices != NULL){
>   c->devices->prev=d;
> + }

What does this have to do with gcc compiler warnings ?

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] 2.4.5pre3 warning fixes

2001-05-17 Thread Rich Baum

This patch fixes warnings in 2.4.5pre3 about extra tokens at the end of 
#endif statements and labels at the end of compound statements when using gcc 
3.0 snapshots.

Rich

diff -urN -X /linux/dontdiff linux/arch/i386/math-emu/fpu_trig.c 
rb/arch/i386/math-emu/fpu_trig.c
--- linux/arch/i386/math-emu/fpu_trig.c Sat Apr 28 18:13:25 2001
+++ rb/arch/i386/math-emu/fpu_trig.cWed May 16 12:04:24 2001
@@ -1543,6 +1543,7 @@
  EXCEPTION(EX_INTERNAL | 0x116);
  return;
 #endif /* PARANOID */
+ ;
}
 }
   else if ( (st0_tag == TAG_Valid) || (st0_tag == TW_Denormal) )
diff -urN -X /linux/dontdiff linux/drivers/atm/fore200e.c 
rb/drivers/atm/fore200e.c
--- linux/drivers/atm/fore200e.cFri Feb  9 14:30:22 2001
+++ rb/drivers/atm/fore200e.c   Tue May 15 21:39:07 2001
@@ -437,7 +437,7 @@
/* XXX shouldn't we *start* by deregistering the device? */
atm_dev_deregister(fore200e->atm_dev);
 
-case FORE200E_STATE_BLANK:
+case FORE200E_STATE_BLANK:;
/* nothing to do for that state */
 }
 }
diff -urN -X /linux/dontdiff linux/drivers/cdrom/sbpcd.c 
rb/drivers/cdrom/sbpcd.c
--- linux/drivers/cdrom/sbpcd.c Sat Apr 28 18:13:35 2001
+++ rb/drivers/cdrom/sbpcd.cTue May 15 21:39:47 2001
@@ -1118,7 +1118,7 @@
return (0);
 }
 /*==*
/
-#endif 0
+#endif /* 0 */
 /*==*
/
 static int ResponseInfo(void)
 {
diff -urN -X /linux/dontdiff linux/drivers/i2o/i2o_core.c 
rb/drivers/i2o/i2o_core.c
--- linux/drivers/i2o/i2o_core.cThu May 17 11:38:28 2001
+++ rb/drivers/i2o/i2o_core.c   Thu May 17 11:48:08 2001
@@ -380,8 +380,9 @@
d->owner=NULL;
d->next=c->devices;
d->prev=NULL;
-   if (c->devices != NULL)
+   if (c->devices != NULL){
c->devices->prev=d;
+   }
c->devices=d;
*d->dev_name = 0;
 
diff -urN -X /linux/dontdiff linux/drivers/i2o/i2o_lan.c 
rb/drivers/i2o/i2o_lan.c
--- linux/drivers/i2o/i2o_lan.c Fri Feb  9 14:30:23 2001
+++ rb/drivers/i2o/i2o_lan.cTue May 15 21:38:19 2001
@@ -938,7 +938,7 @@
spin_unlock_irq(>tx_lock);
return 0;
 }
-#endif CONFIG_NET_FC
+#endif /* CONFIG_NET_FC */
 
 /*
  * i2o_lan_packet_send(): Send a packet as is, including the MAC header.
diff -urN -X /linux/dontdiff linux/drivers/media/video/tuner.c 
rb/drivers/media/video/tuner.c
--- linux/drivers/media/video/tuner.c   Mon Feb 19 17:43:36 2001
+++ rb/drivers/media/video/tuner.c  Thu May 17 12:28:59 2001
@@ -556,7 +556,7 @@
}
break;
 #endif
-   default:
+   default:;
/* nothing */
}

diff -urN -X /linux/dontdiff linux/drivers/net/tokenring/ibmtr.c 
rb/drivers/net/tokenring/ibmtr.c
--- linux/drivers/net/tokenring/ibmtr.c Tue Mar 20 15:05:00 2001
+++ rb/drivers/net/tokenring/ibmtr.cTue May 15 21:40:09 2001
@@ -1185,7 +1185,7 @@
isa_writeb(~CMD_IN_SRB, ti->mmio + ACA_OFFSET + 
ACA_RESET + ISRA_ODD);
isa_writeb(~SRB_RESP_INT, ti->mmio + ACA_OFFSET + 
ACA_RESET + ISRP_ODD);
 
- skip_reset:
+ skip_reset:;
} /* SRB response */
 
if (status & ASB_FREE_INT) { /* ASB response */
diff -urN -X /linux/dontdiff linux/drivers/net/wan/hdlc.c 
rb/drivers/net/wan/hdlc.c
--- linux/drivers/net/wan/hdlc.cSat Apr 28 18:13:46 2001
+++ rb/drivers/net/wan/hdlc.c   Tue May 15 21:41:23 2001
@@ -1082,7 +1082,7 @@
}
break;
 
-   default:/* to be defined */
+   default:;   /* to be defined */
}
 
dev_kfree_skb(skb);
diff -urN -X /linux/dontdiff linux/drivers/net/wan/sdla_fr.c 
rb/drivers/net/wan/sdla_fr.c
--- linux/drivers/net/wan/sdla_fr.c Sat Apr 28 18:13:46 2001
+++ rb/drivers/net/wan/sdla_fr.cTue May 15 21:41:00 2001
@@ -4435,7 +4435,7 @@
trigger_fr_poll(dev);

break;
-   default:  // ARP's and RARP's -- Shouldn't happen.
+   default:;  // ARP's and RARP's -- Shouldn't happen.
}
 
return 0;   
diff -urN -X /linux/dontdiff linux/drivers/net/wan/sdla_x25.c 
rb/drivers/net/wan/sdla_x25.c
--- linux/drivers/net/wan/sdla_x25.cSat Apr 28 18:13:47 2001
+++ rb/drivers/net/wan/sdla_x25.c   Tue May 15 21:40:42 2001
@@ -3108,7 +3108,7 @@
case 0x08:  /* modem failure */
 #ifndef MODEM_NOT_LOG
printk(KERN_INFO "%s: modem failure!\n", card->devname);
-#endif MODEM_NOT_LOG
+#endif /* MODEM_NOT_LOG */
api_oob_event(card,mb);
break;
 
diff -urN -X /linux/dontdiff linux/drivers/scsi/NCR53c406a.c 
rb/drivers/scsi/NCR53c406a.c
--- 

[PATCH] 2.4.5pre3 warning fixes

2001-05-17 Thread Rich Baum

This patch fixes warnings in 2.4.5pre3 about extra tokens at the end of 
#endif statements and labels at the end of compound statements when using gcc 
3.0 snapshots.

Rich

diff -urN -X /linux/dontdiff linux/arch/i386/math-emu/fpu_trig.c 
rb/arch/i386/math-emu/fpu_trig.c
--- linux/arch/i386/math-emu/fpu_trig.c Sat Apr 28 18:13:25 2001
+++ rb/arch/i386/math-emu/fpu_trig.cWed May 16 12:04:24 2001
@@ -1543,6 +1543,7 @@
  EXCEPTION(EX_INTERNAL | 0x116);
  return;
 #endif /* PARANOID */
+ ;
}
 }
   else if ( (st0_tag == TAG_Valid) || (st0_tag == TW_Denormal) )
diff -urN -X /linux/dontdiff linux/drivers/atm/fore200e.c 
rb/drivers/atm/fore200e.c
--- linux/drivers/atm/fore200e.cFri Feb  9 14:30:22 2001
+++ rb/drivers/atm/fore200e.c   Tue May 15 21:39:07 2001
@@ -437,7 +437,7 @@
/* XXX shouldn't we *start* by deregistering the device? */
atm_dev_deregister(fore200e-atm_dev);
 
-case FORE200E_STATE_BLANK:
+case FORE200E_STATE_BLANK:;
/* nothing to do for that state */
 }
 }
diff -urN -X /linux/dontdiff linux/drivers/cdrom/sbpcd.c 
rb/drivers/cdrom/sbpcd.c
--- linux/drivers/cdrom/sbpcd.c Sat Apr 28 18:13:35 2001
+++ rb/drivers/cdrom/sbpcd.cTue May 15 21:39:47 2001
@@ -1118,7 +1118,7 @@
return (0);
 }
 /*==*
/
-#endif 0
+#endif /* 0 */
 /*==*
/
 static int ResponseInfo(void)
 {
diff -urN -X /linux/dontdiff linux/drivers/i2o/i2o_core.c 
rb/drivers/i2o/i2o_core.c
--- linux/drivers/i2o/i2o_core.cThu May 17 11:38:28 2001
+++ rb/drivers/i2o/i2o_core.c   Thu May 17 11:48:08 2001
@@ -380,8 +380,9 @@
d-owner=NULL;
d-next=c-devices;
d-prev=NULL;
-   if (c-devices != NULL)
+   if (c-devices != NULL){
c-devices-prev=d;
+   }
c-devices=d;
*d-dev_name = 0;
 
diff -urN -X /linux/dontdiff linux/drivers/i2o/i2o_lan.c 
rb/drivers/i2o/i2o_lan.c
--- linux/drivers/i2o/i2o_lan.c Fri Feb  9 14:30:23 2001
+++ rb/drivers/i2o/i2o_lan.cTue May 15 21:38:19 2001
@@ -938,7 +938,7 @@
spin_unlock_irq(priv-tx_lock);
return 0;
 }
-#endif CONFIG_NET_FC
+#endif /* CONFIG_NET_FC */
 
 /*
  * i2o_lan_packet_send(): Send a packet as is, including the MAC header.
diff -urN -X /linux/dontdiff linux/drivers/media/video/tuner.c 
rb/drivers/media/video/tuner.c
--- linux/drivers/media/video/tuner.c   Mon Feb 19 17:43:36 2001
+++ rb/drivers/media/video/tuner.c  Thu May 17 12:28:59 2001
@@ -556,7 +556,7 @@
}
break;
 #endif
-   default:
+   default:;
/* nothing */
}

diff -urN -X /linux/dontdiff linux/drivers/net/tokenring/ibmtr.c 
rb/drivers/net/tokenring/ibmtr.c
--- linux/drivers/net/tokenring/ibmtr.c Tue Mar 20 15:05:00 2001
+++ rb/drivers/net/tokenring/ibmtr.cTue May 15 21:40:09 2001
@@ -1185,7 +1185,7 @@
isa_writeb(~CMD_IN_SRB, ti-mmio + ACA_OFFSET + 
ACA_RESET + ISRA_ODD);
isa_writeb(~SRB_RESP_INT, ti-mmio + ACA_OFFSET + 
ACA_RESET + ISRP_ODD);
 
- skip_reset:
+ skip_reset:;
} /* SRB response */
 
if (status  ASB_FREE_INT) { /* ASB response */
diff -urN -X /linux/dontdiff linux/drivers/net/wan/hdlc.c 
rb/drivers/net/wan/hdlc.c
--- linux/drivers/net/wan/hdlc.cSat Apr 28 18:13:46 2001
+++ rb/drivers/net/wan/hdlc.c   Tue May 15 21:41:23 2001
@@ -1082,7 +1082,7 @@
}
break;
 
-   default:/* to be defined */
+   default:;   /* to be defined */
}
 
dev_kfree_skb(skb);
diff -urN -X /linux/dontdiff linux/drivers/net/wan/sdla_fr.c 
rb/drivers/net/wan/sdla_fr.c
--- linux/drivers/net/wan/sdla_fr.c Sat Apr 28 18:13:46 2001
+++ rb/drivers/net/wan/sdla_fr.cTue May 15 21:41:00 2001
@@ -4435,7 +4435,7 @@
trigger_fr_poll(dev);

break;
-   default:  // ARP's and RARP's -- Shouldn't happen.
+   default:;  // ARP's and RARP's -- Shouldn't happen.
}
 
return 0;   
diff -urN -X /linux/dontdiff linux/drivers/net/wan/sdla_x25.c 
rb/drivers/net/wan/sdla_x25.c
--- linux/drivers/net/wan/sdla_x25.cSat Apr 28 18:13:47 2001
+++ rb/drivers/net/wan/sdla_x25.c   Tue May 15 21:40:42 2001
@@ -3108,7 +3108,7 @@
case 0x08:  /* modem failure */
 #ifndef MODEM_NOT_LOG
printk(KERN_INFO %s: modem failure!\n, card-devname);
-#endif MODEM_NOT_LOG
+#endif /* MODEM_NOT_LOG */
api_oob_event(card,mb);
break;
 
diff -urN -X /linux/dontdiff linux/drivers/scsi/NCR53c406a.c 
rb/drivers/scsi/NCR53c406a.c
--- linux/drivers/scsi/NCR53c406a.c 

Re: [PATCH] 2.4.5pre3 warning fixes

2001-05-17 Thread Alan Cox

 --- linux/drivers/i2o/i2o_core.c  Thu May 17 11:38:28 2001
 +++ rb/drivers/i2o/i2o_core.c Thu May 17 11:48:08 2001
 @@ -380,8 +380,9 @@
   d-owner=NULL;
   d-next=c-devices;
   d-prev=NULL;
 - if (c-devices != NULL)
 + if (c-devices != NULL){
   c-devices-prev=d;
 + }

What does this have to do with gcc compiler warnings ?

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



RE: [PATCH] 2.4.5pre3 warning fixes

2001-05-17 Thread Bingner Sam J. Contractor RSIS

Looks to me like it's adding { and } on each side of the
c-devices-prev=d; statement... so changing from:

if (c-devices != NULL)
c-devices-prev=d;

to 

if (c-devices != NULL){
c-devices-prev=d;
}

I assume the new compiler likes the if to have explicit brackets instead of
using the next statement...

Sam Bingner

-Original Message-
From: Alan Cox [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 17, 2001 9:40 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: Re: [PATCH] 2.4.5pre3 warning fixes


 --- linux/drivers/i2o/i2o_core.c  Thu May 17 11:38:28 2001
 +++ rb/drivers/i2o/i2o_core.c Thu May 17 11:48:08 2001
 @@ -380,8 +380,9 @@
   d-owner=NULL;
   d-next=c-devices;
   d-prev=NULL;
 - if (c-devices != NULL)
 + if (c-devices != NULL){
   c-devices-prev=d;
 + }

What does this have to do with gcc compiler warnings ?

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: [PATCH] 2.4.5pre3 warning fixes

2001-05-17 Thread Jeff Garzik

Rich Baum wrote:
 @@ -1543,6 +1543,7 @@
   EXCEPTION(EX_INTERNAL | 0x116);
   return;
  #endif /* PARANOID */
 + ;
 }
  }
else if ( (st0_tag == TAG_Valid) || (st0_tag == TW_Denormal) )
 @@ -437,7 +437,7 @@
 /* XXX shouldn't we *start* by deregistering the device? */
 atm_dev_deregister(fore200e-atm_dev);
 
 -case FORE200E_STATE_BLANK:
 +case FORE200E_STATE_BLANK:;
 /* nothing to do for that state */
  }
  }
 @@ -556,7 +556,7 @@
 }
 break;
  #endif
 -   default:
 +   default:;
 /* nothing */
 }
 

IMHO the :; form is really easy to miss or mistake.

Can't you put a break; after the nothing comment instead?  The
compiled code is not bigger, and while the source gets a bit bigger, I
think the extra break; helps maintenance in the long term.

Jeff


-- 
Jeff Garzik  | Game called on account of naked chick
Building 1024|
MandrakeSoft |
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: [PATCH] 2.4.5pre3 warning fixes

2001-05-17 Thread Mohammad A. Haque

On Thu, 17 May 2001, Rich Baum wrote:

 This patch fixes warnings in 2.4.5pre3 about extra tokens at the end of
 #endif statements and labels at the end of compound statements when using gcc
 3.0 snapshots.

 - if (c-devices != NULL)
 + if (c-devices != NULL){
   c-devices-prev=d;
 + }
   c-devices=d;


It didn't really complain about this one did it? Braces are optional
here or is that not part of ANSI C?

--

=
Mohammad A. Haque  http://www.haque.net/
   [EMAIL PROTECTED]

  Alcohol and calculus don't mix. Project Lead
   Don't drink and derive. --Unknown  http://wm.themes.org/
   [EMAIL PROTECTED]
=

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: [PATCH] 2.4.5pre3 warning fixes -- fixed

2001-05-17 Thread Rich Baum

In my previous patch I got  drivers/i2c/i2c-core.c confused with 
drivers/i2o/i2o_core.c  i2o_core.c did not have a warning at that line.  
Also, Jeff Garzik suggested I change the fixes for labels at the end of 
compound statements.  It also includes Petr 
Vandrovec's patch to rwsem.h so that 2.4.5preX would compile under gcc 3.0 
snapshots. Here is the new patch.

diff -urN -X /linux/dontdiff linux/arch/i386/math-emu/fpu_trig.c 
rb/arch/i386/math-emu/fpu_trig.c
--- linux/arch/i386/math-emu/fpu_trig.c Sat Apr 28 18:13:25 2001
+++ rb/arch/i386/math-emu/fpu_trig.cThu May 17 15:38:40 2001
@@ -1543,6 +1543,7 @@
  EXCEPTION(EX_INTERNAL | 0x116);
  return;
 #endif /* PARANOID */
+ break;
}
 }
   else if ( (st0_tag == TAG_Valid) || (st0_tag == TW_Denormal) )
diff -urN -X /linux/dontdiff linux/drivers/atm/fore200e.c 
rb/drivers/atm/fore200e.c
--- linux/drivers/atm/fore200e.cFri Feb  9 14:30:22 2001
+++ rb/drivers/atm/fore200e.c   Thu May 17 15:39:17 2001
@@ -439,6 +439,7 @@
 
 case FORE200E_STATE_BLANK:
/* nothing to do for that state */
+   break;
 }
 }
 
diff -urN -X /linux/dontdiff linux/drivers/cdrom/sbpcd.c 
rb/drivers/cdrom/sbpcd.c
--- linux/drivers/cdrom/sbpcd.c Sat Apr 28 18:13:35 2001
+++ rb/drivers/cdrom/sbpcd.cTue May 15 21:39:47 2001
@@ -1118,7 +1118,7 @@
return (0);
 }
 /*==*
/
-#endif 0
+#endif /* 0 */
 /*==*
/
 static int ResponseInfo(void)
 {
diff -urN -X /linux/dontdiff linux/drivers/i2o/i2o_lan.c 
rb/drivers/i2o/i2o_lan.c
--- linux/drivers/i2o/i2o_lan.c Fri Feb  9 14:30:23 2001
+++ rb/drivers/i2o/i2o_lan.cTue May 15 21:38:19 2001
@@ -938,7 +938,7 @@
spin_unlock_irq(priv-tx_lock);
return 0;
 }
-#endif CONFIG_NET_FC
+#endif /* CONFIG_NET_FC */
 
 /*
  * i2o_lan_packet_send(): Send a packet as is, including the MAC header.
diff -urN -X /linux/dontdiff linux/drivers/media/video/tuner.c 
rb/drivers/media/video/tuner.c
--- linux/drivers/media/video/tuner.c   Mon Feb 19 17:43:36 2001
+++ rb/drivers/media/video/tuner.c  Thu May 17 15:39:50 2001
@@ -558,6 +558,7 @@
 #endif
default:
/* nothing */
+   break;
}

return 0;
diff -urN -X /linux/dontdiff linux/drivers/net/tokenring/ibmtr.c 
rb/drivers/net/tokenring/ibmtr.c
--- linux/drivers/net/tokenring/ibmtr.c Tue Mar 20 15:05:00 2001
+++ rb/drivers/net/tokenring/ibmtr.cThu May 17 15:40:19 2001
@@ -1186,6 +1186,7 @@
isa_writeb(~SRB_RESP_INT, ti-mmio + ACA_OFFSET + 
ACA_RESET + ISRP_ODD);
 
  skip_reset:
+   break;
} /* SRB response */
 
if (status  ASB_FREE_INT) { /* ASB response */
diff -urN -X /linux/dontdiff linux/drivers/net/wan/hdlc.c 
rb/drivers/net/wan/hdlc.c
--- linux/drivers/net/wan/hdlc.cSat Apr 28 18:13:46 2001
+++ rb/drivers/net/wan/hdlc.c   Thu May 17 15:41:50 2001
@@ -1082,7 +1082,9 @@
}
break;
 
-   default:/* to be defined */
+   default:
+   /* to be defined */
+   break;
}
 
dev_kfree_skb(skb);
diff -urN -X /linux/dontdiff linux/drivers/net/wan/sdla_fr.c 
rb/drivers/net/wan/sdla_fr.c
--- linux/drivers/net/wan/sdla_fr.c Sat Apr 28 18:13:46 2001
+++ rb/drivers/net/wan/sdla_fr.cThu May 17 15:42:34 2001
@@ -4435,7 +4435,8 @@
trigger_fr_poll(dev);

break;
-   default:  // ARP's and RARP's -- Shouldn't happen.
+   default:
+   break;  // ARP's and RARP's -- Shouldn't happen.
}
 
return 0;   
diff -urN -X /linux/dontdiff linux/drivers/net/wan/sdla_x25.c 
rb/drivers/net/wan/sdla_x25.c
--- linux/drivers/net/wan/sdla_x25.cSat Apr 28 18:13:47 2001
+++ rb/drivers/net/wan/sdla_x25.c   Tue May 15 21:40:42 2001
@@ -3108,7 +3108,7 @@
case 0x08:  /* modem failure */
 #ifndef MODEM_NOT_LOG
printk(KERN_INFO %s: modem failure!\n, card-devname);
-#endif MODEM_NOT_LOG
+#endif /* MODEM_NOT_LOG */
api_oob_event(card,mb);
break;
 
diff -urN -X /linux/dontdiff linux/drivers/scsi/NCR53c406a.c 
rb/drivers/scsi/NCR53c406a.c
--- linux/drivers/scsi/NCR53c406a.c Fri Mar  2 14:12:11 2001
+++ rb/drivers/scsi/NCR53c406a.cTue May 15 21:47:25 2001
@@ -221,7 +221,7 @@
 (void *)0xc8000
 };
 #define ADDRESS_COUNT (sizeof( addresses ) / sizeof( unsigned ))
-#endif USE_BIOS
+#endif /* USE_BIOS */
   
 /* possible i/o port addresses */
 static unsigned short ports[] =
@@ -244,7 +244,7 @@
 { Copyright (C) Acculogic, Inc.\r\n2.8M Diskette Extension Bios ver 
4.04.03 

Re: [PATCH] 2.4.5pre3 warning fixes

2001-05-17 Thread Alan Cox

 if (c-devices != NULL){
   c-devices-prev=d;
 }
 
 I assume the new compiler likes the if to have explicit brackets instead of
 using the next statement...

Then its not a C compiler
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: [PATCH] 2.4.5pre3 warning fixes

2001-05-17 Thread Albert D. Cahalan

Bingner Sam J. Con writes:

 Looks to me like it's adding { and } on each side of the
 c-devices-prev=d; statement... so changing from:
 
 if (c-devices != NULL)
   c-devices-prev=d;
 
 to 
 
 if (c-devices != NULL){
   c-devices-prev=d;
 }
 
 I assume the new compiler likes the if to have explicit
 brackets instead of using the next statement...

Maybe one of these will make it happy:

(void)(c-devices  (c-devices-prev=d));

!c-devices ?: (c-devices-prev=d);
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/