From patchwork Mon Jul 13 07:46:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 235336 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp2611679ilg; Mon, 13 Jul 2020 00:48:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTAN5GY6pDCVZHBaNHvirHwCTsDNyelwLLNlQFM1Jo0/DAn1g2HD0oQ8Y23DrWRQFasodh X-Received: by 2002:a50:8e53:: with SMTP id 19mr74616486edx.185.1594626537490; Mon, 13 Jul 2020 00:48:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594626537; cv=none; d=google.com; s=arc-20160816; b=vS7JW4jqZYNVckfyEL65DR3Unlos+muIlOZIgsW8rbt6IEGrnkbxUbyHuSiLI3A3kP bRKXytLWlc+ubOpE6wTQzrHz2ek8uNBmc8syGgx6LCtob2n+ZV8d1UhuAlMdAVZfqDEr JFUPqO+FWpNdc4bA4PndKTZRatOZP8Qx4ZucgMSVQih+33TRTnlRhOQPy9BE419b9evD Cc/fWqvNHXExIKWTZtnTbp+iRZj6V164UUptEzqGikKtWXZyrK2KCZgIes7T01RGaruy VTfe1tDjHlctbGJGwNzvIIlhKqW1ZF02UcUuZFjK3plUG7DcksFtulKZbhyJimcokP5e 4e1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Oudq2oeculi6K4POMA0xfQMiSgZLhEbNGoOFwG0ADmE=; b=Df/K3TJLuTsRMGGMNUMAKzodcrHhFSIc7YcnTqJtBOZGNGOtHBuNXZnoszynnCi2vb 0eVmyQeU+kb8QEagqJvMHcjeNvxIypv8NLrHnYJtS/LqumZqUqkkc/rlCxXkxQEErVVR i1Mu7Lsh1rQJ0vlyvqNw2winBgV3xymKMAPZaThmzwo/OOodGUW8BAKSRIcuYntMgPqs pYKWC5WOfraNuIM/8OBIuDgg84pgX7o2fjsPlGVvGobY6R5sZg5euwp/lxrXHcYQr1QP aNSKXnBMlqJXtkJy6zInsNl/v/WjnPLm9e543SowKHHrWDBB/EqDt74DYe2lWzyga+kA 2k7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VLiZTK1Y; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u6si7592311ejf.218.2020.07.13.00.48.57 for ; Mon, 13 Jul 2020 00:48:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VLiZTK1Y; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729370AbgGMHst (ORCPT ); Mon, 13 Jul 2020 03:48:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728942AbgGMHqv (ORCPT ); Mon, 13 Jul 2020 03:46:51 -0400 Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32D95C08C5DB for ; Mon, 13 Jul 2020 00:46:51 -0700 (PDT) Received: by mail-wm1-x344.google.com with SMTP id 22so12326014wmg.1 for ; Mon, 13 Jul 2020 00:46:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Oudq2oeculi6K4POMA0xfQMiSgZLhEbNGoOFwG0ADmE=; b=VLiZTK1YdPounijVnkxQ3ZjJXAksw6WHoLAGOcJ3PPwwLBAgKzsO6C68bpRtW2oM8l P23zcEDL2q+LbLvngUYT6ZEFO7pKZl7Sl1hb8WA9PtC+MBlZViu3jYskVRT8pEhii/rA tV+xAXEneOWp4sRcXUk2nE9UUDl6b6sYd/KiRLeEDlJ81hehGArRGwNbA4NyHz3zCFqH tfE0GL0v7JUnk1UakZgNbPJy2wlhfqHB95cb8DXF1OJn4bVgYFRygsN/fEKxc3w7QUFP Xdsjd76DNvdjJGLL0aHhfKkP13hnEqjI/fB9oeAOTc13rdVgfP6fz5eoFK4fU/FTsCoB ZjXQ== 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:content-transfer-encoding; bh=Oudq2oeculi6K4POMA0xfQMiSgZLhEbNGoOFwG0ADmE=; b=ruqXx0nQEi8u/w7uPBv1+OnW9tP31zAuqfaV4Q3HcNg1+wFTfFra5mrftLhF+TEM3h 4IGVS+fGhgRGbUIIWjGYu8x3ODIujBi2axZE0swg3V9Z5CUB+HaXNdRMjtLkbTbUlacM XEqR4kr68wFEXmQwnr0BDP0pdGh0usxfJYD4ea/oymIn7OYPYbGEzPQet8aCscO5Dnt9 R14pON9CyB7RU3mYbeH78BBaZ4F1D0mD73MGWTpZ+Ql1GT9jXxSIu7YNZS/OXpLl5cFx VIuQEtqVR8JsiZ1Y04ppYiy6xcKfi+r3dwkeATbwdgK1hF2kyfvHG+qUThYQyS94ga75 apuA== X-Gm-Message-State: AOAM533XbgXGFWBT8igL5Pxtlfk2G5jhn/j+VSPB6Rfq9gxATJUSGdZj 1b8q4VmobxzgEOgvsSHUFNgoeg== X-Received: by 2002:a1c:4d11:: with SMTP id o17mr17317622wmh.134.1594626409906; Mon, 13 Jul 2020 00:46:49 -0700 (PDT) Received: from localhost.localdomain ([2.31.163.6]) by smtp.gmail.com with ESMTPSA id k11sm25142488wrd.23.2020.07.13.00.46.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 00:46:49 -0700 (PDT) From: Lee Jones To: jejb@linux.ibm.com, martin.petersen@oracle.com Cc: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, Lee Jones Subject: [PATCH v2 02/29] include: scsi: scsi_transport_fc: Match HBA Attribute Length with HBAAPI V2.0 definitions Date: Mon, 13 Jul 2020 08:46:18 +0100 Message-Id: <20200713074645.126138-3-lee.jones@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200713074645.126138-1-lee.jones@linaro.org> References: <20200713074645.126138-1-lee.jones@linaro.org> MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org According to 'include/scsi/scsi_transport_fc.h': "Attributes are based on HBAAPI V2.0 definitions" ... so it seems sane to match the 'HBA Attribute Length' to them. If we don't, the compiler complains that the copied data will be truncated. Fixes the following W=1 kernel build warning(s): In file included from include/linux/bitmap.h:9, from include/linux/cpumask.h:12, from include/linux/smp.h:13, from include/linux/percpu.h:7, from include/scsi/libfc.h:13, from drivers/scsi/libfc/fc_elsct.c:17: In function ‘strncpy’, inlined from ‘fc_ct_ms_fill.constprop’ at include/scsi/fc_encode.h:263:3: include/linux/string.h:297:30: warning: ‘__builtin_strncpy’ output may be truncated copying 64 bytes from a string of length 79 [-Wstringop-truncation] 297 | #define __underlying_strncpy __builtin_strncpy | ^ include/linux/string.h:307:9: note: in expansion of macro ‘__underlying_strncpy’ 307 | return __underlying_strncpy(p, q, size); | ^~~~~~~~~~~~~~~~~~~~ In function ‘strncpy’, inlined from ‘fc_ct_ms_fill.constprop’ at include/scsi/fc_encode.h:275:3: include/linux/string.h:297:30: warning: ‘__builtin_strncpy’ output may be truncated copying 64 bytes from a string of length 79 [-Wstringop-truncation] 297 | #define __underlying_strncpy __builtin_strncpy | ^ include/linux/string.h:307:9: note: in expansion of macro ‘__underlying_strncpy’ 307 | return __underlying_strncpy(p, q, size); | ^~~~~~~~~~~~~~~~~~~~ Signed-off-by: Lee Jones --- include/scsi/fc/fc_ms.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.25.1 Reviewed-by: Hannes Reinecke diff --git a/include/scsi/fc/fc_ms.h b/include/scsi/fc/fc_ms.h index 800d53dc94705..9e273fed0a85f 100644 --- a/include/scsi/fc/fc_ms.h +++ b/include/scsi/fc/fc_ms.h @@ -63,8 +63,8 @@ enum fc_fdmi_hba_attr_type { * HBA Attribute Length */ #define FC_FDMI_HBA_ATTR_NODENAME_LEN 8 -#define FC_FDMI_HBA_ATTR_MANUFACTURER_LEN 64 -#define FC_FDMI_HBA_ATTR_SERIALNUMBER_LEN 64 +#define FC_FDMI_HBA_ATTR_MANUFACTURER_LEN 80 +#define FC_FDMI_HBA_ATTR_SERIALNUMBER_LEN 80 #define FC_FDMI_HBA_ATTR_MODEL_LEN 256 #define FC_FDMI_HBA_ATTR_MODELDESCR_LEN 256 #define FC_FDMI_HBA_ATTR_HARDWAREVERSION_LEN 256