Re: [PATCH 1/3] backports: convert the 62-usb_driver_lpm patch series to SmPL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 9 Dec 2013, Luis R. Rodriguez wrote:

> On Mon, Dec 9, 2013 at 8:25 PM, Johannes Berg <johannes@xxxxxxxxxxxxxxxx> wrote:
> > On Mon, 2013-12-09 at 19:27 +0100, Luis R. Rodriguez wrote:
> >
> >> +++ b/patches/collateral-evolutions/network/62-usb_driver_lpm.cocci
> >> @@ -0,0 +1,9 @@
> >> +@@
> >> +identifier backport_driver;
> >> +@@
> >> +struct usb_driver backport_driver = {
> >
> > You don't need "..." here?
> 
> Not in this case, it works, adding it actually doesn't work right now as I wish.

Structure initializers are a little bit special.  The programmer can put 
them in any order and all of them are optional.  So in a semantic patch, 
you can put only the ones that are relevant to the patch, in any order 
that you want.  All of them have to appear, but others can appear as well.

The only time when you would want to put ... in this case is when you are 
adding a new field initializer (note that Luis's patch only adds 
decoration round an existing field initializer).  In that case, if you put 
..., before the added field initializer, the addition will be at the end, 
and if you put ..., after the field initializer, the addition will be at 
the beginning.

Note that this is completely different than the declaration of the 
structure type itself.  In that case, the fields are ordered, so ... is 
needed.

julia



> 
> >> ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
> >> +     .disable_hub_initiated_lpm = 1,
> >> ++#endif
> >> +...
> >> +};
> 
>   Luis
> 
--
To unsubscribe from this list: send the line "unsubscribe backports" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux