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:	Thu, 17 May 2012 15:20:39 +0900
From:	Magnus Damm <magnus.damm@...il.com>
To:	Joe Perches <joe@...ches.com>
Cc:	linux-kernel@...r.kernel.org, rjw@...k.pl,
	linus.walleij@...ricsson.com, arnd@...db.de,
	linux-sh@...r.kernel.org, horms@...ge.net.au,
	grant.likely@...retlab.ca, lethal@...ux-sh.org, olof@...om.net
Subject: Re: [PATCH] gpio: Emma Mobile GPIO driver V2

Hi Joe,

On Wed, May 16, 2012 at 1:32 AM, Joe Perches <joe@...ches.com> wrote:
> On Wed, 2012-05-16 at 00:43 +0900, Magnus Damm wrote:
>> This patch is V2 of the Emma Mobile GPIO driver.
>
> Just some trivial comments

Nice with feedback, thank you!

>> +++ work/drivers/gpio/gpio-em.c       2012-05-16 00:07:20.000000000 +0900
> []
>
> Adding pr_fmt before any #include prefixes all pr_<level> messages.
>
> #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

Ok, good idea, will add.

>> +#include <linux/init.h>
>> +#include <linux/platform_device.h>
> []
>> +static int em_gio_irq_set_type(struct irq_data *d, unsigned int type)
>> +{
> []
>> +     pr_debug("gio: sense irq = %d, mode = %d\n", offset, value);
>
>        pr_debug("sense irq = %d, mode = %d\n", offset, value);

Right, with the above pr_fmt() line.

> []
>> +static void __em_gio_set(struct gpio_chip *chip, unsigned int reg,
>> +                      unsigned shift, int value)
>> +{
>> +     /* upper 16 bits contains mask and lower 16 actual value */
>> +     em_gio_write(gpio_to_priv(chip), reg,
>> +                  (1 << (shift + 16)) | (value << shift));
>> +}
>
> comment doesn't seem to match code unless
> value is a single bit, then value should
> probably be renamed.

Perhaps a bit odd, but the argument variable names match the GPIO API:

[include/linux/gpio.h]
..
static inline void gpio_set_value(unsigned int gpio, int value)

So I prefer to keep them as-is.

>> +static int em_gio_irq_domain_map(struct irq_domain *h, unsigned int virq,
>> +                              irq_hw_number_t hw)
>> +{
>> +     struct em_gio_priv *p = h->host_data;
>> +
>> +     pr_debug("gio: map hw irq = %d, virq = %d\n", (int)hw, virq);
>
>        pr_debug("map hw irq = %d, virq = %d\n", (int)hw, virq)
>
>> +static struct irq_domain_ops em_gio_irq_domain_ops = {
>
> const?

Sure, why not?

>> +static int __devinit em_gio_probe(struct platform_device *pdev)
> []
>> +     p = kzalloc(sizeof(*p), GFP_KERNEL);
>> +     if (!p) {
>> +             dev_err(&pdev->dev, "failed to allocate driver data\n");
>
> OOM messages aren't necessary as k.alloc failures
> produce a dump_stack.

Ok!

Thanks for your feedback, I will address them in a separate
incremental feature patch.

/ magnus
--
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