Here's a set of patches that fix compile warnings using gcc 2.97. The first
patch is purely a syntactical change (mainly removing default: statements that
do nothing), the second is a change in code structure that "looks" correct but
was brought on by the same type of warning where the case label has no effect.

So I split up the patch into two parts so we cna decide to throw out the second
if it is indeed incorrect. The 2nd patch (arp.patch) changes the following code

                switch (dev->type) {
                default:
                        break;
                case ARPHRD_ROSE:
#if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE)
                case ARPHRD_AX25:
#if defined(CONFIG_NETROM) || defined(CONFIG_NETROM_MODULE)
                case ARPHRD_NETROM:
#endif
                        neigh->ops = &arp_broken_ops;
                        neigh->output = neigh->ops->output;
                        return 0;
#endif
                }


--to this:--


                switch (dev->type) {
                case ARPHRD_ROSE:
#if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE)
                case ARPHRD_AX25:
#endif
#if defined(CONFIG_NETROM) || defined(CONFIG_NETROM_MODULE)
                case ARPHRD_NETROM:
#endif
                        neigh->ops = &arp_broken_ops;
                        neigh->output = neigh->ops->output;
                        return 0;
                }

---
Which I believe is really the correct flow for that switch statement.
If someone disagrees, just toss it and apply the first patch. :-)

Regards,
 Byron

-- 
Byron Stanoszek                         Ph: (330) 644-3059
Systems Programmer                      Fax: (330) 644-8110
Commercial Timesharing Inc.             Email: [EMAIL PROTECTED]
--- linux/drivers/sound/sequencer.c.bak Tue Jan  2 22:34:44 2001
+++ linux/drivers/sound/sequencer.c     Tue Jan  2 22:36:32 2001
@@ -510,8 +510,6 @@
                                voice = chn;
                        synth_devs[dev]->aftertouch(dev, voice, parm);
                        break;
-
-               default:
        }
 #undef dev
 #undef cmd
@@ -613,8 +611,6 @@
                        else    /* MODE 1 */
                                synth_devs[dev]->bender(dev, chn, w14);
                        break;
-
-               default:
        }
 }
 
@@ -683,8 +679,6 @@
                                seq_copy_to_input((unsigned char *) &parm, 4);
                        }
                        break;
-
-               default:
        }
 
        return TIMER_NOT_ARMED;
@@ -700,8 +694,6 @@
                case LOCL_STARTAUDIO:
                        DMAbuf_start_devices(parm);
                        break;
-
-               default:
        }
 }
 
@@ -858,8 +850,6 @@
                case EV_SYSEX:
                        seq_sysex_message(q);
                        break;
-
-               default:
        }
        return 0;
 }
--- linux/drivers/sound/sb_ess.c.bak    Tue Jan  2 22:40:01 2001
+++ linux/drivers/sound/sb_ess.c        Tue Jan  2 22:43:05 2001
@@ -766,12 +766,6 @@
                case IMODE_INPUT:
                        DMAbuf_inputintr (dev);
                        break;
-
-               case IMODE_INIT:
-                       break;
-
-               default:
-                       /* printk(KERN_WARN "ESS: Unexpected interrupt\n"); */
        }
 }
 
@@ -1529,13 +1523,11 @@
 
 static int ess_has_rec_mixer (int submodel)
 {
-       switch (submodel) {
-       case SUBMDL_ES1887:
+       if(submodel == SUBMDL_ES1887)
                return 1;
-       default:
+       else
                return 0;
-       };
-};
+}
 
 #ifdef FKS_LOGGING
 static int ess_mixer_mon_regs[]
--- linux/drivers/sound/sound_timer.c.bak       Tue Jan  2 22:44:56 2001
+++ linux/drivers/sound/sound_timer.c   Tue Jan  2 22:45:06 2001
@@ -164,8 +164,6 @@
                case TMR_ECHO:
                        seq_copy_to_input(event, 8);
                        break;
-
-               default:
        }
        return TIMER_NOT_ARMED;
 }
--- linux/fs/isofs/inode.c.bak  Tue Jan  2 22:46:55 2001
+++ linux/fs/isofs/inode.c      Tue Jan  2 22:47:01 2001
@@ -1264,7 +1264,7 @@
            (volume_seq_no != 0) && (volume_seq_no != 1)) {
                printk(KERN_WARNING "Multi-volume CD somehow got mounted.\n");
        } else
-#endif IGNORE_WRONG_MULTI_VOLUME_SPECS
+#endif /* IGNORE_WRONG_MULTI_VOLUME_SPECS */
        {
                if (S_ISREG(inode->i_mode)) {
                        inode->i_fop = &generic_ro_fops;
--- linux/net/ipv4/arp.c.bak    Tue Jan  2 22:53:31 2001
+++ linux/net/ipv4/arp.c        Tue Jan  2 22:56:13 2001
@@ -267,7 +267,6 @@
                   in old paradigm.
                 */
 
-#if 1
                /* So... these "amateur" devices are hopeless.
                   The only thing, that I can say now:
                   It is very sad that we need to keep ugly obsolete
@@ -280,20 +279,18 @@
                   I wonder why people believe that they work.
                 */
                switch (dev->type) {
-               default:
-                       break;
                case ARPHRD_ROSE:       
 #if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE)
                case ARPHRD_AX25:
+#endif
 #if defined(CONFIG_NETROM) || defined(CONFIG_NETROM_MODULE)
                case ARPHRD_NETROM:
 #endif
                        neigh->ops = &arp_broken_ops;
                        neigh->output = neigh->ops->output;
                        return 0;
-#endif
                }
-#endif
+
                if (neigh->type == RTN_MULTICAST) {
                        neigh->nud_state = NUD_NOARP;
                        arp_mc_map(addr, neigh->ha, dev, 1);

Reply via email to