lkml.org 
[lkml]   [2013]   [Jun]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] arch: blackfin: kernel: sprintf(), need avoid NUL for '%s'
i think you mean NULL instead of NUL

that said, the kernel is smart enough to replace NULL with "(null)",
so i don't see much point in this patch
-mike

On Wed, May 29, 2013 at 5:43 AM, Chen Gang <gang.chen@asianux.com> wrote:
>
> When it is kernel symbol, the 'modname' will be NUL, and the 'symname'
> contents the valid name.
>
> So for sprintf(), need avoid NUL for '%s'.
>
>
> Signed-off-by: Chen Gang <gang.chen@asianux.com>
> ---
> arch/blackfin/kernel/trace.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/blackfin/kernel/trace.c b/arch/blackfin/kernel/trace.c
> index c36efa0..11f98bb 100644
> --- a/arch/blackfin/kernel/trace.c
> +++ b/arch/blackfin/kernel/trace.c
> @@ -51,7 +51,7 @@ void decode_address(char *buf, unsigned long address)
> if (!modname)
> modname = delim = "";
> sprintf(buf, "{ %s%s%s%s + 0x%lx }",
> - delim, modname, delim, symname,
> + delim, modname ? : "kernel", delim, symname,
> (unsigned long)offset);
> return;
> }
> --
> 1.7.7.6
> --
> 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: 2013-06-16 05:41    [W:0.081 / U:0.612 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site