From patchwork Wed Jul 8 12:01:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 235097 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp371650ilg; Wed, 8 Jul 2020 05:04:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzU3CJVCAZykH7j0e5GA+0lFsKCMSsNZb6h6Wi2If0xXKjOzF7WQF7+2utAQ47qUSyhBJEp X-Received: by 2002:a17:906:454d:: with SMTP id s13mr50315903ejq.319.1594209886040; Wed, 08 Jul 2020 05:04:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594209886; cv=none; d=google.com; s=arc-20160816; b=hy/VVpwSy0y6OLmgCuOy6VClZUsSjv1hX0OcW4NHyg7aKQUhEuKeIeJDJO56NSEfGO N1sVjwn9h2qVXktVfYyvQMvlgRWUsZQpYuhgztXzytksnGDX+i5f3+uPPPOSiPHH7whs jN0hZcEIaMFT7WL3JwRJMbDWFKeCwiSDXLzfqNENW9bpeuGaxwJ1OJQJAaFH5Ji+4Ih+ HOf6ePXjmigE5ZWCHa2offm0QxR3JDWYFMz6Y+xaOQ2yHy9QZ8JSKxYC0YjIQ+faPdk7 +DPl76Fu9YUZHuV5sUqR8HvFIWH7l6lnEFS7QwIlEQrjYZyKuVZ76O0gR8PFwlr4x+3V JBcg== 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=BThcPuAPbLXliwVFPv0L3H+H/bdCOBvmz8qTh5xz4Vk7PtFcokONLHhlnUe1U4548c v9Doa8dN7b/80gDpPjLBen05Q+SVtYBcX6M0XjFifU/NgkPZNitftBto/AQK6ZONUXwP l28jnOrvzn5qDbK4WpurpEOcflQBpK4oqvb5kOW9pCjVUADSWsy0iyV1MiV10eNyrWtZ ROpNaq3+JEXLcfZT/NnK3wwV6kRDIRntUyf9RxfBjqemgq8Al/+fGyqKpPsnCo041DXi /IVD5uYHcmx4LIRqr1i0m0CpWtMvHBE8rL50gr1ECaaNtsWP3b2J3Z5F8gmG9jcZ/Ff7 b3wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jqFRszdp; 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 a8si945803edr.123.2020.07.08.05.04.45 for ; Wed, 08 Jul 2020 05:04:46 -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=jqFRszdp; 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 S1729312AbgGHMEo (ORCPT ); Wed, 8 Jul 2020 08:04:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728977AbgGHMC2 (ORCPT ); Wed, 8 Jul 2020 08:02:28 -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 941E2C08C5DC for ; Wed, 8 Jul 2020 05:02:28 -0700 (PDT) Received: by mail-wm1-x344.google.com with SMTP id g10so3825930wmc.1 for ; Wed, 08 Jul 2020 05:02:28 -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=jqFRszdpAMk/WEosA8vCIRplw1s1iZVrYBQi444fVIoA249wMXPC1qA438UH/pbuQP Y10ZiE8f7eoJFYP7Cg3TfSow5vMIIKrfp4BoWdH+JPlXnbdl81a5gGetvj1SYKBgNf4F D35LtipJgz5JBrVEq+XnPNNiOHGzFPmjAwzdsQDMSptzo/0L1uaqMjWCMQSk2NEpk//M dZDsHlJINjfzhUqIRcSIdEAIWl/KwTxs3zuFSFQIS6xfqMoPsiLbmJS8520VaOUnJdPl 7iYbyatQKg/SdPNXYUQKn0Efp4F0tDOkI3pFXy8P79jDnb/eHuubmfN6cdgpM2dB5H3d FF7w== 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=b9SrUewiqYe6zEM6NDyHrmGPAlgWqWg/nsjJJrjHQW2jsdyFIy/LMaEYy1J42VSIUO Xi5gy5KjDxXjdvJbG2Xt0CXnT9+N6knc0QkXs9+8XSgfLh8Ud26up8x9FX4vJsXuROky UIV8BvsiPvSdoaEs2WmZU4v1IGKACb9rc67vbUNGjrSsBnRKg4DIgSSlUrgdZ+r7G4/O lvUC2BPBJKBaa23chfNfscn/sh36tOXVbiBFAqFMrChzdXqYP7kkeQOEcF2JLl7m96Hs zkHdXpPvUfaZvvg9W7ms8Lg0TWpd3+YTb9vVHlyp4yslUXA424R3Yy9STfAiGE+wj7Rn GRTA== X-Gm-Message-State: AOAM532Xdc9LdEJ7GyqHKA0Y4fDZF/NAJvTJGcFp26d9gm9oi0Blgvz8 LlePpwfrv1bZyQRgiLNBVcb3Xg== X-Received: by 2002:a1c:2842:: with SMTP id o63mr8902604wmo.169.1594209747310; Wed, 08 Jul 2020 05:02:27 -0700 (PDT) Received: from localhost.localdomain ([2.27.35.206]) by smtp.gmail.com with ESMTPSA id m62sm3964997wmm.42.2020.07.08.05.02.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jul 2020 05:02:26 -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 02/30] include: scsi: scsi_transport_fc: Match HBA Attribute Length with HBAAPI V2.0 definitions Date: Wed, 8 Jul 2020 13:01:53 +0100 Message-Id: <20200708120221.3386672-3-lee.jones@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200708120221.3386672-1-lee.jones@linaro.org> References: <20200708120221.3386672-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 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