All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] max732x: Correct nr_port checking off by one error
@ 2010-04-12  7:29 Axel Lin
  2010-04-21 21:55 ` Andrew Morton
  0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2010-04-12  7:29 UTC (permalink / raw)
  To: linux-kernel; +Cc: Eric Miao

Setup both client_group_a and client_group_b if nr_port > 8 (not
including nr_port==8).

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/gpio/max732x.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpio/max732x.c b/drivers/gpio/max732x.c
index f786824..51b02c6 100644
--- a/drivers/gpio/max732x.c
+++ b/drivers/gpio/max732x.c
@@ -285,14 +285,14 @@ static int __devinit max732x_probe(struct
i2c_client *client,
        switch (client->addr & 0x70) {
        case 0x60:
                chip->client_group_a = client;
-               if (nr_port > 7) {
+               if (nr_port > 8) {
                        c = i2c_new_dummy(client->adapter, addr_b);
                        chip->client_group_b = chip->client_dummy = c;
                }
                break;
        case 0x50:
                chip->client_group_b = client;
-               if (nr_port > 7) {
+               if (nr_port > 8) {
                        c = i2c_new_dummy(client->adapter, addr_a);
                        chip->client_group_a = chip->client_dummy = c;
                }
@@ -307,7 +307,7 @@ static int __devinit max732x_probe(struct
i2c_client *client,
        mutex_init(&chip->lock);

        max732x_read(chip, is_group_a(chip, 0), &chip->reg_out[0]);
-       if (nr_port > 7)
+       if (nr_port > 8)
                max732x_read(chip, is_group_a(chip, 8), &chip->reg_out[1]);

        ret = gpiochip_add(&chip->gpio_chip);
-- 
1.5.4.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] max732x: Correct nr_port checking off by one error
  2010-04-12  7:29 [PATCH] max732x: Correct nr_port checking off by one error Axel Lin
@ 2010-04-21 21:55 ` Andrew Morton
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2010-04-21 21:55 UTC (permalink / raw)
  To: axel.lin; +Cc: linux-kernel, Eric Miao

On Mon, 12 Apr 2010 15:29:16 +0800
Axel Lin <axel.lin@gmail.com> wrote:

> Setup both client_group_a and client_group_b if nr_port > 8 (not
> including nr_port==8).
> 

OK, that's what the patch does.  But why does it do it?

In other words, when fixing a bug, please include a description of that
bug!  And, if it's not obvious from the description, please also describe
the user-visible effects of that bug.  So the poor schmuck at the other
end (ie: me) can work out which kernel(s) the fix should be merged
into.

> 
> diff --git a/drivers/gpio/max732x.c b/drivers/gpio/max732x.c
> index f786824..51b02c6 100644
> --- a/drivers/gpio/max732x.c
> +++ b/drivers/gpio/max732x.c
> @@ -285,14 +285,14 @@ static int __devinit max732x_probe(struct
> i2c_client *client,

The patch is wordwrapped.

>         switch (client->addr & 0x70) {
>         case 0x60:
>                 chip->client_group_a = client;
> -               if (nr_port > 7) {
> +               if (nr_port > 8) {

And has its tabs replaced with spaces.  sorry-youre-using-gmail.

Please see if you can get that fixed up for next time
(Documentation/email-clients.txt has some tips).  Worst-case, use
text/plain attachments.

Thanks.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-04-21 21:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-12  7:29 [PATCH] max732x: Correct nr_port checking off by one error Axel Lin
2010-04-21 21:55 ` Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.