From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E44D62076CA; Tue, 29 Oct 2024 20:00:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730232039; cv=none; b=ksh48eXD1hVfmui9Y30BQrcDHJmsZiYTC6jJsi2VkVbmn9ZlAbpkrmytYgH9YEVuNqcEWzsuPctDBhMYY0hiGhyj6p5oa9UJzoalfOcTor8WlemiMajZfCEjM08MhIi3ugXq1LY2SWo6mSFMZNMChqk7RubkSuL6LVOSC+iZj8I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730232039; c=relaxed/simple; bh=pKypalYakTpPySQDkMJhREf+MBtrrJGMKov0teHbvtk=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=q2QhVqSQ3Ch/GfNId1lSvaNisWokRPC6DRNEiiU4MlnXLMnCMljIIVQQxPaRe0TIbESaT5HsGr+QhEuQhVNjjrOyCowOtRe09b7InjzcM5PiyJEq3ES2/bOZgJp57IVbXbvxzHSAtYc/IWRdG8dkByvyJLEedVSx0AYVrjc2+7g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=dp5AxGKa; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="dp5AxGKa" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0B4D0C4CECD; Tue, 29 Oct 2024 20:00:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1730232038; bh=pKypalYakTpPySQDkMJhREf+MBtrrJGMKov0teHbvtk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=dp5AxGKaXzmIiJStJRelad+pUYQm4KxqYN4SrWpWXLi6ZuKnGyPo/mQQHUzyqglgb MhPQZKdDI7Vefl+hJRMia9y41Cn2cBCn9hJljRLpZN7xxPNuMRyCCQ/ibQqKc9JQqw heYtqN02nBBCPRSiQ/fLrKbx8FGhj50C1psB1jvB0XP2tP0VF74r6nmsNYLclqxBnh +UMDt7yg2ztjfrFdzV6z9iRpaQtnlMVFIhaPEJdwDMo9Om5FO7iPQR0K2DHXdMn7qZ 4GoN/Rxv6TZYDLgxRufzGvubwKekxoWRk8+pv7yt+7MqkRaTHUGLt2vrFwdCGZhjuy bhPnHO+3sfgdQ== Date: Tue, 29 Oct 2024 13:00:37 -0700 From: Jakub Kicinski To: "Gustavo A. R. Silva" Cc: "Gustavo A. R. Silva" , Michael Chan , Andrew Lunn , "David S. Miller" , Eric Dumazet , Paolo Abeni , Potnuri Bharat Teja , Christian Benvenuti , Satish Kharat , Manish Chopra , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH 2/2][next] net: ethtool: Avoid thousands of -Wflex-array-member-not-at-end warnings Message-ID: <20241029130037.2c7e96c7@kernel.org> In-Reply-To: <5aa93a65-e325-4c77-aaa8-5ef04f3b9697@embeddedor.com> References: <20241029065824.670f14fc@kernel.org> <20241029110845.0f9bb1cc@kernel.org> <7d227ced-0202-4f6e-9bc5-c2411d8224be@embeddedor.com> <20241029113955.145d2a2f@kernel.org> <26d37815-c652-418c-99b0-9d3e6ab78893@embeddedor.com> <20241029115426.3b0fcaff@kernel.org> <5aa93a65-e325-4c77-aaa8-5ef04f3b9697@embeddedor.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 29 Oct 2024 13:18:56 -0600 Gustavo A. R. Silva wrote: > By priority I mean if preserving the reverse xmas tree is a most > after any changes that mess in some way with it. As in the case below, > where things were already messed up: > > + const struct ethtool_link_settings_hdr *base = &lk_ksettings->base; > struct bnxt *bp = netdev_priv(dev); > struct bnxt_link_info *link_info = &bp->link_info; > - const struct ethtool_link_settings *base = &lk_ksettings->base; > bool set_pause = false; > u32 speed, lanes = 0; > int rc = 0; > > Should I leave the rest as-is, or should I now have to rearrange the whole > thing to accommodate for the convention? Don't rearrange the rest. The point is that if you touch a line you end up with a delete and an add. So you can as well move it to get it closer to the convention. But that's just nice to have, I brought the entire thing up because of the net/ethtool/ code which previously followed the convention and after changes it wouldn't. > How I see this, we can take a couple of directions: > > a) when things are already messed up, just implement your changes and leave > the rest as-is. This is acceptable, moving things closer to convention is nice to have. > b) when your changes mess things up, clean it up and accommodate for the > convention. Yes, if by "your changes mess things up" you mean that the code follows the convention exactly for a given function - then yes, the changes must remain complaint. Not sure why you say "clean it up", if the code is complaint you shouldn't break it. No touching of pre-existing code (other than modified lines) should be necessary. > extra option: > > c) this is probably going to be a case by case thing and we may ask you > to do more changes as we see fit. > > To be clear, I have no issue with c) (because it's basically how things > usually work), as long as maintainers don't expect v1 of any patch to > be in pristine form. In any other case, I would really like to be crystal > clear about what's expected and what's not.