spi: Don't break user-visible strings to multiple source lines in drivers
authorJarkko Nikula <jarkko.nikula@linux.intel.com>
Fri, 11 Oct 2013 10:54:00 +0000 (13:54 +0300)
committerMark Brown <broonie@linaro.org>
Wed, 16 Oct 2013 18:07:15 +0000 (19:07 +0100)
User-visible strings are more difficult to grep from sources if they are
separated to multiple source lines. This is worse than over 80 columns long
line code style violation.

Fix this by making those to single-line strings or by breaking them between
variables.

While at there, convert if (printk_ratelimit()) dev_warn() to use
dev_warn_ratelimited in spi-pxa2xx.c.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/spi/spi-atmel.c
drivers/spi/spi-bfin5xx.c
drivers/spi/spi-dw.c
drivers/spi/spi-fsl-espi.c
drivers/spi/spi-mpc52xx-psc.c
drivers/spi/spi-pxa2xx.c
drivers/spi/spi-topcliff-pch.c

index d4ac60b4a56e8a6f4615fcac50015a06cccd53fc..fb61f59661d1ceee1062870af30296ff3bc7bf67 100644 (file)
@@ -1401,8 +1401,8 @@ static int atmel_spi_transfer(struct spi_device *spi, struct spi_message *msg)
                        asd = spi->controller_state;
                        bits = (asd->csr >> 4) & 0xf;
                        if (bits != xfer->bits_per_word - 8) {
-                               dev_dbg(&spi->dev, "you can't yet change "
-                                        "bits_per_word in transfers\n");
+                               dev_dbg(&spi->dev,
+                                       "you can't yet change bits_per_word in transfers\n");
                                return -ENOPROTOOPT;
                        }
                }
index 18b892e7455a6db477f5aafa1aa9cc2a821c50fc..b70a2bd9324d6f82ddb14affa32dd337c9f823ff 100644 (file)
@@ -913,8 +913,9 @@ static void bfin_spi_pump_messages(struct work_struct *work)
        drv_data->cur_transfer = list_entry(drv_data->cur_msg->transfers.next,
                                            struct spi_transfer, transfer_list);
 
-       dev_dbg(&drv_data->pdev->dev, "got a message to pump, "
-               "state is set to: baud %d, flag 0x%x, ctl 0x%x\n",
+       dev_dbg(&drv_data->pdev->dev,
+               "got a message to pump, state is set to: baud "
+               "%d, flag 0x%x, ctl 0x%x\n",
                drv_data->cur_chip->baud, drv_data->cur_chip->flag,
                drv_data->cur_chip->ctl_reg);
 
@@ -1013,8 +1014,8 @@ static int bfin_spi_setup(struct spi_device *spi)
                 * but let's assume (for now) they do.
                 */
                if (chip_info->ctl_reg & ~bfin_ctl_reg) {
-                       dev_err(&spi->dev, "do not set bits in ctl_reg "
-                               "that the SPI framework manages\n");
+                       dev_err(&spi->dev,
+                               "do not set bits in ctl_reg that the SPI framework manages\n");
                        goto error;
                }
                chip->enable_dma = chip_info->enable_dma != 0
@@ -1050,17 +1051,17 @@ static int bfin_spi_setup(struct spi_device *spi)
        chip->chip_select_num = spi->chip_select;
        if (chip->chip_select_num < MAX_CTRL_CS) {
                if (!(spi->mode & SPI_CPHA))
-                       dev_warn(&spi->dev, "Warning: SPI CPHA not set:"
-                               " Slave Select not under software control!\n"
-                               " See Documentation/blackfin/bfin-spi-notes.txt\n");
+                       dev_warn(&spi->dev,
+                               "Warning: SPI CPHA not set: Slave Select not under software control!\n"
+                               "See Documentation/blackfin/bfin-spi-notes.txt\n");
 
                chip->flag = (1 << spi->chip_select) << 8;
        } else
                chip->cs_gpio = chip->chip_select_num - MAX_CTRL_CS;
 
        if (chip->enable_dma && chip->pio_interrupt) {
-               dev_err(&spi->dev, "enable_dma is set, "
-                               "do not set pio_interrupt\n");
+               dev_err(&spi->dev,
+                       "enable_dma is set, do not set pio_interrupt\n");
                goto error;
        }
        /*
index 79c958e49f6110a33385d99b3116245028c6c264..b897c4adb39deda5f7e293d86216e74458ce912d 100644 (file)
@@ -870,8 +870,8 @@ void dw_spi_remove_host(struct dw_spi *dws)
        /* Remove the queue */
        status = destroy_queue(dws);
        if (status != 0)
-               dev_err(&dws->master->dev, "dw_spi_remove: workqueue will not "
-                       "complete, message memory not freed\n");
+               dev_err(&dws->master->dev,
+                       "dw_spi_remove: workqueue will not complete, message memory not freed\n");
 
        if (dws->dma_ops && dws->dma_ops->dma_exit)
                dws->dma_ops->dma_exit(dws);
index b8f1103fe28ee63a4d5209f5f88466fdc84255af..43222d7532d16b66ff790d48e7b5eb85231a1051 100644 (file)
@@ -289,8 +289,8 @@ static void fsl_espi_do_trans(struct spi_message *m,
                if ((first->bits_per_word != t->bits_per_word) ||
                        (first->speed_hz != t->speed_hz)) {
                        espi_trans->status = -EINVAL;
-                       dev_err(mspi->dev, "bits_per_word/speed_hz should be"
-                                       " same for the same SPI transfer\n");
+                       dev_err(mspi->dev,
+                               "bits_per_word/speed_hz should be same for the same SPI transfer\n");
                        return;
                }
 
index 6e925dc3439682344def5508f53d2ec6ec9175d6..00ba910ab3023a2587bc54a700e25e9f4a561438 100644 (file)
@@ -383,8 +383,8 @@ static int mpc52xx_psc_spi_do_probe(struct device *dev, u32 regaddr,
 
        mps->irq = irq;
        if (pdata == NULL) {
-               dev_warn(dev, "probe called without platform data, no "
-                               "cs_control function will be called\n");
+               dev_warn(dev,
+                        "probe called without platform data, no cs_control function will be called\n");
                mps->cs_control = NULL;
                mps->sysclk = 0;
                master->bus_num = bus_num;
index c1a50674c1e359deb3e83fc2a04c9acf2324f58d..64e1682c39b14e28520621515337230d6a30be0e 100644 (file)
@@ -573,8 +573,8 @@ static irqreturn_t ssp_int(int irq, void *dev_id)
                        write_SSTO(0, reg);
                write_SSSR_CS(drv_data, drv_data->clear_sr);
 
-               dev_err(&drv_data->pdev->dev, "bad message state "
-                       "in interrupt handler\n");
+               dev_err(&drv_data->pdev->dev,
+                       "bad message state in interrupt handler\n");
 
                /* Never fail */
                return IRQ_HANDLED;
@@ -651,8 +651,8 @@ static void pump_transfers(unsigned long data)
                if (message->is_dma_mapped
                                || transfer->rx_dma || transfer->tx_dma) {
                        dev_err(&drv_data->pdev->dev,
-                               "pump_transfers: mapped transfer length "
-                               "of %u is greater than %d\n",
+                               "pump_transfers: mapped transfer length of "
+                               "%u is greater than %d\n",
                                transfer->len, MAX_DMA_LEN);
                        message->status = -EINVAL;
                        giveback(drv_data);
@@ -660,11 +660,10 @@ static void pump_transfers(unsigned long data)
                }
 
                /* warn ... we force this to PIO mode */
-               if (printk_ratelimit())
-                       dev_warn(&message->spi->dev, "pump_transfers: "
-                               "DMA disabled for transfer length %ld "
-                               "greater than %d\n",
-                               (long)drv_data->len, MAX_DMA_LEN);
+               dev_warn_ratelimited(&message->spi->dev,
+                                    "pump_transfers: DMA disabled for transfer length %ld "
+                                    "greater than %d\n",
+                                    (long)drv_data->len, MAX_DMA_LEN);
        }
 
        /* Setup the transfer state based on the type of transfer */
@@ -726,11 +725,8 @@ static void pump_transfers(unsigned long data)
                                                        message->spi,
                                                        bits, &dma_burst,
                                                        &dma_thresh))
-                               if (printk_ratelimit())
-                                       dev_warn(&message->spi->dev,
-                                               "pump_transfers: "
-                                               "DMA burst size reduced to "
-                                               "match bits_per_word\n");
+                               dev_warn_ratelimited(&message->spi->dev,
+                                                    "pump_transfers: DMA burst size reduced to match bits_per_word\n");
                }
 
                cr0 = clk_div
@@ -854,8 +850,8 @@ static int setup_cs(struct spi_device *spi, struct chip_data *chip,
        if (gpio_is_valid(chip_info->gpio_cs)) {
                err = gpio_request(chip_info->gpio_cs, "SPI_CS");
                if (err) {
-                       dev_err(&spi->dev, "failed to request chip select "
-                                       "GPIO%d\n", chip_info->gpio_cs);
+                       dev_err(&spi->dev, "failed to request chip select GPIO%d\n",
+                               chip_info->gpio_cs);
                        return err;
                }
 
@@ -899,8 +895,8 @@ static int setup(struct spi_device *spi)
 
                if (drv_data->ssp_type == CE4100_SSP) {
                        if (spi->chip_select > 4) {
-                               dev_err(&spi->dev, "failed setup: "
-                               "cs number must not be > 4.\n");
+                               dev_err(&spi->dev,
+                                       "failed setup: cs number must not be > 4.\n");
                                kfree(chip);
                                return -EINVAL;
                        }
@@ -956,8 +952,8 @@ static int setup(struct spi_device *spi)
                                                spi->bits_per_word,
                                                &chip->dma_burst_size,
                                                &chip->dma_threshold)) {
-                       dev_warn(&spi->dev, "in setup: DMA burst size reduced "
-                                       "to match bits_per_word\n");
+                       dev_warn(&spi->dev,
+                                "in setup: DMA burst size reduced to match bits_per_word\n");
                }
        }
 
index eaeeed51bbbfa1f6a315fd87a2cef72b5dd2c5d1..14843efaaf3ad15166ce7d64f9423dc6eafb3dbe 100644 (file)
@@ -506,8 +506,8 @@ static int pch_spi_transfer(struct spi_device *pspi, struct spi_message *pmsg)
                goto err_out;
        }
 
-       dev_dbg(&pspi->dev, "%s Transfer List not empty. "
-               "Transfer Speed is set.\n", __func__);
+       dev_dbg(&pspi->dev,
+               "%s Transfer List not empty. Transfer Speed is set.\n", __func__);
 
        spin_lock_irqsave(&data->lock, flags);
        /* validate Tx/Rx buffers and Transfer length */
@@ -526,8 +526,9 @@ static int pch_spi_transfer(struct spi_device *pspi, struct spi_message *pmsg)
                        goto err_return_spinlock;
                }
 
-               dev_dbg(&pspi->dev, "%s Tx/Rx buffer valid. Transfer length"
-                       " valid\n", __func__);
+               dev_dbg(&pspi->dev,
+                       "%s Tx/Rx buffer valid. Transfer length valid\n",
+                       __func__);
 
                /* if baud rate has been specified validate the same */
                if (transfer->speed_hz > PCH_MAX_BAUDRATE)
@@ -1181,8 +1182,8 @@ static void pch_spi_process_messages(struct work_struct *pwork)
        spin_lock(&data->lock);
        /* check if suspend has been initiated;if yes flush queue */
        if (data->board_dat->suspend_sts || (data->status == STATUS_EXITING)) {
-               dev_dbg(&data->master->dev, "%s suspend/remove initiated,"
-                       "flushing queue\n", __func__);
+               dev_dbg(&data->master->dev,
+                       "%s suspend/remove initiated, flushing queue\n", __func__);
                list_for_each_entry_safe(pmsg, tmp, data->queue.next, queue) {
                        pmsg->status = -EIO;