diff options
author | Joe Perches <joe@perches.com> | 2014-10-10 09:12:47 -0700 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2015-05-30 16:09:04 +0200 |
commit | f2e6cf76751d479874216f989f6bef6da6e80119 (patch) | |
tree | a9dbcf36f41db4c065f07381abae177a9d348815 /drivers/pcmcia/rsrc_nonstatic.c | |
parent | 3ce3c1c4fefa48f429a4379f729e44a9e6ba657a (diff) | |
download | lwn-f2e6cf76751d479874216f989f6bef6da6e80119.tar.gz lwn-f2e6cf76751d479874216f989f6bef6da6e80119.zip |
pcmcia: Convert dev_printk to dev_<level>
Reduce object size a little by using dev_<level>
calls instead of dev_printk(KERN_<LEVEL>.
Other miscellanea:
o Coalesce formats
o Realign arguments
o Use pr_cont instead of naked printk
reorder test to use "%s\n"
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/pcmcia/rsrc_nonstatic.c')
-rw-r--r-- | drivers/pcmcia/rsrc_nonstatic.c | 44 |
1 files changed, 21 insertions, 23 deletions
diff --git a/drivers/pcmcia/rsrc_nonstatic.c b/drivers/pcmcia/rsrc_nonstatic.c index 065704c605d5..5ef7b46a2578 100644 --- a/drivers/pcmcia/rsrc_nonstatic.c +++ b/drivers/pcmcia/rsrc_nonstatic.c @@ -191,15 +191,13 @@ static void do_io_probe(struct pcmcia_socket *s, unsigned int base, int any; u_char *b, hole, most; - dev_printk(KERN_INFO, &s->dev, "cs: IO port probe %#x-%#x:", - base, base+num-1); + dev_info(&s->dev, "cs: IO port probe %#x-%#x:", base, base+num-1); /* First, what does a floating port look like? */ b = kzalloc(256, GFP_KERNEL); if (!b) { - printk("\n"); - dev_printk(KERN_ERR, &s->dev, - "do_io_probe: unable to kmalloc 256 bytes"); + pr_cont("\n"); + dev_err(&s->dev, "do_io_probe: unable to kmalloc 256 bytes\n"); return; } for (i = base, most = 0; i < base+num; i += 8) { @@ -223,7 +221,7 @@ static void do_io_probe(struct pcmcia_socket *s, unsigned int base, res = claim_region(s, i, 8, IORESOURCE_IO, "PCMCIA ioprobe"); if (!res) { if (!any) - printk(" excluding"); + pr_cont(" excluding"); if (!bad) bad = any = i; continue; @@ -234,13 +232,13 @@ static void do_io_probe(struct pcmcia_socket *s, unsigned int base, free_region(res); if (j < 8) { if (!any) - printk(" excluding"); + pr_cont(" excluding"); if (!bad) bad = any = i; } else { if (bad) { sub_interval(&s_data->io_db, bad, i-bad); - printk(" %#x-%#x", bad, i-1); + pr_cont(" %#x-%#x", bad, i-1); bad = 0; } } @@ -248,15 +246,15 @@ static void do_io_probe(struct pcmcia_socket *s, unsigned int base, if (bad) { if ((num > 16) && (bad == base) && (i == base+num)) { sub_interval(&s_data->io_db, bad, i-bad); - printk(" nothing: probe failed.\n"); + pr_cont(" nothing: probe failed.\n"); return; } else { sub_interval(&s_data->io_db, bad, i-bad); - printk(" %#x-%#x", bad, i-1); + pr_cont(" %#x-%#x", bad, i-1); } } - printk(any ? "\n" : " clean.\n"); + pr_cont("%s\n", !any ? " clean" : ""); } #endif @@ -413,8 +411,8 @@ static int do_mem_probe(struct pcmcia_socket *s, u_long base, u_long num, struct socket_data *s_data = s->resource_data; u_long i, j, bad, fail, step; - dev_printk(KERN_INFO, &s->dev, "cs: memory probe 0x%06lx-0x%06lx:", - base, base+num-1); + dev_info(&s->dev, "cs: memory probe 0x%06lx-0x%06lx:", + base, base+num-1); bad = fail = 0; step = (num < 0x20000) ? 0x2000 : ((num>>4) & ~0x1fff); /* don't allow too large steps */ @@ -438,13 +436,13 @@ static int do_mem_probe(struct pcmcia_socket *s, u_long base, u_long num, } if (i != j) { if (!bad) - printk(" excluding"); - printk(" %#05lx-%#05lx", i, j-1); + pr_cont(" excluding"); + pr_cont(" %#05lx-%#05lx", i, j-1); sub_interval(&s_data->mem_db, i, j-i); bad += j-i; } } - printk(bad ? "\n" : " clean.\n"); + pr_cont("%s\n", !bad ? " clean" : ""); return num - bad; } @@ -495,7 +493,7 @@ static int validate_mem(struct pcmcia_socket *s, unsigned int probe_mask) return 0; if (s_data->mem_db_valid.next != &s_data->mem_db_valid) return 0; - dev_printk(KERN_NOTICE, &s->dev, + dev_notice(&s->dev, "cs: warning: no high memory space available!\n"); return -ENODEV; } @@ -975,9 +973,9 @@ static int nonstatic_autoadd_resources(struct pcmcia_socket *s) if (res == &ioport_resource) continue; - dev_printk(KERN_INFO, &s->cb_dev->dev, - "pcmcia: parent PCI bridge window: %pR\n", - res); + dev_info(&s->cb_dev->dev, + "pcmcia: parent PCI bridge window: %pR\n", + res); if (!adjust_io(s, ADD_MANAGED_RESOURCE, res->start, res->end)) done |= IORESOURCE_IO; @@ -990,9 +988,9 @@ static int nonstatic_autoadd_resources(struct pcmcia_socket *s) if (res == &iomem_resource) continue; - dev_printk(KERN_INFO, &s->cb_dev->dev, - "pcmcia: parent PCI bridge window: %pR\n", - res); + dev_info(&s->cb_dev->dev, + "pcmcia: parent PCI bridge window: %pR\n", + res); if (!adjust_memory(s, ADD_MANAGED_RESOURCE, res->start, res->end)) done |= IORESOURCE_MEM; } |