From: Kay Sievers <kay.sievers@vrfy.org>
To: linux-hotplug@vger.kernel.org
Subject: Re: [PATCH] Some function locals in udev_rules_parse.c were
Date: Mon, 01 Sep 2008 17:50:16 +0000 [thread overview]
Message-ID: <1220291416.29777.2.camel@lgn.site> (raw)
In-Reply-To: <48BAD549.6080304@tuffmail.co.uk>
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@tuffmail.co.uk> 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
prev parent reply other threads:[~2008-09-01 17:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-31 17:30 [PATCH] Some function locals in udev_rules_parse.c were needlessly Alan Jenkins
2008-09-01 14:32 ` [PATCH] Some function locals in udev_rules_parse.c were needlessly declared as static Kay Sievers
2008-09-01 17:37 ` [PATCH] Some function locals in udev_rules_parse.c were needlessly Alan Jenkins
2008-09-01 17:50 ` Kay Sievers [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1220291416.29777.2.camel@lgn.site \
--to=kay.sievers@vrfy.org \
--cc=linux-hotplug@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).