mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Randy Dunlap <rdunlap@xenotime.net>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	rpurdie@rpsys.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] leds-tca6507: allow driver to compile when GPIOLIB is not available.
Date: Wed, 21 Dec 2011 08:03:00 +1100	[thread overview]
Message-ID: <20111221080300.02cb8a45@notabene.brown> (raw)
In-Reply-To: <4EF0EF8B.1030904@xenotime.net>

[-- Attachment #1: Type: text/plain, Size: 1428 bytes --]

On Tue, 20 Dec 2011 12:26:51 -0800 Randy Dunlap <rdunlap@xenotime.net> wrote:

> On 12/20/2011 12:16 PM, Randy Dunlap wrote:
> > On 12/19/2011 09:44 PM, NeilBrown wrote:
> >> This driver can configure the outputs as GPIO line instead of LEDs.  But
> >> that only works if GPIOLIB is available.  So make that code conditional
> >> on the library's availability.
> >>
> >> Also remove the 'teardown' callback as it is never called and should
> >> never be needed.
> >>
> >> Signed-off-by: NeilBrown <neilb@suse.de>
> > 
> > Thanks.  This builds.
> > 
> > Acked-by: Randy Dunlap <rdunlap@xenotime.net>
> 
> Neil,
> You might want to check this also:
> 
> drivers/leds/leds-tca6507.c:358:17: warning: array subscript is above array bounds
> drivers/leds/leds-tca6507.c:357:17: warning: array subscript is above array bounds
> 
> 

Argh..

diff --git a/drivers/leds/leds-tca6507.c b/drivers/leds/leds-tca6507.c
index 75dc5e4..ce20ab7 100644
--- a/drivers/leds/leds-tca6507.c
+++ b/drivers/leds/leds-tca6507.c
@@ -349,7 +349,7 @@ static int led_prepare(struct tca6507_led *led)
 			return 0;
 		}
 
-		for (i = MASTER; i >= BANK0; i++) {
+		for (i = MASTER; i >= BANK0; i--) {
 			int d;
 			if (tca->bank[i].level == level ||
 			    tca->bank[i].level_use == 0) {

That loop used to go up..

I might just go an re-review all the code.  And repeat the tests.

Thanks a lot.

NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

  reply	other threads:[~2011-12-20 21:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-20  5:44 [PATCH 0/2] Two fixes for leds-tca6507 - Version 2 NeilBrown
2011-12-20  5:44 ` [PATCH 2/2] leds-tca6507 - fix off by one error NeilBrown
2011-12-20  5:44 ` [PATCH 1/2] leds-tca6507: allow driver to compile when GPIOLIB is not available NeilBrown
2011-12-20 20:16   ` Randy Dunlap
2011-12-20 20:26     ` Randy Dunlap
2011-12-20 21:03       ` NeilBrown [this message]
2011-12-20 22:23         ` Andrew Morton
2011-12-30  0:35           ` NeilBrown
  -- strict thread matches above, loose matches on Subject: below --
2011-12-19  0:20 [PATCH 0/2] Two fixes for leds-tca6507 NeilBrown
2011-12-19  0:20 ` [PATCH 1/2] leds-tca6507: allow driver to compile when GPIOLIB is not available NeilBrown
2011-12-19 20:34   ` Randy Dunlap
2011-12-20  5:37     ` NeilBrown

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=20111221080300.02cb8a45@notabene.brown \
    --to=neilb@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdunlap@xenotime.net \
    --cc=rpurdie@rpsys.net \
    /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