lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 5 Jun 2009 22:41:13 -0700
From:	David Brownell <david-b@...bell.net>
To:	Daniel Glöckner <dg@...ix.com>
Cc:	David Brownell <dbrownell@...rs.sourceforge.net>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] gpiolib: allow poll on gpio value

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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ