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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 15 Jul 2011 12:05:50 +0200
From:	Bart Van Assche <bvanassche@....org>
To:	Jason Baron <jbaron@...hat.com>
Cc:	gregkh@...e.de, joe@...ches.com, jim.cromie@...il.com,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 11/11] dynamic_debug: use a single printk() to emit msgs

On Thu, Jul 14, 2011 at 6:09 PM, Jason Baron <jbaron@...hat.com> wrote:
> +static int dynamic_emit_prefix(const struct _ddebug *descriptor, char *buf)
>  {
>        char tid[sizeof(int) + sizeof(int)/2 + 4];
>        char lineno[sizeof(int) + sizeof(int)/2];
> @@ -442,31 +444,33 @@ static int dynamic_emit_prefix(const struct _ddebug *descriptor)
>        else
>                lineno[0] = 0;
>
> -       return printk(KERN_DEBUG "%s%s%s%s%s%s",
> -                     tid,
> -                     (descriptor->flags & _DPRINTK_FLAGS_INCL_MODNAME) ?
> -                     descriptor->modname : "",
> -                     (descriptor->flags & _DPRINTK_FLAGS_INCL_MODNAME) ?
> -                     ":" : "",
> -                     (descriptor->flags & _DPRINTK_FLAGS_INCL_FUNCNAME) ?
> -                     descriptor->function : "",
> -                     (descriptor->flags & _DPRINTK_FLAGS_INCL_FUNCNAME) ?
> -                     ":" : "",
> -                     lineno);
> +       return snprintf(buf, PREFIX_SIZE, KERN_DEBUG"%s%s%s%s%s%s",
> +                       tid,
> +                       (descriptor->flags & _DPRINTK_FLAGS_INCL_MODNAME) ?
> +                       descriptor->modname : "",
> +                       (descriptor->flags & _DPRINTK_FLAGS_INCL_MODNAME) ?
> +                       ":" : "",
> +                       (descriptor->flags & _DPRINTK_FLAGS_INCL_FUNCNAME) ?
> +                       descriptor->function : "",
> +                       (descriptor->flags & _DPRINTK_FLAGS_INCL_FUNCNAME) ?
> +                       ":" : "", lineno);
>  }

Not that's it important, but this change makes is possible to
eliminate the tid[] and lineno[] arrays again. Has that been
considered ?

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

Powered by Openwall GNU/*/Linux Powered by OpenVZ