From cbfc90809862859a1df6a8b48c7b3c2ac48fdbcd Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 18 Oct 2016 17:44:12 -0200 Subject: [media] si470x: don't break long lines Due to the 80-cols restrictions, and latter due to checkpatch warnings, several strings were broken into multiple lines. This is not considered a good practice anymore, as it makes harder to grep for strings at the source code. As we're right now fixing other drivers due to KERN_CONT, we need to be able to identify what printk strings don't end with a "\n". It is a way easier to detect those if we don't break long lines. So, join those continuation lines. The patch was generated via the script below, and manually adjusted if needed. use Text::Tabs; while (<>) { if ($next ne "") { $c=$_; if ($c =~ /^\s+\"(.*)/) { $c2=$1; $next =~ s/\"\n$//; $n = expand($next); $funpos = index($n, '('); $pos = index($c2, '",'); if ($funpos && $pos > 0) { $s1 = substr $c2, 0, $pos + 2; $s2 = ' ' x ($funpos + 1) . substr $c2, $pos + 2; $s2 =~ s/^\s+//; $s2 = ' ' x ($funpos + 1) . $s2 if ($s2 ne ""); print unexpand("$next$s1\n"); print unexpand("$s2\n") if ($s2 ne ""); } else { print "$next$c2\n"; } $next=""; next; } else { print $next; } $next=""; } else { if (m/\"$/) { if (!m/\\n\"$/) { $next=$_; next; } } } print $_; } Signed-off-by: Mauro Carvalho Chehab --- drivers/media/radio/si470x/radio-si470x-i2c.c | 7 +++---- drivers/media/radio/si470x/radio-si470x-usb.c | 15 +++++++-------- 2 files changed, 10 insertions(+), 12 deletions(-) (limited to 'drivers/media/radio') diff --git a/drivers/media/radio/si470x/radio-si470x-i2c.c b/drivers/media/radio/si470x/radio-si470x-i2c.c index ee0470a3196b..9b81969d76b5 100644 --- a/drivers/media/radio/si470x/radio-si470x-i2c.c +++ b/drivers/media/radio/si470x/radio-si470x-i2c.c @@ -387,8 +387,8 @@ static int si470x_i2c_probe(struct i2c_client *client, radio->registers[DEVICEID], radio->registers[SI_CHIPID]); if ((radio->registers[SI_CHIPID] & SI_CHIPID_FIRMWARE) < RADIO_FW_VERSION) { dev_warn(&client->dev, - "This driver is known to work with " - "firmware version %hu,\n", RADIO_FW_VERSION); + "This driver is known to work with firmware version %hu,\n", + RADIO_FW_VERSION); dev_warn(&client->dev, "but the device has firmware version %hu.\n", radio->registers[SI_CHIPID] & SI_CHIPID_FIRMWARE); @@ -400,8 +400,7 @@ static int si470x_i2c_probe(struct i2c_client *client, dev_warn(&client->dev, "If you have some trouble using this driver,\n"); dev_warn(&client->dev, - "please report to V4L ML at " - "linux-media@vger.kernel.org\n"); + "please report to V4L ML at linux-media@vger.kernel.org\n"); } /* set initial frequency */ diff --git a/drivers/media/radio/si470x/radio-si470x-usb.c b/drivers/media/radio/si470x/radio-si470x-usb.c index 4b132c29f290..1add136d37a3 100644 --- a/drivers/media/radio/si470x/radio-si470x-usb.c +++ b/drivers/media/radio/si470x/radio-si470x-usb.c @@ -351,8 +351,8 @@ static int si470x_get_scratch_page_versions(struct si470x_device *radio) retval = si470x_get_report(radio, radio->usb_buf, SCRATCH_REPORT_SIZE); if (retval < 0) - dev_warn(&radio->intf->dev, "si470x_get_scratch: " - "si470x_get_report returned %d\n", retval); + dev_warn(&radio->intf->dev, "si470x_get_scratch: si470x_get_report returned %d\n", + retval); else { radio->software_version = radio->usb_buf[1]; radio->hardware_version = radio->usb_buf[2]; @@ -688,8 +688,8 @@ static int si470x_usb_driver_probe(struct usb_interface *intf, radio->registers[DEVICEID], radio->registers[SI_CHIPID]); if ((radio->registers[SI_CHIPID] & SI_CHIPID_FIRMWARE) < RADIO_FW_VERSION) { dev_warn(&intf->dev, - "This driver is known to work with " - "firmware version %hu,\n", RADIO_FW_VERSION); + "This driver is known to work with firmware version %hu,\n", + RADIO_FW_VERSION); dev_warn(&intf->dev, "but the device has firmware version %hu.\n", radio->registers[SI_CHIPID] & SI_CHIPID_FIRMWARE); @@ -705,8 +705,8 @@ static int si470x_usb_driver_probe(struct usb_interface *intf, radio->software_version, radio->hardware_version); if (radio->hardware_version < RADIO_HW_VERSION) { dev_warn(&intf->dev, - "This driver is known to work with " - "hardware version %hu,\n", RADIO_HW_VERSION); + "This driver is known to work with hardware version %hu,\n", + RADIO_HW_VERSION); dev_warn(&intf->dev, "but the device has hardware version %hu.\n", radio->hardware_version); @@ -718,8 +718,7 @@ static int si470x_usb_driver_probe(struct usb_interface *intf, dev_warn(&intf->dev, "If you have some trouble using this driver,\n"); dev_warn(&intf->dev, - "please report to V4L ML at " - "linux-media@vger.kernel.org\n"); + "please report to V4L ML at linux-media@vger.kernel.org\n"); } /* set led to connect state */ -- cgit v1.2.3 From 3c1e300966d7edc380e405b3ab70b6e3c813a121 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 18 Oct 2016 17:44:12 -0200 Subject: [media] si4713: don't break long lines Due to the 80-cols restrictions, and latter due to checkpatch warnings, several strings were broken into multiple lines. This is not considered a good practice anymore, as it makes harder to grep for strings at the source code. As we're right now fixing other drivers due to KERN_CONT, we need to be able to identify what printk strings don't end with a "\n". It is a way easier to detect those if we don't break long lines. So, join those continuation lines. The patch was generated via the script below, and manually adjusted if needed. use Text::Tabs; while (<>) { if ($next ne "") { $c=$_; if ($c =~ /^\s+\"(.*)/) { $c2=$1; $next =~ s/\"\n$//; $n = expand($next); $funpos = index($n, '('); $pos = index($c2, '",'); if ($funpos && $pos > 0) { $s1 = substr $c2, 0, $pos + 2; $s2 = ' ' x ($funpos + 1) . substr $c2, $pos + 2; $s2 =~ s/^\s+//; $s2 = ' ' x ($funpos + 1) . $s2 if ($s2 ne ""); print unexpand("$next$s1\n"); print unexpand("$s2\n") if ($s2 ne ""); } else { print "$next$c2\n"; } $next=""; next; } else { print $next; } $next=""; } else { if (m/\"$/) { if (!m/\\n\"$/) { $next=$_; next; } } } print $_; } Signed-off-by: Mauro Carvalho Chehab --- drivers/media/radio/si4713/si4713.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'drivers/media/radio') diff --git a/drivers/media/radio/si4713/si4713.c b/drivers/media/radio/si4713/si4713.c index 0b04b56571da..bc2a8b5442ae 100644 --- a/drivers/media/radio/si4713/si4713.c +++ b/drivers/media/radio/si4713/si4713.c @@ -716,9 +716,9 @@ static int si4713_tx_tune_status(struct si4713_device *sdev, u8 intack, *power = val[5]; *antcap = val[6]; *noise = val[7]; - v4l2_dbg(1, debug, &sdev->sd, "%s: response: %d x 10 kHz " - "(power %d, antcap %d, rnl %d)\n", __func__, - *frequency, *power, *antcap, *noise); + v4l2_dbg(1, debug, &sdev->sd, + "%s: response: %d x 10 kHz (power %d, antcap %d, rnl %d)\n", + __func__, *frequency, *power, *antcap, *noise); } return err; @@ -758,10 +758,9 @@ static int si4713_tx_rds_buff(struct si4713_device *sdev, u8 mode, u16 rdsb, v4l2_dbg(1, debug, &sdev->sd, "%s: status=0x%02x\n", __func__, val[0]); *cbleft = (s8)val[2] - val[3]; - v4l2_dbg(1, debug, &sdev->sd, "%s: response: interrupts" - " 0x%02x cb avail: %d cb used %d fifo avail" - " %d fifo used %d\n", __func__, val[1], - val[2], val[3], val[4], val[5]); + v4l2_dbg(1, debug, &sdev->sd, + "%s: response: interrupts 0x%02x cb avail: %d cb used %d fifo avail %d fifo used %d\n", + __func__, val[1], val[2], val[3], val[4], val[5]); } return err; -- cgit v1.2.3 From e84541f0fbf354e989caec58990ac9d543251433 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 18 Oct 2016 17:44:12 -0200 Subject: [media] wl128x: don't break long lines Due to the 80-cols restrictions, and latter due to checkpatch warnings, several strings were broken into multiple lines. This is not considered a good practice anymore, as it makes harder to grep for strings at the source code. As we're right now fixing other drivers due to KERN_CONT, we need to be able to identify what printk strings don't end with a "\n". It is a way easier to detect those if we don't break long lines. So, join those continuation lines. The patch was generated via the script below, and manually adjusted if needed. use Text::Tabs; while (<>) { if ($next ne "") { $c=$_; if ($c =~ /^\s+\"(.*)/) { $c2=$1; $next =~ s/\"\n$//; $n = expand($next); $funpos = index($n, '('); $pos = index($c2, '",'); if ($funpos && $pos > 0) { $s1 = substr $c2, 0, $pos + 2; $s2 = ' ' x ($funpos + 1) . substr $c2, $pos + 2; $s2 =~ s/^\s+//; $s2 = ' ' x ($funpos + 1) . $s2 if ($s2 ne ""); print unexpand("$next$s1\n"); print unexpand("$s2\n") if ($s2 ne ""); } else { print "$next$c2\n"; } $next=""; next; } else { print $next; } $next=""; } else { if (m/\"$/) { if (!m/\\n\"$/) { $next=$_; next; } } } print $_; } Signed-off-by: Mauro Carvalho Chehab --- drivers/media/radio/wl128x/fmdrv_common.c | 30 +++++++++++++----------------- drivers/media/radio/wl128x/fmdrv_rx.c | 8 ++++---- 2 files changed, 17 insertions(+), 21 deletions(-) (limited to 'drivers/media/radio') diff --git a/drivers/media/radio/wl128x/fmdrv_common.c b/drivers/media/radio/wl128x/fmdrv_common.c index 642b89c66bcb..6f254e80ffa6 100644 --- a/drivers/media/radio/wl128x/fmdrv_common.c +++ b/drivers/media/radio/wl128x/fmdrv_common.c @@ -230,10 +230,10 @@ inline void dump_rx_skb_data(struct sk_buff *skb) struct fm_event_msg_hdr *evt_hdr; evt_hdr = (struct fm_event_msg_hdr *)skb->data; - printk(KERN_INFO ">> hdr:%02x len:%02x sts:%02x numhci:%02x " - "opcode:%02x type:%s dlen:%02x", evt_hdr->hdr, evt_hdr->len, - evt_hdr->status, evt_hdr->num_fm_hci_cmds, evt_hdr->op, - (evt_hdr->rd_wr) ? "RD" : "WR", evt_hdr->dlen); + printk(KERN_INFO ">> hdr:%02x len:%02x sts:%02x numhci:%02x opcode:%02x type:%s dlen:%02x", + evt_hdr->hdr, evt_hdr->len, + evt_hdr->status, evt_hdr->num_fm_hci_cmds, evt_hdr->op, + (evt_hdr->rd_wr) ? "RD" : "WR", evt_hdr->dlen); len_org = skb->len - FM_EVT_MSG_HDR_SIZE; if (len_org > 0) { @@ -271,9 +271,9 @@ static void recv_tasklet(unsigned long arg) /* Process all packets in the RX queue */ while ((skb = skb_dequeue(&fmdev->rx_q))) { if (skb->len < sizeof(struct fm_event_msg_hdr)) { - fmerr("skb(%p) has only %d bytes, " - "at least need %zu bytes to decode\n", skb, - skb->len, sizeof(struct fm_event_msg_hdr)); + fmerr("skb(%p) has only %d bytes, at least need %zu bytes to decode\n", + skb, + skb->len, sizeof(struct fm_event_msg_hdr)); kfree_skb(skb); continue; } @@ -472,8 +472,7 @@ int fmc_send_cmd(struct fmdev *fmdev, u8 fm_op, u16 type, void *payload, if (!wait_for_completion_timeout(&fmdev->maintask_comp, FM_DRV_TX_TIMEOUT)) { - fmerr("Timeout(%d sec),didn't get reg" - "completion signal from RX tasklet\n", + fmerr("Timeout(%d sec),didn't get regcompletion signal from RX tasklet\n", jiffies_to_msecs(FM_DRV_TX_TIMEOUT) / 1000); return -ETIMEDOUT; } @@ -523,8 +522,7 @@ static inline int check_cmdresp_status(struct fmdev *fmdev, fm_evt_hdr = (void *)(*skb)->data; if (fm_evt_hdr->status != 0) { - fmerr("irq: opcode %x response status is not zero " - "Initiating irq recovery process\n", + fmerr("irq: opcode %x response status is not zero Initiating irq recovery process\n", fm_evt_hdr->op); mod_timer(&fmdev->irq_info.timer, jiffies + FM_DRV_TX_TIMEOUT); @@ -564,8 +562,7 @@ static void int_timeout_handler(unsigned long data) * reset stage index & retry count values */ fmirq->stage = 0; fmirq->retry = 0; - fmerr("Recovery action failed during" - "irq processing, max retry reached\n"); + fmerr("Recovery action failed duringirq processing, max retry reached\n"); return; } fm_irq_call_stage(fmdev, FM_SEND_INTMSK_CMD_IDX); @@ -1516,14 +1513,13 @@ int fmc_prepare(struct fmdev *fmdev) if (!wait_for_completion_timeout(&wait_for_fmdrv_reg_comp, FM_ST_REG_TIMEOUT)) { - fmerr("Timeout(%d sec), didn't get reg " - "completion signal from ST\n", + fmerr("Timeout(%d sec), didn't get reg completion signal from ST\n", jiffies_to_msecs(FM_ST_REG_TIMEOUT) / 1000); return -ETIMEDOUT; } if (fmdev->streg_cbdata != 0) { - fmerr("ST reg comp CB called with error " - "status %d\n", fmdev->streg_cbdata); + fmerr("ST reg comp CB called with error status %d\n", + fmdev->streg_cbdata); return -EAGAIN; } diff --git a/drivers/media/radio/wl128x/fmdrv_rx.c b/drivers/media/radio/wl128x/fmdrv_rx.c index cfaeb2417fbb..e7455f82fadc 100644 --- a/drivers/media/radio/wl128x/fmdrv_rx.c +++ b/drivers/media/radio/wl128x/fmdrv_rx.c @@ -120,8 +120,8 @@ int fm_rx_set_freq(struct fmdev *fmdev, u32 freq) curr_frq_in_khz = (fmdev->rx.region.bot_freq + ((u32)curr_frq * FM_FREQ_MUL)); if (curr_frq_in_khz != freq) { - pr_info("Frequency is set to (%d) but " - "requested freq is (%d)\n", curr_frq_in_khz, freq); + pr_info("Frequency is set to (%d) but requested freq is (%d)\n", + curr_frq_in_khz, freq); } /* Update local cache */ @@ -390,8 +390,8 @@ int fm_rx_set_region(struct fmdev *fmdev, u8 region_to_set) new_frq = fmdev->rx.region.top_freq; if (new_frq) { - fmdbg("Current freq is not within band limit boundary," - "switching to %d KHz\n", new_frq); + fmdbg("Current freq is not within band limit boundary,switching to %d KHz\n", + new_frq); /* Current RX frequency is not in range. So, update it */ ret = fm_rx_set_freq(fmdev, new_frq); } -- cgit v1.2.3 From 547633def7f5eb6deebf83400f61341b31eb7018 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 18 Oct 2016 17:44:25 -0200 Subject: [media] radio: don't break long lines Due to the 80-cols restrictions, and latter due to checkpatch warnings, several strings were broken into multiple lines. This is not considered a good practice anymore, as it makes harder to grep for strings at the source code. As we're right now fixing other drivers due to KERN_CONT, we need to be able to identify what printk strings don't end with a "\n". It is a way easier to detect those if we don't break long lines. So, join those continuation lines. The patch was generated via the script below, and manually adjusted if needed. use Text::Tabs; while (<>) { if ($next ne "") { $c=$_; if ($c =~ /^\s+\"(.*)/) { $c2=$1; $next =~ s/\"\n$//; $n = expand($next); $funpos = index($n, '('); $pos = index($c2, '",'); if ($funpos && $pos > 0) { $s1 = substr $c2, 0, $pos + 2; $s2 = ' ' x ($funpos + 1) . substr $c2, $pos + 2; $s2 =~ s/^\s+//; $s2 = ' ' x ($funpos + 1) . $s2 if ($s2 ne ""); print unexpand("$next$s1\n"); print unexpand("$s2\n") if ($s2 ne ""); } else { print "$next$c2\n"; } $next=""; next; } else { print $next; } $next=""; } else { if (m/\"$/) { if (!m/\\n\"$/) { $next=$_; next; } } } print $_; } Signed-off-by: Mauro Carvalho Chehab --- drivers/media/radio/radio-gemtek.c | 8 ++------ drivers/media/radio/radio-wl1273.c | 3 +-- 2 files changed, 3 insertions(+), 8 deletions(-) (limited to 'drivers/media/radio') diff --git a/drivers/media/radio/radio-gemtek.c b/drivers/media/radio/radio-gemtek.c index cff1eb144a5c..ca051ccbc3e4 100644 --- a/drivers/media/radio/radio-gemtek.c +++ b/drivers/media/radio/radio-gemtek.c @@ -67,14 +67,10 @@ module_param(probe, bool, 0444); MODULE_PARM_DESC(probe, "Enable automatic device probing."); module_param(hardmute, bool, 0644); -MODULE_PARM_DESC(hardmute, "Enable 'hard muting' by shutting down PLL, may " - "reduce static noise."); +MODULE_PARM_DESC(hardmute, "Enable 'hard muting' by shutting down PLL, may reduce static noise."); module_param_array(io, int, NULL, 0444); -MODULE_PARM_DESC(io, "Force I/O ports for the GemTek Radio card if automatic " - "probing is disabled or fails. The most common I/O ports are: 0x20c " - "0x30c, 0x24c or 0x34c (0x20c, 0x248 and 0x28c have been reported to " - "work for the combined sound/radiocard)."); +MODULE_PARM_DESC(io, "Force I/O ports for the GemTek Radio card if automatic probing is disabled or fails. The most common I/O ports are: 0x20c 0x30c, 0x24c or 0x34c (0x20c, 0x248 and 0x28c have been reported to work for the combined sound/radiocard)."); module_param_array(radio_nr, int, NULL, 0444); MODULE_PARM_DESC(radio_nr, "Radio device numbers"); diff --git a/drivers/media/radio/radio-wl1273.c b/drivers/media/radio/radio-wl1273.c index a93f681aa9d6..9ce4b12299b4 100644 --- a/drivers/media/radio/radio-wl1273.c +++ b/drivers/media/radio/radio-wl1273.c @@ -2068,8 +2068,7 @@ static int wl1273_fm_radio_probe(struct platform_device *pdev) goto err_request_irq; } } else { - dev_err(radio->dev, WL1273_FM_DRIVER_NAME ": Core WL1273 IRQ" - " not configured"); + dev_err(radio->dev, WL1273_FM_DRIVER_NAME ": Core WL1273 IRQ not configured"); r = -EINVAL; goto pdata_err; } -- cgit v1.2.3 From ac2ac8376eae2c7c7abb90732c967942510410b4 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Fri, 14 Oct 2016 07:33:00 -0300 Subject: [media] wl128x: use KERNEL_CONT where needed Some continuation messages are not using KERNEL_CONT. Since commit 563873318d32 ("Merge branch 'printk-cleanups"), this won't work as expected anymore. So, let's add KERN_CONT to those lines. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/radio/wl128x/fmdrv_common.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'drivers/media/radio') diff --git a/drivers/media/radio/wl128x/fmdrv_common.c b/drivers/media/radio/wl128x/fmdrv_common.c index 6f254e80ffa6..4be07656fbc0 100644 --- a/drivers/media/radio/wl128x/fmdrv_common.c +++ b/drivers/media/radio/wl128x/fmdrv_common.c @@ -212,14 +212,14 @@ inline void dump_tx_skb_data(struct sk_buff *skb) len_org = skb->len - FM_CMD_MSG_HDR_SIZE; if (len_org > 0) { - printk("\n data(%d): ", cmd_hdr->dlen); + printk(KERN_CONT "\n data(%d): ", cmd_hdr->dlen); len = min(len_org, 14); for (index = 0; index < len; index++) - printk("%x ", + printk(KERN_CONT "%x ", skb->data[FM_CMD_MSG_HDR_SIZE + index]); - printk("%s", (len_org > 14) ? ".." : ""); + printk(KERN_CONT "%s", (len_org > 14) ? ".." : ""); } - printk("\n"); + printk(KERN_CONT "\n"); } /* To dump incoming FM Channel-8 packets */ @@ -237,14 +237,14 @@ inline void dump_rx_skb_data(struct sk_buff *skb) len_org = skb->len - FM_EVT_MSG_HDR_SIZE; if (len_org > 0) { - printk("\n data(%d): ", evt_hdr->dlen); + printk(KERN_CONT "\n data(%d): ", evt_hdr->dlen); len = min(len_org, 14); for (index = 0; index < len; index++) - printk("%x ", + printk(KERN_CONT "%x ", skb->data[FM_EVT_MSG_HDR_SIZE + index]); - printk("%s", (len_org > 14) ? ".." : ""); + printk(KERN_CONT "%s", (len_org > 14) ? ".." : ""); } - printk("\n"); + printk(KERN_CONT "\n"); } #endif -- cgit v1.2.3