summaryrefslogtreecommitdiff
path: root/drivers/parport/probe.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2020-04-03 14:43:17 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-04-23 17:05:37 +0200
commitaa3d6e7c49e3b480aa9db0e9924736726a6f75aa (patch)
treea524d4c15c0df94f1cb17a764aec43cec3f621f6 /drivers/parport/probe.c
parentdecf26f6ec25dac868782dc1751623a87d147831 (diff)
parport: Use more comon logging styles
Some of the logging can be poorly formatted because of unexpected line breaks given printks without KERN_CONT that should be pr_cont. Miscellanea: o Remove unnecessary spaces between function name and open parenthesis o Convert bare printks to pr_<level> where appropriate o Convert embedded function names to use %s, __func__ o Coalesce formats o Realign arguments o Use do {} while (0) in a macro and not a bare if Signed-off-by: Joe Perches <joe@perches.com> Reviewed-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com> Link: https://lore.kernel.org/r/20200403134325.11523-3-sudipm.mukherjee@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/parport/probe.c')
-rw-r--r--drivers/parport/probe.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/drivers/parport/probe.c b/drivers/parport/probe.c
index 10ed0d174080..7e6d713fa5ac 100644
--- a/drivers/parport/probe.c
+++ b/drivers/parport/probe.c
@@ -41,13 +41,13 @@ static void pretty_print(struct parport *port, int device)
pr_info("%s", port->name);
if (device >= 0)
- printk (" (addr %d)", device);
+ pr_cont(" (addr %d)", device);
- printk (": %s", classes[info->class].descr);
+ pr_cont(": %s", classes[info->class].descr);
if (info->class)
- printk(", %s %s", info->mfr, info->model);
+ pr_cont(", %s %s", info->mfr, info->model);
- printk("\n");
+ pr_cont("\n");
}
static void parse_data(struct parport *port, int device, char *str)
@@ -178,9 +178,8 @@ static ssize_t parport_read_device_id (struct parport *port, char *buffer,
* just return constant nibble forever. This catches
* also those cases. */
if (idlens[0] == 0 || idlens[0] > 0xFFF) {
- printk (KERN_DEBUG "%s: reported broken Device ID"
- " length of %#zX bytes\n",
- port->name, idlens[0]);
+ printk(KERN_DEBUG "%s: reported broken Device ID length of %#zX bytes\n",
+ port->name, idlens[0]);
return -EIO;
}
numidlens = 2;
@@ -202,10 +201,8 @@ static ssize_t parport_read_device_id (struct parport *port, char *buffer,
if (port->physport->ieee1284.phase != IEEE1284_PH_HBUSY_DAVAIL) {
if (belen != len) {
- printk (KERN_DEBUG "%s: Device ID was %zd bytes"
- " while device told it would be %d"
- " bytes\n",
- port->name, len, belen);
+ printk(KERN_DEBUG "%s: Device ID was %zd bytes while device told it would be %d bytes\n",
+ port->name, len, belen);
}
goto done;
}
@@ -215,11 +212,9 @@ static ssize_t parport_read_device_id (struct parport *port, char *buffer,
* the first 256 bytes or so that we must have read so
* far. */
if (buffer[len-1] == ';') {
- printk (KERN_DEBUG "%s: Device ID reading stopped"
- " before device told data not available. "
- "Current idlen %u of %u, len bytes %02X %02X\n",
- port->name, current_idlen, numidlens,
- length[0], length[1]);
+ printk(KERN_DEBUG "%s: Device ID reading stopped before device told data not available. Current idlen %u of %u, len bytes %02X %02X\n",
+ port->name, current_idlen, numidlens,
+ length[0], length[1]);
goto done;
}
}