lkml.org 
[lkml]   [2013]   [Oct]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH trivial] ata: libata-eh: Remove unnecessary snprintf arithmetic
Hello,

On Tue, Oct 29, 2013 at 07:38:38PM +0100, Levente Kurusa wrote:
> Remove an unnecessary arithmetic operation from a call to snprintf, because
> the size parameter of snprintf includes the trailing null byte.
>
> Signed-off-by: Levente Kurusa <levex@linux.com>
> ---
> diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
> index f9476fb..b7c4146 100644
> --- a/drivers/ata/libata-eh.c
> +++ b/drivers/ata/libata-eh.c
> @@ -2427,7 +2434,7 @@ static void ata_eh_link_report(struct ata_link *link)
>
> memset(tries_buf, 0, sizeof(tries_buf));

While at it, can you please remove the above and just initialize the
buffer to "" on definition?

Thanks.

--
tejun


\
 
 \ /
  Last update: 2013-10-29 20:21    [W:0.051 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site