forked from Minki/linux
spi: Fix checkpatch issue
Fix the following checkpatch error and warnings. ERROR: space required after that ',' (ctx:VxV) WARNING: quoted string split across lines WARNING: max() should probably be max_t(int, nb, master->num_chipselect) WARNING: sizeof *spi should be sizeof(*spi) WARNING: sizeof *master should be sizeof(*master) WARNING: sizeof x should be sizeof(x) Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Mark Brown <broonie@linaro.org>
This commit is contained in:
parent
aa7da564ca
commit
5fe5f05e22
@ -325,7 +325,7 @@ struct spi_device *spi_alloc_device(struct spi_master *master)
|
|||||||
if (!spi_master_get(master))
|
if (!spi_master_get(master))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
spi = kzalloc(sizeof *spi, GFP_KERNEL);
|
spi = kzalloc(sizeof(*spi), GFP_KERNEL);
|
||||||
if (!spi) {
|
if (!spi) {
|
||||||
dev_err(dev, "cannot alloc spi_device\n");
|
dev_err(dev, "cannot alloc spi_device\n");
|
||||||
spi_master_put(master);
|
spi_master_put(master);
|
||||||
@ -1093,7 +1093,7 @@ struct spi_master *spi_alloc_master(struct device *dev, unsigned size)
|
|||||||
if (!dev)
|
if (!dev)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
master = kzalloc(size + sizeof *master, GFP_KERNEL);
|
master = kzalloc(size + sizeof(*master), GFP_KERNEL);
|
||||||
if (!master)
|
if (!master)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
@ -1118,7 +1118,7 @@ static int of_spi_register_master(struct spi_master *master)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
nb = of_gpio_named_count(np, "cs-gpios");
|
nb = of_gpio_named_count(np, "cs-gpios");
|
||||||
master->num_chipselect = max(nb, (int)master->num_chipselect);
|
master->num_chipselect = max_t(int, nb, master->num_chipselect);
|
||||||
|
|
||||||
/* Return error only for an incorrectly formed cs-gpios property */
|
/* Return error only for an incorrectly formed cs-gpios property */
|
||||||
if (nb == 0 || nb == -ENOENT)
|
if (nb == 0 || nb == -ENOENT)
|
||||||
@ -1398,8 +1398,7 @@ int spi_setup(struct spi_device *spi)
|
|||||||
if (spi->master->setup)
|
if (spi->master->setup)
|
||||||
status = spi->master->setup(spi);
|
status = spi->master->setup(spi);
|
||||||
|
|
||||||
dev_dbg(&spi->dev, "setup mode %d, %s%s%s%s"
|
dev_dbg(&spi->dev, "setup mode %d, %s%s%s%s%u bits/w, %u Hz max --> %d\n",
|
||||||
"%u bits/w, %u Hz max --> %d\n",
|
|
||||||
(int) (spi->mode & (SPI_CPOL | SPI_CPHA)),
|
(int) (spi->mode & (SPI_CPOL | SPI_CPHA)),
|
||||||
(spi->mode & SPI_CS_HIGH) ? "cs_high, " : "",
|
(spi->mode & SPI_CS_HIGH) ? "cs_high, " : "",
|
||||||
(spi->mode & SPI_LSB_FIRST) ? "lsb, " : "",
|
(spi->mode & SPI_LSB_FIRST) ? "lsb, " : "",
|
||||||
@ -1758,7 +1757,7 @@ int spi_bus_unlock(struct spi_master *master)
|
|||||||
EXPORT_SYMBOL_GPL(spi_bus_unlock);
|
EXPORT_SYMBOL_GPL(spi_bus_unlock);
|
||||||
|
|
||||||
/* portable code must never pass more than 32 bytes */
|
/* portable code must never pass more than 32 bytes */
|
||||||
#define SPI_BUFSIZ max(32,SMP_CACHE_BYTES)
|
#define SPI_BUFSIZ max(32, SMP_CACHE_BYTES)
|
||||||
|
|
||||||
static u8 *buf;
|
static u8 *buf;
|
||||||
|
|
||||||
@ -1807,7 +1806,7 @@ int spi_write_then_read(struct spi_device *spi,
|
|||||||
}
|
}
|
||||||
|
|
||||||
spi_message_init(&message);
|
spi_message_init(&message);
|
||||||
memset(x, 0, sizeof x);
|
memset(x, 0, sizeof(x));
|
||||||
if (n_tx) {
|
if (n_tx) {
|
||||||
x[0].len = n_tx;
|
x[0].len = n_tx;
|
||||||
spi_message_add_tail(&x[0], &message);
|
spi_message_add_tail(&x[0], &message);
|
||||||
|
Loading…
Reference in New Issue
Block a user