From patchwork Wed Jun 23 07:21:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sreekanth Reddy X-Patchwork-Id: 466188 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=-19.1 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, 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 1EB66C4743C for ; Wed, 23 Jun 2021 07:17:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 026BD61185 for ; Wed, 23 Jun 2021 07:17:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229954AbhFWHTX (ORCPT ); Wed, 23 Jun 2021 03:19:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229660AbhFWHTX (ORCPT ); Wed, 23 Jun 2021 03:19:23 -0400 Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32AD6C061574 for ; Wed, 23 Jun 2021 00:17:06 -0700 (PDT) Received: by mail-pg1-x52f.google.com with SMTP id y14so984520pgs.12 for ; Wed, 23 Jun 2021 00:17:06 -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:in-reply-to:references :mime-version; bh=f1m45n8mvtPg8TMAC62Xmy6EQGO5majY8CF0IatgFVs=; b=NczizZ67YUslY6j8ACrZmwBCHW+FAxkqvbWHEi98XR4E738sbQhoS4RUvR+drpmka+ T09DWTrI0R7nTdQ71VoVl+z4wg2u0YBryQZaTsZiMzBOKSStBG7AwkQa50w/D6f4LNvp XUTsFkHEMrpMm7pqw3zeYBUjK6p71/nf3ZA1k= 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:in-reply-to :references:mime-version; bh=f1m45n8mvtPg8TMAC62Xmy6EQGO5majY8CF0IatgFVs=; b=B2jwMbda/hEGfV+ChihossByTx/ABs3Oj1M+AaZnE6WELf5nBMcpGhNFI6XRqU/Ik5 IEFrxcA/JX061lM/awcvapZv980MjZVKunQNzI9HatZ8bJAO6/qF0qLUf38UPhiFlE11 uBrdBYNfSjKfxrgerHQmVYwWjcA+UxNZiRmtDMoX8hqgKbK5KnvO1ilEI7PSDOWDQUQk kaY7L4t3SxpWiDssffUgq7ovzpuidN2DTChcBJNQYl/mJ1bRrCuL4dMQrg8YaW79dmii 4YAC1EwGbUut+iNLLzNKTGzbuVTUkZbPOYtSaH0aeJY3HHEBj2ahubxSXB/Rk5/o7V4h i3dw== X-Gm-Message-State: AOAM532ikx3A5sF/g4iSK+NzP/zpjJiCvlquejnqmL7PX42gqoqKxsRo U8m1egEcSy/JDjFOG1IyoHbytwNG3Slq5kV7O7qDqLhlPggHvbesCnmFMuYuBIF0eBquK6t8CBs lSBvOB6J2Zx9X669SF+PyaTKdUJOYvx+Js/JhMejvaTbYzRC33I6jncEvDGnjG0sx4CwDQuIrZF mubadIEeuGnhA= X-Google-Smtp-Source: ABdhPJwbIb95avrJsKkJplnR7Nx2aZCYj/adHBKaB1RmpcSs0NIM2dSIA5/BMwEUxNOmoXLWfr37bg== X-Received: by 2002:a63:e50a:: with SMTP id r10mr2604258pgh.30.1624432625103; Wed, 23 Jun 2021 00:17:05 -0700 (PDT) Received: from dhcp-10-123-20-36.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id y6sm10894252pgk.79.2021.06.23.00.17.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Jun 2021 00:17:04 -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] mpi3mr: Fix W=1 compilation warnings Date: Wed, 23 Jun 2021 12:51:53 +0530 Message-Id: <20210623072153.25758-2-sreekanth.reddy@broadcom.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210623072153.25758-1-sreekanth.reddy@broadcom.com> References: <20210623072153.25758-1-sreekanth.reddy@broadcom.com> 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 | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/mpi3mr/mpi3mr_fw.c b/drivers/scsi/mpi3mr/mpi3mr_fw.c index 9eceafca59bc..fd437a19b948 100644 --- a/drivers/scsi/mpi3mr/mpi3mr_fw.c +++ b/drivers/scsi/mpi3mr/mpi3mr_fw.c @@ -2608,10 +2608,8 @@ 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)); - drv_info->os_name[sizeof(drv_info->os_name) - 1] = 0; - strncpy(drv_info->os_version, utsname()->release, sizeof(drv_info->os_version)); - drv_info->os_version[sizeof(drv_info->os_version) - 1] = 0; + memcpy(drv_info->os_name, utsname()->sysname, sizeof(drv_info->os_name) - 1); + memcpy(drv_info->os_version, utsname()->release, sizeof(drv_info->os_version) - 1); 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)); strncpy(drv_info->driver_release_date, MPI3MR_DRIVER_RELDATE, sizeof(drv_info->driver_release_date));