From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kay Sievers Date: Mon, 01 Sep 2008 17:50:16 +0000 Subject: Re: [PATCH] Some function locals in udev_rules_parse.c were Message-Id: <1220291416.29777.2.camel@lgn.site> List-Id: References: <48BAD549.6080304@tuffmail.co.uk> In-Reply-To: <48BAD549.6080304@tuffmail.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org 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 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