Re: [PATCH] Some function locals in udev_rules_parse.c were needlessly declared as static

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

 



On Mon, 2008-09-01 at 18:37 +0100, Alan Jenkins wrote:
> Kay Sievers wrote:
> > On Sun, Aug 31, 2008 at 19:30, Alan Jenkins <alan-jenkins@xxxxxxxxxxxxxx> wrote:
> >   
> >> This does not affect current behaviour.  However, it is required to
> >> make the functions thread-safe.  (I'm playing with a threaded udevd).
> >>     
> >
> >   
> >> -       static struct udev_rule *rule;
> >> +       struct udev_rule *rule;
> >>     
> >
> > It's not needlessly static, we return _this_ value. The parsing stuff
> > is not thread safe at the moment, we would need a real fix, this would
> > break it.
> >   
> Thanks for looking at these patches.
> 
> The functions do "return rule", but they always write to it before
> reading it, so there's no persistent state here.  And they don't "return
> &rule", so it's fine for the variable to be on the stack.  Did I miss
> something?

Ah, they should return a pointer to the data passed in to the function,
which should be fine.

Applied.

Thanks,
Kay

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

[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     [X.org]     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux