From: Andrew Morton WARNING: line over 80 characters #124: FILE: drivers/gpio/max7301.c:76: +static int max7301_write(struct spi_device *spi, unsigned int reg, unsigned int val) ERROR: "(foo*)" should be "(foo *)" #127: FILE: drivers/gpio/max7301.c:79: + return spi_write(spi, (const u8*)&word, sizeof(word)); ERROR: "(foo*)" should be "(foo *)" #146: FILE: drivers/gpio/max7301.c:98: + if ((ret = spi_write(spi, (const u8*)&word, sizeof(word))) != 0) ERROR: do not use assignment in if condition #146: FILE: drivers/gpio/max7301.c:98: + if ((ret = spi_write(spi, (const u8*)&word, sizeof(word))) != 0) ERROR: "(foo*)" should be "(foo *)" #151: FILE: drivers/gpio/max7301.c:103: + if ((ret = spi_read(spi, (u8*)&word, sizeof(word)))) ERROR: do not use assignment in if condition #151: FILE: drivers/gpio/max7301.c:103: + if ((ret = spi_read(spi, (u8*)&word, sizeof(word)))) WARNING: line over 80 characters #352: FILE: drivers/gpio/max7301.c:304: + dev_err(&spi->dev, "Failed to remove the GPIO controller: %d\n", ret); total: 5 errors, 2 warnings, 361 lines checked ./patches/gpio-gpio-driver-for-max7301-spi-gpio-expander.patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS. Please run checkpatch prior to sending patches Cc: David Brownell Cc: Guennadi Liakhovetski Cc: Juergen Beisert Signed-off-by: Andrew Morton --- drivers/gpio/max7301.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff -puN drivers/gpio/max7301.c~gpio-gpio-driver-for-max7301-spi-gpio-expander-checkpatch-fixes drivers/gpio/max7301.c --- a/drivers/gpio/max7301.c~gpio-gpio-driver-for-max7301-spi-gpio-expander-checkpatch-fixes +++ a/drivers/gpio/max7301.c @@ -76,7 +76,7 @@ struct max7301 { static int max7301_write(struct spi_device *spi, unsigned int reg, unsigned int val) { u16 word = ((reg & 0x7F) << 8) | (val & 0xFF); - return spi_write(spi, (const u8*)&word, sizeof(word)); + return spi_write(spi, (const u8 *)&word, sizeof(word)); } /** @@ -95,12 +95,14 @@ static int max7301_read(struct spi_devic u16 word; word = 0x8000 | (reg << 8); - if ((ret = spi_write(spi, (const u8*)&word, sizeof(word))) != 0) + ret = spi_write(spi, (const u8 *)&word, sizeof(word)); + if (ret) return ret; /* * FIXME: This read should write 0x0000 (=NOOP at MAX7301 side) */ - if ((ret = spi_read(spi, (u8*)&word, sizeof(word)))) + ret = spi_read(spi, (u8 *)&word, sizeof(word)); + if (ret) return ret; return word; } @@ -301,7 +303,8 @@ static int max7301_remove(struct spi_dev mutex_destroy(&ts->lock); kfree(ts); } else - dev_err(&spi->dev, "Failed to remove the GPIO controller: %d\n", ret); + dev_err(&spi->dev, "Failed to remove the GPIO controller: %d\n", + ret); return ret; } _