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 EAB301642E for ; Fri, 24 Nov 2023 11:00:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="rMirdcIw" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3656DC433C8; Fri, 24 Nov 2023 11:00:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700823646; bh=fZnitmSPXZKwgPdo66YLsPoA9dTxzgOfY2rIV7jtyjQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rMirdcIwo+Xq2KpE8xH6kwLW/X9NWRIjhkC2dJV8cwJB1J4Lztd7CSrXvpzv5qpys bp/OYnOrEqCJ4SL5yBaKwcyRf8G4nQgfqNt7EzrkzRAXi/COtYu/3VlWqOUN7t+Bxs 27HGO2iqVAKLXJ9a+2lALzz0REjoaCd1TdscCXklVd5DBw26NFoyu6gDCRa3q3RlXT 1IE0UjLWsIubjperZxEZOvfBZRnW1ZH/MzIuvNnW6GFfCNrw9M1poKeCmhw1+6QbR0 DhB3tU9HmI5EkLQxmwxDCH62YcRzfSNrgaJxQQy5EWddgpwsDEQaeJCPFKB2siV1NM 4YhLsLDBWTUcg== Date: Fri, 24 Nov 2023 11:00:42 +0000 From: Simon Horman To: Jesse Brandeburg Cc: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, Julia Lawall , Marcin Szycik Subject: Re: [PATCH iwl-next v1 06/13] ice: field prep conversion Message-ID: <20231124110042.GF50352@kernel.org> References: <20231121211921.19834-1-jesse.brandeburg@intel.com> <20231121211921.19834-7-jesse.brandeburg@intel.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-Disposition: inline In-Reply-To: <20231121211921.19834-7-jesse.brandeburg@intel.com> On Tue, Nov 21, 2023 at 01:19:14PM -0800, Jesse Brandeburg wrote: > Refactor ice driver to use FIELD_PREP(), which reduces lines of code > and adds clarity of intent. > > This code was generated by the following coccinelle/spatch script and > then manually repaired. > > Several places I changed to OR into a single variable with |= instead of > using a multi-line statement with trailing OR operators, as it > (subjectively) makes the code clearer. > > A local variable vmvf_and_timeout was created and used to avoid multiple > logical ORs being __le16 converted, which shortened some lines and makes > the code cleaner. > > @prep@ > constant shift,mask; > type T; > expression a; > @@ > -(((T)(a) << shift) & mask) > +FIELD_PREP(mask, a) > > Cc: Julia Lawall > Reviewed-by: Marcin Szycik > Signed-off-by: Jesse Brandeburg Reviewed-by: Simon Horman