On Tue, Sep 24, 2013 at 06:06:16AM -0400, Lidza Louina wrote:
> On Mon, Sep 23, 2013 at 8:10 PM, Dan Carpenter <dan.carpen...@oracle.com> 
> wrote:
> > On Tue, Sep 24, 2013 at 03:06:06AM +0300, Dan Carpenter wrote:
> >> On Mon, Sep 23, 2013 at 06:47:13PM -0400, Lidza Louina wrote:
> >> > This patch removes this smatch warning:
> >> > warn: missing break? reassigning 'ch->pscan_state'
> >>
> >> I would just leave this one as is.
> >>
> >
> > Yes.  Actually, the fix isn't right.  Let's drop this one.
> >
> > regards,
> > dan carpenter
> >
> 
> The switch statement this code refers to has the
> default behavior first then all the different cases. Isn't
> it supposed to be the other way around where
> the different cases are presented before the default?

Write a small test program and figure it out.  ;)

int main(int argc, char **argv)
{
        int num;

        if (argc != 2) {
                printf("no number\n");
                return 1;
        }

        num = atoi(argv[1]);

        switch (num) {
                default:
                        printf("%d\n", num);
                case 1:
                        printf("one\n");
                        break;
                case 2:
                        printf("two\n");

        }

        return 0;
}

regards,
dan carpenter
_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to