From: David Brownell <david-b@pacbell.net>
To: "Daniel Glöckner" <dg@emlix.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] gpiolib: allow poll on gpio value
Date: Fri, 5 Jun 2009 22:41:13 -0700 [thread overview]
Message-ID: <200906052241.13638.david-b@pacbell.net> (raw)
In-Reply-To: <1244212590-15620-1-git-send-email-dg@emlix.com>
On Friday 05 June 2009, Daniel Glöckner wrote:
> + else {
> + int i;
> + status = 0;
> + for (i = 0; i < ARRAY_SIZE(trigger_types); i++)
> + if ((desc->flags & ((1 << FLAG_TRIG_FALL)
> + | (1 << FLAG_TRIG_RISE)))
> + == trigger_types[i].flags) {
> + status = sprintf(buf, "%s\n",
> + trigger_types[i].name);
> + break;
> + }
> + }
Looks pretty clean overall, but that snippet highlights some cosmetic
issues I'd like to see cleaned up:
- Blank line after each declaration block -- "int i" above.
- Prefer BIT(n) to (1 << n)
- And here, the ((1 << FLAG_TRIG_FALL) | (1 << FLAG_TRIG_RISE))
thing shows up all over, maybe #define as GPIO_TRIGGER_MASK
- That "== triger_types[..]" should use only tabs for indent.
And yes, like Ben I think this functionality is probably worth having,
since it's not something that *can* really be done from userspace with
the current calls.
- Dave
next prev parent reply other threads:[~2009-06-06 5:41 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-05 14:36 Daniel Glöckner
2009-06-06 3:46 ` Ben Nizette
2009-06-06 3:53 ` Ben Nizette
2009-06-06 6:01 ` David Brownell
2009-06-06 6:51 ` Ben Nizette
2009-06-06 5:41 ` David Brownell [this message]
2009-06-10 12:36 ` [PATCH v2] gpiolib: allow poll(2) " Daniel Glöckner
2009-07-01 23:05 ` David Brownell
2009-07-02 0:19 ` Ben Nizette
2009-07-02 11:15 ` Jani Nikula
2009-07-02 18:57 ` David Brownell
2009-07-02 21:37 ` Jani Nikula
2009-07-02 22:16 ` David Brownell
2009-07-14 19:26 ` [PATCH v3] " Daniel Glöckner
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=200906052241.13638.david-b@pacbell.net \
--to=david-b@pacbell.net \
--cc=dbrownell@users.sourceforge.net \
--cc=dg@emlix.com \
--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
Powered by JetHome