lkml.org 
[lkml]   [2011]   [Mar]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: n_gsm: clean up printks
From
On Fri, Jan 7, 2011 at 23:59, Linux Kernel Mailing List
<linux-kernel@vger.kernel.org> wrote:
> Gitweb:     http://git.kernel.org/linus/5f9a31d63105c3e88bd6d026e7bc53f02a5ac042
> Commit:     5f9a31d63105c3e88bd6d026e7bc53f02a5ac042
> Parent:     c2f2f0000bb69f067fea12624272e6a58a811702
> Author:     Alan Cox <alan@linux.intel.com>
> AuthorDate: Thu Nov 4 15:17:27 2010 +0000
> Committer:  Greg Kroah-Hartman <gregkh@suse.de>
> 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]

> diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
> index 5256087..11a25fa 100644
> --- a/drivers/tty/n_gsm.c
> +++ b/drivers/tty/n_gsm.c

> @@ -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.

> +               }
> +               pr_cont("%02X ", *p++);
>        }
> -       printk("\n");
> +       pr_cont("\n");
>  }

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2011-03-20 10:59    [W:0.043 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site