Re: [PATCH] staging: wlan-ng: fix Missing a blank line after declarations warnings

From: Joe Perches
Date: Fri Jun 13 2014 - 13:37:27 EST


On Fri, 2014-06-13 at 10:15 -0700, Greg Kroah-Hartman wrote:
> On Fri, Jun 13, 2014 at 10:58:14PM +0800, Cheng-Wei Lee wrote:
> > Signed-off-by: Quentin Lee <lee.rhapsody@xxxxxxxxx>
[]
> > diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c
[]
> > @@ -3533,7 +3533,6 @@ static void hfa384x_usbin_rx(wlandevice_t
> > *wlandev, struct sk_buff *skb)
> > }
> >
> > done:
> > - return;
> > }
>
> That's a good thing to do, but it is not what you said you did up above
> in the changelog entry.

I don't believe it's a good thing to do at all.
I suspect more that this wasn't compile tested.

This doesn't compile for at least several
supported gcc versions.

gcc doesn't (didn't? I haven't tried 4.9) like:

label:
}

to terminate a function definition.

$ cat label_test.c
void func(void)
{
goto label;
label:
}
$

with gcc 4.8:

$ gcc label_test.c
label_test.c: In function âfuncâ:
label_test.c:5:1: error: label at end of compound statement
label:
^

whereas this compiles fine:

$ cat label_test2.c
void func(void)
{
goto label;
label:
;
}
$

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