From patchwork Tue Jun 29 14:11:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sreekanth Reddy X-Patchwork-Id: 468966 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,MIME_NO_TEXT, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08057C11F66 for ; Tue, 29 Jun 2021 14:06:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DED2F61DC2 for ; Tue, 29 Jun 2021 14:06:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232518AbhF2OIu (ORCPT ); Tue, 29 Jun 2021 10:08:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230100AbhF2OIt (ORCPT ); Tue, 29 Jun 2021 10:08:49 -0400 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9BA88C061760 for ; Tue, 29 Jun 2021 07:06:22 -0700 (PDT) Received: by mail-pj1-x102c.google.com with SMTP id mn20-20020a17090b1894b02901707fc074e8so2003124pjb.0 for ; Tue, 29 Jun 2021 07:06:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:mime-version; bh=vYRzz2aYykRMVKCddpVTurUc9UYlZSqdWnEorThv61U=; b=Ceuu7ilnI+9jZZyjQsxvASmwu1Kh1G9Zbft435iDJso+os5QGxE7v5TdYPqzvJFZEb pJgzlm+Pn6Bh43OpolOR6hD1BnHO8/bC2OQXqaHzqT0KS6anUSj/kfe4hjZ+SVPL/S+y Hy1b20x/JmrwcoGnoCfYmnRN9cVmQbXeBwMVY= 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:mime-version; bh=vYRzz2aYykRMVKCddpVTurUc9UYlZSqdWnEorThv61U=; b=DbKA3U1oJPzb7us1n9xY+caRnNmbacu7X9xspgd/sw257JdSQgEnkRgBxkvGvscHPj +ebnVzY2OoQb85Vkca49jfe3gp0u24BlJL5qYCw60hHCzOGNPTB0hFPS1urNJ9qgzpKO dfmCkicd0gbhryA0V/vZujfRrYlmUYoptyOjhIsumWUczvK313bvF779i8fDfsqcYnjC hSo0qhxgaCjmMKkWUl8Cpibtf+JxDtA+QlSuZX7RPtiLfWfjX0odooqMvN+2KsbfOLxD B4jzGFBO08svRw9k9JckldrR7vrPv6nxF/OI1ZuA50coW1bwlTYPS7IB/sRQybRuUCQS Kovw== X-Gm-Message-State: AOAM530DBKVLdxyi/ITMkSiigdE2kBUMJxFYZOKpW6bs2l0gFNQrqNJg GspURajecGUcqd9lI4y2RDV3ZquqzoU1kC/d71SpaqARyRnIZcur60MTNdFWZ1PuwrJGsYTT9YC Z4ldFwLGMeUK5umwZwlGjuCrYVAkEowXnLCpR6/9WO4F8adtUm9hXAUySigPbG/qHT/XQrvMmRA 8hApbb25csCEk= X-Google-Smtp-Source: ABdhPJzIQEmOx8OCgOCpTJgzN2CRnECRN7CI2y353gxwRdZ0SRsT3j7/voyfxGGLgoPkvyMhTjG+9Q== X-Received: by 2002:a17:90b:809:: with SMTP id bk9mr1166050pjb.56.1624975581557; Tue, 29 Jun 2021 07:06:21 -0700 (PDT) Received: from dhcp-10-123-20-36.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id d20sm17695103pfn.219.2021.06.29.07.06.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Jun 2021 07:06:19 -0700 (PDT) From: Sreekanth Reddy To: linux-scsi@vger.kernel.org, martin.petersen@oracle.com Cc: jejb@linux.ibm.com, mpi3mr-linuxdrv.pdl@broadcom.com, kashyap.desai@broadcom.com, sathya.prakash@broadcom.com, Sreekanth Reddy , kernel test robot Subject: [PATCH v2] mpi3mr: Fix W=1 compilation warnings Date: Tue, 29 Jun 2021 19:41:10 +0530 Message-Id: <20210629141110.3098-1-sreekanth.reddy@broadcom.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Fix for below W=1 compilation warning, 'strncpy' output may be truncated copying 16 bytes from a string of length 64 Reported-by: kernel test robot Signed-off-by: Sreekanth Reddy --- drivers/scsi/mpi3mr/mpi3mr_fw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/mpi3mr/mpi3mr_fw.c b/drivers/scsi/mpi3mr/mpi3mr_fw.c index 9eceafca59bc..ede2bd0cf8d4 100644 --- a/drivers/scsi/mpi3mr/mpi3mr_fw.c +++ b/drivers/scsi/mpi3mr/mpi3mr_fw.c @@ -2608,9 +2608,9 @@ static int mpi3mr_issue_iocinit(struct mpi3mr_ioc *mrioc) } drv_info->information_length = cpu_to_le32(data_len); strncpy(drv_info->driver_signature, "Broadcom", sizeof(drv_info->driver_signature)); - strncpy(drv_info->os_name, utsname()->sysname, sizeof(drv_info->os_name)); + strscpy(drv_info->os_name, utsname()->sysname, sizeof(drv_info->os_name)); drv_info->os_name[sizeof(drv_info->os_name) - 1] = 0; - strncpy(drv_info->os_version, utsname()->release, sizeof(drv_info->os_version)); + strscpy(drv_info->os_version, utsname()->release, sizeof(drv_info->os_version)); drv_info->os_version[sizeof(drv_info->os_version) - 1] = 0; strncpy(drv_info->driver_name, MPI3MR_DRIVER_NAME, sizeof(drv_info->driver_name)); strncpy(drv_info->driver_version, MPI3MR_DRIVER_VERSION, sizeof(drv_info->driver_version));