Hi, A total of 27 ERRORs are found when scanning all files in the drivers/spi directory by checkpatch tool. This series fixes 21 ERRORs of them, and the remaining 6 ERRORs I don't think need to be fixed. No functional change. Thanks, Jay Jay Fang (11): spi: spi-topcliff-pch: Fix checkpatch spacing error spi: sprd: Fix checkpatch spacing error spi: pxa2xx: Fix checkpatch spacing errors spi: omap-100k: Fix checkpatch spacing errors spi: spi-mtk-nor: Fix checkpatch spacing error spi: dln2: Fix open brace following function definitions go on the next line spi: spi-bitbang: Fix open brace following function definitions go on the next line spi: jcore: Fix trailing statements should be on next line spi: spi-mem: Fix code indent should use tabs where possible spi: rockchip: Fix code indent should use tabs where possible spi: pl022: Fix trailing whitespace drivers/spi/spi-bitbang.c | 9 ++++++--- drivers/spi/spi-dln2.c | 3 ++- drivers/spi/spi-jcore.c | 3 ++- drivers/spi/spi-mem.c | 6 +++--- drivers/spi/spi-mtk-nor.c | 2 +- drivers/spi/spi-omap-100k.c | 8 ++++---- drivers/spi/spi-pl022.c | 2 +- drivers/spi/spi-pxa2xx-pci.c | 2 +- drivers/spi/spi-pxa2xx.c | 2 +- drivers/spi/spi-rockchip.c | 6 +++--- drivers/spi/spi-sprd-adi.c | 2 +- drivers/spi/spi-topcliff-pch.c | 3 ++- 12 files changed, 27 insertions(+), 21 deletions(-) -- 2.7.4
Fix checkpatch error: ERROR: space prohibited before that '++' (ctx:WxB) #1204: FILE: spi-topcliff-pch.c:1204: + for (i = 0; i < cnt; i ++) { ^ Signed-off-by: Jay Fang <f.fangjian@huawei.com> --- drivers/spi/spi-topcliff-pch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-topcliff-pch.c b/drivers/spi/spi-topcliff-pch.c index b459e36..b887078 100644 --- a/drivers/spi/spi-topcliff-pch.c +++ b/drivers/spi/spi-topcliff-pch.c @@ -1201,7 +1201,8 @@ static void pch_spi_process_messages(struct work_struct *pwork) if (data->use_dma) { int i; char *save_rx_buf = data->cur_trans->rx_buf; - for (i = 0; i < cnt; i ++) { + + for (i = 0; i < cnt; i++) { pch_spi_handle_dma(data, &bpw); if (!pch_spi_start_transfer(data)) { data->transfer_complete = true; -- 2.7.4
Fix checkpatch error: ERROR: space prohibited before that close parenthesis ')' #213: FILE: spi-sprd-adi.c:213: + rd_addr = (val & RD_ADDR_MASK ) >> RD_ADDR_SHIFT; Signed-off-by: Jay Fang <f.fangjian@huawei.com> --- drivers/spi/spi-sprd-adi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-sprd-adi.c b/drivers/spi/spi-sprd-adi.c index 392ec5c..ab19068 100644 --- a/drivers/spi/spi-sprd-adi.c +++ b/drivers/spi/spi-sprd-adi.c @@ -210,7 +210,7 @@ static int sprd_adi_read(struct sprd_adi *sadi, u32 reg_paddr, u32 *read_val) * address. Then we can check the returned register address to validate * data. */ - rd_addr = (val & RD_ADDR_MASK ) >> RD_ADDR_SHIFT; + rd_addr = (val & RD_ADDR_MASK) >> RD_ADDR_SHIFT; if (rd_addr != (reg_paddr & REG_ADDR_LOW_MASK)) { dev_err(sadi->dev, "read error, reg addr = 0x%x, val = 0x%x\n", -- 2.7.4
Fix checkpatch errors: ERROR: space prohibited before that ',' (ctx:WxW) #255: FILE: spi-pxa2xx-pci.c:255: + ssp->clk = clk_register_fixed_rate(&dev->dev, buf , NULL, 0, ^ ERROR: "foo* bar" should be "foo *bar" #621: FILE: spi-pxa2xx.c:621: +static void int_error_stop(struct driver_data *drv_data, const char* msg) Signed-off-by: Jay Fang <f.fangjian@huawei.com> --- drivers/spi/spi-pxa2xx-pci.c | 2 +- drivers/spi/spi-pxa2xx.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-pxa2xx-pci.c b/drivers/spi/spi-pxa2xx-pci.c index 14fc41e..1833f58 100644 --- a/drivers/spi/spi-pxa2xx-pci.c +++ b/drivers/spi/spi-pxa2xx-pci.c @@ -252,7 +252,7 @@ static int pxa2xx_spi_pci_probe(struct pci_dev *dev, ssp->irq = pci_irq_vector(dev, 0); snprintf(buf, sizeof(buf), "pxa2xx-spi.%d", ssp->port_id); - ssp->clk = clk_register_fixed_rate(&dev->dev, buf , NULL, 0, + ssp->clk = clk_register_fixed_rate(&dev->dev, buf, NULL, 0, c->max_clk_rate); if (IS_ERR(ssp->clk)) return PTR_ERR(ssp->clk); diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index 0cc7672..b83f325f 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -618,7 +618,7 @@ static void reset_sccr1(struct driver_data *drv_data) pxa2xx_spi_write(drv_data, SSCR1, sccr1_reg); } -static void int_error_stop(struct driver_data *drv_data, const char* msg) +static void int_error_stop(struct driver_data *drv_data, const char *msg) { /* Stop and reset SSP */ write_SSSR_CS(drv_data, drv_data->clear_sr); -- 2.7.4
Fix checkpatch errors: ERROR: space prohibited before that ',' (ctx:WxW) #113: FILE: spi-omap-100k.c:113: + writew(data , spi100k->base + SPI_TX_MSB); ^ ERROR: space prohibited before that ',' (ctx:WxW) #249: FILE: spi-omap-100k.c:249: + writew(0x3e , spi100k->base + SPI_SETUP1); ^ ERROR: space prohibited before that ',' (ctx:WxW) #250: FILE: spi-omap-100k.c:250: + writew(0x00 , spi100k->base + SPI_STATUS); ^ ERROR: space prohibited before that ',' (ctx:WxW) #251: FILE: spi-omap-100k.c:251: + writew(0x3e , spi100k->base + SPI_CTRL); ^ Signed-off-by: Jay Fang <f.fangjian@huawei.com> --- drivers/spi/spi-omap-100k.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-omap-100k.c b/drivers/spi/spi-omap-100k.c index 36a4922..189fd2d 100644 --- a/drivers/spi/spi-omap-100k.c +++ b/drivers/spi/spi-omap-100k.c @@ -110,7 +110,7 @@ static void spi100k_write_data(struct spi_master *master, int len, int data) } spi100k_enable_clock(master); - writew(data , spi100k->base + SPI_TX_MSB); + writew(data, spi100k->base + SPI_TX_MSB); writew(SPI_CTRL_SEN(0) | SPI_CTRL_WORD_SIZE(len) | @@ -246,9 +246,9 @@ static int omap1_spi100k_setup_transfer(struct spi_device *spi, cs->word_len = word_len; /* SPI init before transfer */ - writew(0x3e , spi100k->base + SPI_SETUP1); - writew(0x00 , spi100k->base + SPI_STATUS); - writew(0x3e , spi100k->base + SPI_CTRL); + writew(0x3e, spi100k->base + SPI_SETUP1); + writew(0x00, spi100k->base + SPI_STATUS); + writew(0x3e, spi100k->base + SPI_CTRL); return 0; } -- 2.7.4
Fix checkpatch error: ERROR: space required before the open parenthesis '(' #295: FILE: spi-mtk-nor.c:295: + switch(op->data.dir) { Signed-off-by: Jay Fang <f.fangjian@huawei.com> --- drivers/spi/spi-mtk-nor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-mtk-nor.c b/drivers/spi/spi-mtk-nor.c index 2e2f36a..41e7b34 100644 --- a/drivers/spi/spi-mtk-nor.c +++ b/drivers/spi/spi-mtk-nor.c @@ -292,7 +292,7 @@ static bool mtk_nor_supports_op(struct spi_mem *mem, return false; if ((op->addr.nbytes == 3) || (op->addr.nbytes == 4)) { - switch(op->data.dir) { + switch (op->data.dir) { case SPI_MEM_DATA_IN: if (mtk_nor_match_read(op)) return true; -- 2.7.4
Fix checkpatch error: ERROR: open brace '{' following function definitions go on the next line #545: FILE: spi-dln2.c:545: +static int dln2_spi_rdwr(struct dln2_spi *dln2, const u8 *tx_data, + u8 *rx_data, u16 data_len, u8 attr) { Signed-off-by: Jay Fang <f.fangjian@huawei.com> --- drivers/spi/spi-dln2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-dln2.c b/drivers/spi/spi-dln2.c index 75b33d7..3902ead 100644 --- a/drivers/spi/spi-dln2.c +++ b/drivers/spi/spi-dln2.c @@ -543,7 +543,8 @@ static int dln2_spi_read_write_one(struct dln2_spi *dln2, const u8 *tx_data, * single ones due to device buffer constraints. */ static int dln2_spi_rdwr(struct dln2_spi *dln2, const u8 *tx_data, - u8 *rx_data, u16 data_len, u8 attr) { + u8 *rx_data, u16 data_len, u8 attr) +{ int ret; u16 len; u8 temp_attr; -- 2.7.4
Fix checkpatch errors: ERROR: open brace '{' following function definitions go on the next line #54: FILE: spi-bitbang.c:54: ERROR: open brace '{' following function definitions go on the next line #82: FILE: spi-bitbang.c:82: ERROR: open brace '{' following function definitions go on the next line #110: FILE: spi-bitbang.c:110: Signed-off-by: Jay Fang <f.fangjian@huawei.com> --- drivers/spi/spi-bitbang.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-bitbang.c b/drivers/spi/spi-bitbang.c index 1a7352a..6a6af85 100644 --- a/drivers/spi/spi-bitbang.c +++ b/drivers/spi/spi-bitbang.c @@ -60,7 +60,8 @@ static unsigned bitbang_txrx_8( unsigned ns, struct spi_transfer *t, unsigned flags -) { +) +{ unsigned bits = t->bits_per_word; unsigned count = t->len; const u8 *tx = t->tx_buf; @@ -88,7 +89,8 @@ static unsigned bitbang_txrx_16( unsigned ns, struct spi_transfer *t, unsigned flags -) { +) +{ unsigned bits = t->bits_per_word; unsigned count = t->len; const u16 *tx = t->tx_buf; @@ -116,7 +118,8 @@ static unsigned bitbang_txrx_32( unsigned ns, struct spi_transfer *t, unsigned flags -) { +) +{ unsigned bits = t->bits_per_word; unsigned count = t->len; const u32 *tx = t->tx_buf; -- 2.7.4
Fix checkpatch error: ERROR: trailing statements should be on next line #85: FILE: spi-jcore.c:85: + if (speed == hw->speed_hz) return; Signed-off-by: Jay Fang <f.fangjian@huawei.com> --- drivers/spi/spi-jcore.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-jcore.c b/drivers/spi/spi-jcore.c index bba10f0..74c8319 100644 --- a/drivers/spi/spi-jcore.c +++ b/drivers/spi/spi-jcore.c @@ -82,7 +82,8 @@ static void jcore_spi_chipsel(struct spi_device *spi, bool value) static void jcore_spi_baudrate(struct jcore_spi *hw, int speed) { - if (speed == hw->speed_hz) return; + if (speed == hw->speed_hz) + return; hw->speed_hz = speed; if (speed >= hw->clock_freq / 2) hw->speed_reg = 0; -- 2.7.4
Fix checkpatch errors: ERROR: code indent should use tabs where possible #624: FILE: spi-mem.c:624: ERROR: code indent should use tabs where possible #626: FILE: spi-mem.c:626: ERROR: code indent should use tabs where possible #627: FILE: spi-mem.c:627: Signed-off-by: Jay Fang <f.fangjian@huawei.com> --- drivers/spi/spi-mem.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c index dc713b0..1513553e 100644 --- a/drivers/spi/spi-mem.c +++ b/drivers/spi/spi-mem.c @@ -621,10 +621,10 @@ EXPORT_SYMBOL_GPL(devm_spi_mem_dirmap_create); static int devm_spi_mem_dirmap_match(struct device *dev, void *res, void *data) { - struct spi_mem_dirmap_desc **ptr = res; + struct spi_mem_dirmap_desc **ptr = res; - if (WARN_ON(!ptr || !*ptr)) - return 0; + if (WARN_ON(!ptr || !*ptr)) + return 0; return *ptr == data; } -- 2.7.4
Fix checkpatch errors: ERROR: code indent should use tabs where possible #484: FILE: spi-rockchip.c:484: +^I | CR0_BHT_8BIT << CR0_BHT_OFFSET$ ERROR: code indent should use tabs where possible #485: FILE: spi-rockchip.c:485: +^I | CR0_SSD_ONE << CR0_SSD_OFFSET$ ERROR: code indent should use tabs where possible #486: FILE: spi-rockchip.c:486: +^I | CR0_EM_BIG << CR0_EM_OFFSET;$ Signed-off-by: Jay Fang <f.fangjian@huawei.com> --- drivers/spi/spi-rockchip.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c index 936ef54..e6bc9c2 100644 --- a/drivers/spi/spi-rockchip.c +++ b/drivers/spi/spi-rockchip.c @@ -481,9 +481,9 @@ static void rockchip_spi_config(struct rockchip_spi *rs, bool use_dma, bool slave_mode) { u32 cr0 = CR0_FRF_SPI << CR0_FRF_OFFSET - | CR0_BHT_8BIT << CR0_BHT_OFFSET - | CR0_SSD_ONE << CR0_SSD_OFFSET - | CR0_EM_BIG << CR0_EM_OFFSET; + | CR0_BHT_8BIT << CR0_BHT_OFFSET + | CR0_SSD_ONE << CR0_SSD_OFFSET + | CR0_EM_BIG << CR0_EM_OFFSET; u32 cr1; u32 dmacr = 0; -- 2.7.4
Fix checkpatch error: ERROR: trailing whitespace #1198: FILE: spi-pl022.c:1198: Signed-off-by: Jay Fang <f.fangjian@huawei.com> --- drivers/spi/spi-pl022.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c index fd74ddf..d7ed188 100644 --- a/drivers/spi/spi-pl022.c +++ b/drivers/spi/spi-pl022.c @@ -1195,7 +1195,7 @@ static int pl022_dma_autoprobe(struct pl022 *pl022) err_no_rxchan: return err; } - + static void terminate_dma(struct pl022 *pl022) { struct dma_chan *rxchan = pl022->dma_rx_channel; -- 2.7.4
On Wed, 24 Mar 2021 14:16:31 +0800, Jay Fang wrote: > A total of 27 ERRORs are found when scanning all files in the drivers/spi > directory by checkpatch tool. This series fixes 21 ERRORs of them, and the > remaining 6 ERRORs I don't think need to be fixed. > > No functional change. > > > [...] Applied to https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next Thanks! [01/11] spi: spi-topcliff-pch: Fix checkpatch spacing error commit: c9831087356b7ae02dfb22b3121117c48aa9e95b [02/11] spi: sprd: Fix checkpatch spacing error commit: e13a870ffaa60f459892eb4600a286b4db7da5ad [03/11] spi: pxa2xx: Fix checkpatch spacing errors commit: c07caca3cea90332e410ba3e53bc264ae1f2c9c9 [04/11] spi: omap-100k: Fix checkpatch spacing errors commit: f2edb98e806d0bf7947e5da352d69f4fbb063b04 [05/11] spi: spi-mtk-nor: Fix checkpatch spacing error commit: 99b3a36204564cb689cd862794043e1b8f5863b1 [06/11] spi: dln2: Fix open brace following function definitions go on the next line commit: 211f8a0a39cd7dcd9c14744053ea681a0e7eb36d [07/11] spi: spi-bitbang: Fix open brace following function definitions go on the next line commit: f96c19fab393db16a2db78183ca8f584ee1b716a [08/11] spi: jcore: Fix trailing statements should be on next line commit: 45793de7bf89fbd0fd1e2db9dda4e58a9c1395ee [09/11] spi: spi-mem: Fix code indent should use tabs where possible commit: 6ca6ad908e965b1b01c31618971a1de7b6307a21 [10/11] spi: rockchip: Fix code indent should use tabs where possible commit: 02621799966babf50d1d1dc523e834366904b55d [11/11] spi: pl022: Fix trailing whitespace commit: 9d5376872162dc70c16ae8379dba0266f35883f9 All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark