Skip to contentSkip to conversation

n_gsm: clean up printks

DISCUSSION Geert Uytterhoeven 1 participant 1 message Mar 20, 2011 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 18 lines · Linux Kernel Mailing List

Gitweb:     http://git.kernel.org/linus/5f9a31d63105c3e88bd6d026e7bc53f02a5ac042
Commit:     5f9a31d63105c3e88bd6d026e7bc53f02a5ac042
Parent:     c2f2f0000bb69f067fea12624272e6a58a811702
Author:     Alan Cox <[email protected]>
AuthorDate: Thu Nov 4 15:17:27 2010 +0000
Committer:  Greg Kroah-Hartman <[email protected]>
CommitDate: Thu Nov 11 11:35:58 2010 -0800

   n_gsm: clean up printks

   [Original From Ken Mills but I redid it using pr_ helpers instead]

drivers/tty/n_gsm.c +0 -0
index 5256087..11a25fa 100644

drivers/tty/n_gsm.c static void hex_packet(const unsigned char *p, int len) · line 535

Quoted 9 lines
drivers/tty/n_gsm.c +3 -3
@@ -526,11 +530,13 @@ static void hex_packet(const unsigned char *p, int len)
  {
        int i;
        for (i = 0; i < len; i++) {
-               if (i && (i % 16) == 0)
-                       printk("\n");
-               printk("%02X ", *p++);
+               if (i && (i % 16) == 0) {
+                       pr_cont("\n");
+                       pr_debug("");

drivers/tty/n_gsm.c: In function ‘hex_packet’:
drivers/tty/n_gsm.c:535: warning: zero-length printf format string

Originally reported by Randy
http://linux.derkeiler.com/Mailing-Lists/Kernel/2011-02/msg04880.html

There's no way this is going to be printed nicely. Please use print_hex_dump() instead.

drivers/tty/n_gsm.c static void hex_packet(const unsigned char *p, int len) · line 540

Quoted 6 lines
drivers/tty/n_gsm.c +3 -1
+               }
+               pr_cont("%02X ", *p++);
        }
-       printk("\n");
+       pr_cont("\n");
  }

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds