[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1527575488-31305-1-git-send-email-nick.desaulniers@gmail.com>
Date: Mon, 28 May 2018 23:31:27 -0700
From: Nick Desaulniers <nick.desaulniers@...il.com>
To: rostedt@...dmis.org, mingo@...hat.com
Cc: Nick Desaulniers <nick.desaulniers@...il.com>,
Thomas Gleixner <tglx@...utronix.de>,
Kate Stewart <kstewart@...uxfoundation.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Philippe Ombredanne <pombredanne@...b.com>,
linux-kernel@...r.kernel.org
Subject: [PATCH] blk-wbt: tracing: prefer strlcpy to strncpy
Fixes a stringop-truncation warning from gcc-8.
Signed-off-by: Nick Desaulniers <nick.desaulniers@...il.com>
---
include/trace/events/wbt.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/trace/events/wbt.h b/include/trace/events/wbt.h
index b048694..305252d 100644
--- a/include/trace/events/wbt.h
+++ b/include/trace/events/wbt.h
@@ -33,7 +33,7 @@ TRACE_EVENT(wbt_stat,
),
TP_fast_assign(
- strncpy(__entry->name, dev_name(bdi->dev), 32);
+ strlcpy(__entry->name, dev_name(bdi->dev), 32);
__entry->rmean = stat[0].mean;
__entry->rmin = stat[0].min;
__entry->rmax = stat[0].max;
@@ -67,7 +67,7 @@ TRACE_EVENT(wbt_lat,
),
TP_fast_assign(
- strncpy(__entry->name, dev_name(bdi->dev), 32);
+ strlcpy(__entry->name, dev_name(bdi->dev), 32);
__entry->lat = div_u64(lat, 1000);
),
@@ -103,7 +103,7 @@ TRACE_EVENT(wbt_step,
),
TP_fast_assign(
- strncpy(__entry->name, dev_name(bdi->dev), 32);
+ strlcpy(__entry->name, dev_name(bdi->dev), 32);
__entry->msg = msg;
__entry->step = step;
__entry->window = div_u64(window, 1000);
@@ -138,7 +138,7 @@ TRACE_EVENT(wbt_timer,
),
TP_fast_assign(
- strncpy(__entry->name, dev_name(bdi->dev), 32);
+ strlcpy(__entry->name, dev_name(bdi->dev), 32);
__entry->status = status;
__entry->step = step;
__entry->inflight = inflight;
--
2.7.4
Powered by blists - more mailing lists