Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1535906ybh; Mon, 13 Jul 2020 23:51:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVZalkACjnZIrqta/cUwgAcLB/uu6ZmKUGBvOHUQJgzJoIe/ihd9TdAjuNVtZFToJ8ZU/u X-Received: by 2002:a05:6402:143c:: with SMTP id c28mr3166173edx.54.1594709465021; Mon, 13 Jul 2020 23:51:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594709465; cv=none; d=google.com; s=arc-20160816; b=uZ5T8HascH20PXu56v4Y9b9g+kUJTk8WhRvOLDyhgryO9Jo8jZMckqGxaLjJ6kyM0E EkqEfMGnIABSxYhrVzVgG1iMtrL1B+fuS9vZ3WCFpWxjWc1UWgoQpozw6hG7MDUN471u WV5WfjV8oTkDIdM1Mn/NllJGjwCsyMFOblbHrnigRmN8U4f861yK6OY70nlz3bXKttk9 WTQ+5Ar6sw/6/9UNYTJz9obHV1SLVaet2ApvtPw7REP5fpF3g0LgozgoZqeukaK9IA5G gk94xABSGbaLbxGi1aLsAX0hPfhO5utZNSwNZ74sh3UTKm1l4rKfEj9/dkIJR6nAhLNk eI4A== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=JA6gdPD8oVqTWtfkJwfDB9ysZVNbrKgCg2ufqNxJj/c=; b=xuaYN+PoISa3wbcKdpIt23WHIhEh+wcRV98EcOa+lk0DaWQCYxiY52KiTvsJQgK6d8 y4CX0sKm6aFRISzFQcuhx9k4cZORyD3rV4+nMKMHhHtFcwqUo7M389DjAdzCIkVvy2j4 QWonOrDhAugHXbYz2XD6pIFEL5dQJ4Jt+uqjBayg3otzW8jfHoHlF1iDB00WmqFFBtEL lUFVrMngP6fnWo0Ci9Cb28puKMgdgvsrOVN9PTigEQrRnThZHyg4pP8Xk4K2xkXyT/GX bRIZS1J6UvlJiMuiPgmG6lGyTb9qHYFBJh9YfMktkLa7CqszqwF+2ibSx4HirKcAbkQ9 ZoqA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v14si10893587eje.123.2020.07.13.23.50.42; Mon, 13 Jul 2020 23:51:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726889AbgGNGtK (ORCPT + 99 others); Tue, 14 Jul 2020 02:49:10 -0400 Received: from mx2.suse.de ([195.135.220.15]:55994 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725788AbgGNGtJ (ORCPT ); Tue, 14 Jul 2020 02:49:09 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 0345CACC6; Tue, 14 Jul 2020 06:49:10 +0000 (UTC) Subject: Re: [PATCH v2 02/29] include: scsi: scsi_transport_fc: Match HBA Attribute Length with HBAAPI V2.0 definitions To: Lee Jones , jejb@linux.ibm.com, martin.petersen@oracle.com Cc: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org References: <20200713074645.126138-1-lee.jones@linaro.org> <20200713074645.126138-3-lee.jones@linaro.org> From: Hannes Reinecke Message-ID: <52269484-8df0-38f7-2be3-b0a10ff9696d@suse.de> Date: Tue, 14 Jul 2020 08:49:05 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <20200713074645.126138-3-lee.jones@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/13/20 9:46 AM, Lee Jones wrote: > 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(-) > > 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 > Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes Reinecke Teamlead Storage & Networking hare@suse.de +49 911 74053 688 SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer