From: Nathan Lynch <ntl@pobox.com>
To: "Kim, Milo" <Milo.Kim@ti.com>
Cc: Bryan Wu <cooloney@gmail.com>,
"linux-leds@vger.kernel.org" <linux-leds@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] leds: simply LED trigger list management
Date: Thu, 17 Jan 2013 12:51:17 -0600 [thread overview]
Message-ID: <1358448677.26320.22.camel@doorstop.aus.2wire.com> (raw)
In-Reply-To: <A874F61F95741C4A9BA573A70FE3998F69E17700@DQHE02.ent.ti.com>
On Thu, 2013-01-17 at 01:06 +0000, Kim, Milo wrote:
> @@ -242,17 +233,15 @@ EXPORT_SYMBOL_GPL(led_trigger_unregister);
> void led_trigger_event(struct led_trigger *trig,
> enum led_brightness brightness)
> {
> - struct list_head *entry;
> + struct led_classdev *led_cdev;
>
> if (!trig)
> return;
>
> read_lock(&trig->leddev_list_lock);
> - list_for_each(entry, &trig->led_cdevs) {
> - struct led_classdev *led_cdev;
> -
> - led_cdev = list_entry(entry, struct led_classdev, trig_list);
> - led_set_brightness(led_cdev, brightness);
> + list_for_each_entry(led_cdev, &leds_list, node) {
> + if (led_cdev->trigger == trig)
> + led_set_brightness(led_cdev, brightness);
> }
> read_unlock(&trig->leddev_list_lock);
Continuing to use trig->leddev_list_lock doesn't seem right. Shouldn't
traversal of leds_list be guarded by the leds_list_lock rwsem? And if
so, is it safe to use a potentially-blocking lock in this context?
next prev parent reply other threads:[~2013-01-17 19:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-17 1:06 Kim, Milo
2013-01-17 18:51 ` Nathan Lynch [this message]
2013-01-18 0:00 ` Kim, Milo
2013-01-18 18:57 ` Nathan Lynch
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=1358448677.26320.22.camel@doorstop.aus.2wire.com \
--to=ntl@pobox.com \
--cc=Milo.Kim@ti.com \
--cc=cooloney@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@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
all inboxes | Powered by JetHome®