[2/4,next] i40e: Replace one-element array with flex-array member in struct i40e_profile_segment
Message ID | 52da391229a45fe3dbd5c43167cdb0701a17a361.1690938732.git.gustavoars@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f41:0:b0:3e4:2afc:c1 with SMTP id v1csp257182vqx; Tue, 1 Aug 2023 23:53:09 -0700 (PDT) X-Google-Smtp-Source: APBJJlEYi+e+aXSxeVpakSBZLgS6evpoSxWBZy6fgGvIbOUqzXPKdFEUXF1CNwNNwKhqXmwefZfk X-Received: by 2002:a05:6830:10d7:b0:6b9:b1b0:fcd1 with SMTP id z23-20020a05683010d700b006b9b1b0fcd1mr13710364oto.31.1690959189155; Tue, 01 Aug 2023 23:53:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690959189; cv=none; d=google.com; s=arc-20160816; b=BFeVnAyGnGiu8h9FwAq70jaXif7D5MznhgaCWN2EAvcey3XgnxySTaaAYnOs2AwCre A0vHQl5IDeUK/alE6Ztf/ArIMMpsr2YuzrCzJ9giyM0SuAhml2e3ifVnaZjglph1oxJe Y5xaxIqQlw9MBtKm/SDuBdbY9D5lXzWdMFvzSZ/egicGLWLENHJtw34HIwJAINXVO0xS ERekyf8i92lm7GfRbkbVwJdrpuRRYHj8+Zl4DWj8steXrdgSfOgLG7bZ/J7YVQYIEeGa IoDGBIFgZ3wkIwdMm0VJ9NWCPL0LExocL8sP3uYqGN7dU3iZxI3KDpMj33HljVSDG8xE 1AIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=pcqvn7KrGwtsXqh6yH5QHbwrgV/PyF8NBQKwzaw/5kk=; fh=Ld4bEJMliET3pg5SF4t5/bzEu7hB0dttY59G24FXQc0=; b=EPjszrdo2EPL5hnKil7r88Sae1xv9KSlQcBg9pMlfTZ5e35r20DYXBlAxCBMi+QIUg eOtHQrw5O3oIGaygs0W1gbhgo8MVumzi8YeLzHmkGWjbu8dm/+Ln1V0q3Dc1ossoUxS0 FLhP0Z7+KZ8nsyDxCNuATnSbdq8V+pQueYWRLn+eWRAbuClWlB2psa8l27CehMJLro8M WWgKd/4J1MZMVj7DtvJThcGuQDOkZp5E9bnzAjWP3yc/MImRfYDrXoiEzFN22mq59pMo NpJtc1zStGvlN1Fq0IbNrt/OgHryUCbVUG1cqeaqgnxGp68GFv/eXXDjF+LQ4ZmlUXCU nU2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=o9z225Vu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nl5-20020a17090b384500b00262f99a851asi762547pjb.96.2023.08.01.23.52.56; Tue, 01 Aug 2023 23:53:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=o9z225Vu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231901AbjHBFFY (ORCPT <rfc822;maxi.paulin@gmail.com> + 99 others); Wed, 2 Aug 2023 01:05:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232184AbjHBFFP (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 2 Aug 2023 01:05:15 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DB4E273A; Tue, 1 Aug 2023 22:04:56 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D21AA617C2; Wed, 2 Aug 2023 05:04:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26A01C433C8; Wed, 2 Aug 2023 05:04:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690952695; bh=20F4xPeEvNj9IuAftI9KVAMz4n8aQOzO8rp3P7fmGNc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=o9z225Vuo0O0cdGOCNgMKn+dvOU5eE4KM84og9IwU8gxi8fE1GdcLi226AenlSZDC vyN968CCLHAicKjG2npw9QyTqf5V/7QZu14QhJGEr4DkIVbWKR7qYIecWtVJzw1T7W EnZjm9vb2bb4d/bdiRASxZ05afIqPnbs8yXhC0nYM0Bqua4+iLDZ9cA8LvkqcX7Vsn nvgxRUpo8d1lo4C+hmsSlHKapcKTwO2CsB0UjWlgs+UD3Vz5T/i3qPzZGITD2F2V4M J9k1qrzUxWHpKqpbPVEyzMjyozTZzMyYntlUSlqJqOkJYXnhkJgBP5a4azkS2YzVeZ YeliueNUPZC5Q== Date: Tue, 1 Aug 2023 23:05:59 -0600 From: "Gustavo A. R. Silva" <gustavoars@kernel.org> To: Jesse Brandeburg <jesse.brandeburg@intel.com>, Tony Nguyen <anthony.l.nguyen@intel.com>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com> Cc: netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" <gustavoars@kernel.org>, linux-hardening@vger.kernel.org Subject: [PATCH 2/4][next] i40e: Replace one-element array with flex-array member in struct i40e_profile_segment Message-ID: <52da391229a45fe3dbd5c43167cdb0701a17a361.1690938732.git.gustavoars@kernel.org> References: <cover.1690938732.git.gustavoars@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <cover.1690938732.git.gustavoars@kernel.org> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773099222997686646 X-GMAIL-MSGID: 1773099222997686646 |
Series |
i40e: Replace one-element arrays with flexible-array members
|
|
Commit Message
Gustavo A. R. Silva
Aug. 2, 2023, 5:05 a.m. UTC
One-element and zero-length arrays are deprecated. So, replace
one-element array in struct i40e_profile_segment with flexible-array
member.
This results in no differences in binary output.
Link: https://github.com/KSPP/linux/issues/335
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
---
drivers/net/ethernet/intel/i40e/i40e_type.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Tue, Aug 01, 2023 at 11:05:59PM -0600, Gustavo A. R. Silva wrote: > One-element and zero-length arrays are deprecated. So, replace > one-element array in struct i40e_profile_segment with flexible-array > member. > > This results in no differences in binary output. > > Link: https://github.com/KSPP/linux/issues/335 > Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org> Reviewed-by: Simon Horman <horms@kernel.org>
> -----Original Message----- > From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of Gustavo A. R. Silva > Sent: Wednesday, August 2, 2023 10:36 AM > To: Brandeburg, Jesse <jesse.brandeburg@intel.com>; Nguyen, Anthony L <anthony.l.nguyen@intel.com>; David S. Miller <davem@davemloft.net>; Eric Dumazet <edumazet@google.com>; Jakub Kicinski <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com> > Cc: linux-hardening@vger.kernel.org; netdev@vger.kernel.org; intel-wired-lan@lists.osuosl.org; linux-kernel@vger.kernel.org; Gustavo A. R. Silva <gustavoars@kernel.org> > Subject: [Intel-wired-lan] [PATCH 2/4][next] i40e: Replace one-element array with flex-array member in struct i40e_profile_segment > > One-element and zero-length arrays are deprecated. So, replace one-element array in struct i40e_profile_segment with flexible-array member. > > This results in no differences in binary output. > > Link: https://github.com/KSPP/linux/issues/335 > Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org> > --- > drivers/net/ethernet/intel/i40e/i40e_type.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
On Tue, Aug 01, 2023 at 11:05:59PM -0600, Gustavo A. R. Silva wrote: > One-element and zero-length arrays are deprecated. So, replace > one-element array in struct i40e_profile_segment with flexible-array > member. > > This results in no differences in binary output. > > Link: https://github.com/KSPP/linux/issues/335 > Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org> > --- > drivers/net/ethernet/intel/i40e/i40e_type.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Tested-by: Justin Stitt <justinstitt@google.com> > > diff --git a/drivers/net/ethernet/intel/i40e/i40e_type.h b/drivers/net/ethernet/intel/i40e/i40e_type.h > index c3d5fe12059a..f7a984304b65 100644 > --- a/drivers/net/ethernet/intel/i40e/i40e_type.h > +++ b/drivers/net/ethernet/intel/i40e/i40e_type.h > @@ -1487,7 +1487,7 @@ struct i40e_profile_segment { > struct i40e_ddp_version version; > char name[I40E_DDP_NAME_SIZE]; > u32 device_table_count; > - struct i40e_device_id_entry device_table[1]; > + struct i40e_device_id_entry device_table[]; > }; > > struct i40e_section_table { > -- > 2.34.1 >
On Thu, Aug 10, 2023 at 05:34:04PM +0000, Justin Stitt wrote: > On Tue, Aug 01, 2023 at 11:05:59PM -0600, Gustavo A. R. Silva wrote: > > One-element and zero-length arrays are deprecated. So, replace > > one-element array in struct i40e_profile_segment with flexible-array > > member. > > > > This results in no differences in binary output. > > > > Link: https://github.com/KSPP/linux/issues/335 > > Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org> > > --- > > drivers/net/ethernet/intel/i40e/i40e_type.h | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > Tested-by: Justin Stitt <justinstitt@google.com> Whoops, this should be: Reviewed-by: Justin Stitt <justinstitt@google.com> I did not test, I just verified there are no binary differences produced by this patch. > > > > > diff --git a/drivers/net/ethernet/intel/i40e/i40e_type.h b/drivers/net/ethernet/intel/i40e/i40e_type.h > > index c3d5fe12059a..f7a984304b65 100644 > > --- a/drivers/net/ethernet/intel/i40e/i40e_type.h > > +++ b/drivers/net/ethernet/intel/i40e/i40e_type.h > > @@ -1487,7 +1487,7 @@ struct i40e_profile_segment { > > struct i40e_ddp_version version; > > char name[I40E_DDP_NAME_SIZE]; > > u32 device_table_count; > > - struct i40e_device_id_entry device_table[1]; > > + struct i40e_device_id_entry device_table[]; > > }; > > > > struct i40e_section_table { > > -- > > 2.34.1 > >
On 8/10/23 14:49, Justin Stitt wrote: > On Thu, Aug 10, 2023 at 05:34:04PM +0000, Justin Stitt wrote: >> On Tue, Aug 01, 2023 at 11:05:59PM -0600, Gustavo A. R. Silva wrote: >>> One-element and zero-length arrays are deprecated. So, replace >>> one-element array in struct i40e_profile_segment with flexible-array >>> member. >>> >>> This results in no differences in binary output. >>> >>> Link: https://github.com/KSPP/linux/issues/335 >>> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org> >>> --- >>> drivers/net/ethernet/intel/i40e/i40e_type.h | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >> Tested-by: Justin Stitt <justinstitt@google.com> > Whoops, this should be: > Reviewed-by: Justin Stitt <justinstitt@google.com> > > I did not test, I just verified there are no binary differences produced > by this patch. In that case, `Build-tested-by` seems more appropriate. Anyways, the series has been applied already. -- Gustavo
diff --git a/drivers/net/ethernet/intel/i40e/i40e_type.h b/drivers/net/ethernet/intel/i40e/i40e_type.h index c3d5fe12059a..f7a984304b65 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_type.h +++ b/drivers/net/ethernet/intel/i40e/i40e_type.h @@ -1487,7 +1487,7 @@ struct i40e_profile_segment { struct i40e_ddp_version version; char name[I40E_DDP_NAME_SIZE]; u32 device_table_count; - struct i40e_device_id_entry device_table[1]; + struct i40e_device_id_entry device_table[]; }; struct i40e_section_table {