lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Sun, 20 Mar 2011 10:56:01 +0100
From:	Geert Uytterhoeven <geert@...ux-m68k.org>
To:	Alan Cox <alan@...ux.intel.com>, Ken Mills <ken.k.mills@...el.com>
Cc:	Greg Kroah-Hartman <gregkh@...e.de>,
	Randy Dunlap <randy.dunlap@...cle.com>,
	linux-kernel@...r.kernel.org
Subject: Re: n_gsm: clean up printks

On Fri, Jan 7, 2011 at 23:59, Linux Kernel Mailing List
<linux-kernel@...r.kernel.org> wrote:
> Gitweb:     http://git.kernel.org/linus/5f9a31d63105c3e88bd6d026e7bc53f02a5ac042
> Commit:     5f9a31d63105c3e88bd6d026e7bc53f02a5ac042
> Parent:     c2f2f0000bb69f067fea12624272e6a58a811702
> Author:     Alan Cox <alan@...ux.intel.com>
> AuthorDate: Thu Nov 4 15:17:27 2010 +0000
> Committer:  Greg Kroah-Hartman <gregkh@...e.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@...ux-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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists