Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3067348imm; Mon, 28 May 2018 23:50:34 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqknTg5uGGK7ykJRILha5ajJNbdOS7WC+h9sgkb6rqTbP6mxP5t+VU6FuzdwtSNzZ2YqCSq X-Received: by 2002:aa7:83c7:: with SMTP id j7-v6mr16201749pfn.50.1527576634024; Mon, 28 May 2018 23:50:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527576633; cv=none; d=google.com; s=arc-20160816; b=ZSXDWutpg5ycnCct1Qz2J2iZytbnjW5jmNyI9qJnAp05KUDFd0QBsoUHtDd9Xk8Sh/ yEmtxpH9F8YU+imiuSWW6A0N2jgsRBNjG8qVgtU8PYYUn1FB/cuuHxVDBqrMwbJOAWyj X8b6tjcGKj2EYrA6uAAJn8w0EGXF+Qg6sOJ71TePahh6+HEWWy4ITeEBaGonjRUhdtg1 pHFsIFrfqTa7JUQ15lCvx7MnoYoVsAlYMbrYgDSygj+PPPXr0MtcfkQ2+dKicg8femH8 yDdimNw0dO6c4PPZA6CppBP6msnTH4pC1KqRlLwF3acg4jFWf5yhXvPJP/6gTuUotmqN 7QCw== 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=aFOWjha04DjcueXy04UhjWhVfnUaByBZHCtS49dO7cY=; b=IYhsiOFs1dHkAt2ShACeTafm2wmFfQOGwLCVeDpOKP13wQgcyRv2XQl2M3X9aPzSJL abd6zWhJmOipW1HDQUOfjna2tIVOlEp9jvdpz2yFKPCAA02SuKVVsf+OPnLxC/dklF+w VJoVINRQvX3F74wWngy0HEB0tLi1e5VRCu1Zqb0IiY9BA0sGzeR1KCKGNADGTSnsCdl1 6WgVgwNo3kq4Fcq9XXyTneJIcAdmILL2B1ftQwi7L33VGlyAMeqvvCh+fUhkEoZd5uMB eK2/HI3lYczqPCdCxaTWa+gEFcN7erxnWivSBuWS2VBWM2fGO2GCB/kSCwOKoLA/3HkP Es1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IiHFRFOC; 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 w127-v6si32033240pfd.313.2018.05.28.23.50.20; Mon, 28 May 2018 23:50:33 -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=IiHFRFOC; 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 S1754761AbeE2Gta (ORCPT + 99 others); Tue, 29 May 2018 02:49:30 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:45166 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754466AbeE2GtX (ORCPT ); Tue, 29 May 2018 02:49:23 -0400 Received: by mail-pg0-f67.google.com with SMTP id w3-v6so6142987pgv.12 for ; Mon, 28 May 2018 23:49:23 -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=aFOWjha04DjcueXy04UhjWhVfnUaByBZHCtS49dO7cY=; b=IiHFRFOC6vVAtBivc15iiw6ok/EgmSbHsboqn0hmo4LCcSDfS3HpC7mj88KosFLOY2 hzQCoC0MewYJEotDzuvBpocm7hS1C3+Tj7PkKk+JGQ6w9vb1naPXMSzGyiOsVXfrI2yv FUxKHTG1zRFR25MdcREfTFWZtrdKgzPTRMaE9Z5rEF2EKSAEUn3f6zhjsyg/KuhcKlQX 6NMw2zvubIA6szpk08XB+GofqOGiMCqC91TD1njF7JOwNDDZwGGPmGik0G4nELu7XVxG wH6OzYBTNABLH0Hxapbj/jeQqMEEuaC2o1p2buSIAKsGQT1WmBiDzbHvsqvsKbv35C6j otmQ== 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=aFOWjha04DjcueXy04UhjWhVfnUaByBZHCtS49dO7cY=; b=NFVnbkYj2R95unS2vBmrssCeeIZz+SvqqtGG15+YgURHuEUtw3vvu8XCtk1BrqscqL M2fXmzlg9UdFo9xUBpZwyKue+33cjp8PNqwR6aCgHiTddeupNE1N5vW7ilZg3mC7/IjL KkJOiOC70m63pp55QJQs8QVBGfi3HXAliMUd63Z34c51CGeX3NQ36qHpSKT9wdK12IRR lgvT+qhWnWtBKlmT2/0vX8VUiP0AJ7icraBv/ZIN8SPRjRojLo1a2Xh74zFFMYUwjTAS G9G4fiyylwfFQ9PjTHxkWYlVD9N8DjVFYSTSMbjU7TfHXyl9X84PAifwwmUdiTfb+6OO Iiog== X-Gm-Message-State: ALKqPwezRqlC6KyqFbQYNm2p7QyTTIxvCbtskhZNOel5YICvgBCSjwal i6gyVRnHuJdeXRBeMmw7cdE= X-Received: by 2002:a62:bd18:: with SMTP id a24-v6mr15844680pff.30.1527576562790; Mon, 28 May 2018 23:49:22 -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 10-v6sm17413187pgb.40.2018.05.28.23.49.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 28 May 2018 23:49:22 -0700 (PDT) From: Nick Desaulniers To: keith.busch@intel.com, axboe@fb.com, hch@lst.de, sagi@grimberg.me Cc: Nick Desaulniers , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] nvme: prefer strlcpy to strncpy Date: Mon, 28 May 2018 23:49:18 -0700 Message-Id: <1527576558-26817-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 --- drivers/nvme/host/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 99b857e..b823ecb 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -2017,7 +2017,7 @@ static void nvme_init_subnqn(struct nvme_subsystem *subsys, struct nvme_ctrl *ct nqnlen = strnlen(id->subnqn, NVMF_NQN_SIZE); if (nqnlen > 0 && nqnlen < NVMF_NQN_SIZE) { - strncpy(subsys->subnqn, id->subnqn, NVMF_NQN_SIZE); + strlcpy(subsys->subnqn, id->subnqn, NVMF_NQN_SIZE); return; } -- 2.7.4