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 17F7E9467 for ; Fri, 24 Nov 2023 11:00:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Xb5YXvbz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6F67AC433C7; Fri, 24 Nov 2023 11:00:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700823615; bh=RoWlJ2va+y/OxqSBAjsmw7/96mjaT9pyzABKA6pSDt4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Xb5YXvbzQuc+IT1DrmFWUT0E5XW0ZdLmh5dpXmpaHUZKxZTGaCz9qVO46Ezu+BU7n 1cbWIItZdjPAhJkk5khCy1lr0Nq8TJI03Tw/5QAy5K34azVODhwqQKl8KVZ1UtdVjp FSsDP8IhPTFw8dRz95YHmJ1ok52FprbhSSjzJegQO1VVc0ViZwnybVNkS1OXe5re5d kWG84MMJsgMduQVA2N9PD8MdAjB4tO6M7hZ1q/90yNPBrF6+x/v9htrJphetolXr8U h4/UsixGQEwOSiAluN9D2xTsBnM66tglzQZkWvswEezgvnY8/rgMmFxER/XJLA9MSg rgZdsSE99Cr4g== Date: Fri, 24 Nov 2023 11:00:12 +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 04/13] i40e: field prep conversion Message-ID: <20231124110012.GD50352@kernel.org> References: <20231121211921.19834-1-jesse.brandeburg@intel.com> <20231121211921.19834-5-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-5-jesse.brandeburg@intel.com> On Tue, Nov 21, 2023 at 01:19:12PM -0800, Jesse Brandeburg wrote: > Refactor i40e 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. > > Refactor one function with multiple if's to return quickly to make lines > fit in 80 columns. > > @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