From: Richard Purdie <rpurdie@rpsys.net>
To: Jan-Benedict Glaw <jbglaw@lug-owl.de>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 4/11] LED: Add LED Timer Trigger
Date: Tue, 31 Jan 2006 17:36:56 +0000 [thread overview]
Message-ID: <1138729017.6869.219.camel@localhost.localdomain> (raw)
In-Reply-To: <20060131150101.GX18336@lug-owl.de>
On Tue, 2006-01-31 at 16:01 +0100, Jan-Benedict Glaw wrote:
> On Tue, 2006-01-31 13:41:37 +0000, Richard Purdie <rpurdie@rpsys.net> wrote:
> > +static void led_timer_setdata(struct led_device *led_dev, unsigned long duty, unsigned long frequency)
> > +{
> > + struct timer_trig_data *timer_data = led_dev->trigger_data;
> > + signed long duty1;
> > +
> > + if (frequency > 500)
> > + frequency = 500;
>
> Why?
We're dealing with msec delays. Any frequency > 1000 will just cause
problems. There was a reason for using half that but it escapes me and
might be unneeded now. 500Hz/1000Hz is above the frequency the human eye
can see so is unlikely to present a problem.
> ...and especially: why, without complaining?
This is the important bit. It should return an -EINVAL back to
userspace.
> > + if (duty > 100)
> > + duty = 100;
>
> Dito.
Duty cycles > 100 make no sense and would break the subsequent
calculation. Same problem/solution as above.
Thanks,
Richard
next prev parent reply other threads:[~2006-01-31 17:37 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-31 13:41 [PATCH 0/11] LED Class, Triggers and Drivers Richard Purdie
2006-01-31 13:41 ` [PATCH 2/11] LED: Add LED Class Richard Purdie
2006-01-31 14:55 ` Jan-Benedict Glaw
2006-01-31 20:59 ` Greg KH
2006-01-31 21:41 ` Richard Purdie
2006-02-01 1:41 ` Greg KH
2006-01-31 13:41 ` [PATCH 4/11] LED: Add LED Timer Trigger Richard Purdie
2006-01-31 15:01 ` Jan-Benedict Glaw
2006-01-31 17:36 ` Richard Purdie [this message]
2006-01-31 15:04 ` [PATCH 0/11] LED Class, Triggers and Drivers Jan-Benedict Glaw
2006-01-31 15:33 ` Pierre Ossman
2006-01-31 16:48 ` Richard Purdie
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=1138729017.6869.219.camel@localhost.localdomain \
--to=rpurdie@rpsys.net \
--cc=jbglaw@lug-owl.de \
--cc=linux-kernel@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).