Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3055657imm; Mon, 28 May 2018 23:32:35 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrSL2CuueqrlLKZpkWSnR8QuoseErzX5e9x0bLaAbrkFdUSL4xbXoElelhpNRqwtdDkQ5O9 X-Received: by 2002:a17:902:6686:: with SMTP id e6-v6mr16258763plk.35.1527575555669; Mon, 28 May 2018 23:32:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527575555; cv=none; d=google.com; s=arc-20160816; b=fAOC+Jl6rVbYkiLk5Xd8fKE9/w3YSgd7nyxlmTLP0noIKDETz2t9bXbBA0jj0jr4wX LB0Se5L8mYPkoXs4JkYZvxSiUlkxjXAGjQ7Uz/3bOgnU+ExB+P0h2jUdw3qw0YOUXTXX cN5fGzDe2LIFu587lwPXgNMc2HhLb/Skx/PQ1Aaf8YW/pYPKz4vHy9MX7eLvv5XMs61Q p60f/EhHt4ezuYopf4LC6L0tXhH7ICE7jgUgkTLyvR8IJz3QUYfXEAOSWO5lx+3ARf8f hXXTmnxd6NHBMvOcpbZTmQC2Gnd43KD47RJgpo9wqihLnWHA3zc7qa05ALsDgUYZJx5o MeNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=EY/D+2C3kl43fFoCVeVtshZaCBugxjGJjjp7sx92FKA=; b=zgxHiIFbbgPhzjAVotr20HQt9jXvNHhRFGdH9G+bsTrHiTCgo44Wi68nk2GGue0Ebg bqmnt+N6GhnxfKuoOa7SxluQ27HBxhQ5D++EvXADDudsJq1chWETwN6D4Fwh1u0rXPLr 55Mq+r19omLQSZa6r6Wmf7+ADr2a/QBvUBpB21N5Q53vZ18zKJEP7pELqCuGiTkT7TYZ mKrPkfOOlQmhJyBopbzt1g3IPTkhHcl7l1jFYcPrP8An4pNDSsPwNn+UbyckULmoikq0 3S4dM5jxlg7AvUpK6/AX3YFD6jkK3By17oJ2XZqGZh/2Y9AULp89jAnxSA/zAmxIu6cB CT+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=N2wk3JLx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f64-v6si32205229pfd.123.2018.05.28.23.32.21; Mon, 28 May 2018 23:32:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=N2wk3JLx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754579AbeE2Gby (ORCPT + 99 others); Tue, 29 May 2018 02:31:54 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:44558 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754466AbeE2Gbw (ORCPT ); Tue, 29 May 2018 02:31:52 -0400 Received: by mail-pl0-f66.google.com with SMTP id z9-v6so5007064plk.11 for ; Mon, 28 May 2018 23:31:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=EY/D+2C3kl43fFoCVeVtshZaCBugxjGJjjp7sx92FKA=; b=N2wk3JLxrAP0UKjqgsGEiwsP2J3+3oyFr1cgr490DVZ9X6y2aj7kAan/tZxtDm+z0+ q9Zyudg9tR8RsvOS+ZlehbVP1mKkyXpURz8GkhO4jhFNleGRBHAA7P+148qcVUvtHMj4 z2AkVSdripLMXV54lqF+MMN/pY83MIoIxFStTh9WfeteqWayINnklextHrRmMSc91tp2 6Lc3ugJDLMT3b3OCkZOmf3DBC0sjjOU3/IZjsUM7Kf/odaPHDuf3fsOLQMsHo407S+Fl mRrqmMbhfJIimbQcwRnzURgnBq7DHroXwtrZep7Wel03ZO/FCYXKwrI4/+CYawWBhwSa Yd1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=EY/D+2C3kl43fFoCVeVtshZaCBugxjGJjjp7sx92FKA=; b=g/LioeaYXrRF4kdy8jjbrzVSV3XVlboYt/mFBaz6oHq5oiAaI5uBcyB+Fl0q0WptR/ M1J/a8HQlQ0xj05ULpwOwOe+XJwKaYvMCnGz1zYKIv2J9Jxf5qAEq657eoANFU2NKE1o vS1Qu9fqRltnGWngO5+ROBgjteGj3uLmX+yRGk+nXc8ZRiAI3zDe4M2KGQmkBEbgwvw8 eVTcBGq+fNXoVqF/51AjYNINBUS12O2tZk0sAkL0eEoBEURsL8/7JkE8WWSDDpBdU/Mz 5ELcGGvnK+UcT4pg9wSQJO+nMRUxo3p9kDsVxFT67phZtuINjX+4/w3CcPf5qzXySsFh 8GQQ== X-Gm-Message-State: ALKqPwezmsosiABbqW32dqBcfcf2FrrufrKJcdvRDx+TSxnUkJm7UUAt cRPlwhfyKZcsi3FD0Mm6j6E= X-Received: by 2002:a17:902:8541:: with SMTP id d1-v6mr16935158plo.106.1527575511526; Mon, 28 May 2018 23:31:51 -0700 (PDT) Received: from localhost.localdomain (c-24-6-183-110.hsd1.ca.comcast.net. [24.6.183.110]) by smtp.googlemail.com with ESMTPSA id e12-v6sm23404804pgs.42.2018.05.28.23.31.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 28 May 2018 23:31:50 -0700 (PDT) From: Nick Desaulniers To: rostedt@goodmis.org, mingo@redhat.com Cc: Nick Desaulniers , Thomas Gleixner , Kate Stewart , Greg Kroah-Hartman , Philippe Ombredanne , linux-kernel@vger.kernel.org Subject: [PATCH] blk-wbt: tracing: prefer strlcpy to strncpy Date: Mon, 28 May 2018 23:31:27 -0700 Message-Id: <1527575488-31305-1-git-send-email-nick.desaulniers@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fixes a stringop-truncation warning from gcc-8. Signed-off-by: Nick Desaulniers --- 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