On Wednesday 10 September 2008, Peter Korsgaard wrote:
> It would indeed be clearer to change it to to return -errno on errors
> instead, but the problem my patch solves is real (crash on too small
> message lengths) and I wanted to keep the patch to it's minimum now
> that we're so close to 2.6.27.
>
> But I can change it to use return -EINVAL instead if you prefer - The
> caller doesn't care as long as it's != 0.
>
> Then we can do the real cleanup later and push it for 2.6.28.
OK, I was thinking this minimal tweak to your patch. It adds only
one more patch segment, and makes the routine obey stndard kernel
calling conventions ... still a small patch. :)
--- g26.orig/drivers/spi/spi_mpc83xx.c 2008-09-10 14:03:03.000000000 -0700
+++ g26/drivers/spi/spi_mpc83xx.c 2008-09-10 10:27:23.000000000 -0700
@@ -315,13 +315,13 @@ static int mpc83xx_spi_bufs(struct spi_d
if (bits_per_word > 8) {
/* invalid length? */
if (len & 1)
- return len;
+ return -EINVAL;
len /= 2;
}
if (bits_per_word > 16) {
/* invalid length? */
if (len & 1)
- return len;
+ return -EINVAL;
len /= 2;
}
mpc83xx_spi->count = len;
@@ -340,7 +340,7 @@ static int mpc83xx_spi_bufs(struct spi_d
/* disable rx ints */
mpc83xx_spi_write_reg(&mpc83xx_spi->base->mask, 0);
- return mpc83xx_spi->count;
+ return 0;
}
static void mpc83xx_spi_work(struct work_struct *work)
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
spi-devel-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/spi-devel-general