mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guennadi Liakhovetski <g.liakhovetski@pengutronix.de>
To: linux-kernel@vger.kernel.org
Cc: dbrownell@users.sourceforge.net
Subject: [PATCH] spi: two bug-fixes
Date: Wed, 4 Jun 2008 17:11:14 +0200 (CEST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0806041705430.32657@axis700.grange> (raw)

Two SPI-related fixes: unsigned int cannot be less than zero, and the list
search success check is wrong: for example, it didn't recognise failure for me
when I requested port 0.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@pengutronix.de>

---

It might be a good idea to get it in for 2.6.26. As a side note I was 
surprised, that the compiler didn't generate a warning for "if (t<0)" for 
unsigned t, whereas it does generate one for unsigned char with the same 
flags (-Wall). I asked on gcc, there was one reply from Segher 
Boessenkool, it is unclear if this is going to be recognised as a bug or 
not: http://gcc.gnu.org/ml/gcc/2008-06/threads.html#00044

 arch/arm/mach-pxa/ssp.c |    2 +-
 drivers/gpio/mcp23s08.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Index: linux-2.6/drivers/gpio/mcp23s08.c
===================================================================
--- linux-2.6.orig/drivers/gpio/mcp23s08.c	2008-06-04 12:11:26.000000000 +0200
+++ linux-2.6/drivers/gpio/mcp23s08.c	2008-06-04 12:11:50.000000000 +0200
@@ -178,7 +178,7 @@
 
 	mutex_lock(&mcp->lock);
 	t = mcp23s08_read_regs(mcp, 0, mcp->cache, sizeof mcp->cache);
-	if (t < 0) {
+	if ((int)t < 0) {
 		seq_printf(s, " I/O ERROR %d\n", t);
 		goto done;
 	}
Index: linux-2.6/arch/arm/mach-pxa/ssp.c
===================================================================
--- linux-2.6.orig/arch/arm/mach-pxa/ssp.c	2008-06-04 12:11:26.000000000 +0200
+++ linux-2.6/arch/arm/mach-pxa/ssp.c	2008-06-04 12:11:50.000000000 +0200
@@ -330,7 +330,7 @@
 
 	mutex_unlock(&ssp_lock);
 
-	if (ssp->port_id != port)
+	if (&ssp->node == &ssp_list)
 		return NULL;
 
 	return ssp;


             reply	other threads:[~2008-06-04 15:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-04 15:11 Guennadi Liakhovetski [this message]
2008-06-04 15:31 ` Adrian Bunk
2008-06-04 15:41   ` Guennadi Liakhovetski
2008-06-04 19:51     ` David Brownell

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=Pine.LNX.4.64.0806041705430.32657@axis700.grange \
    --to=g.liakhovetski@pengutronix.de \
    --cc=dbrownell@users.sourceforge.net \
    --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

all inboxes | Powered by JetHome®