From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="GkT/vgw1" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1302D3 for ; Wed, 6 Dec 2023 00:22:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701850945; x=1733386945; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=1jRA3HwtbtIDHZrW+rnVUKgEuSqeWhnsqzgAyyeUTjE=; b=GkT/vgw104c+hlpeetCZpJfJ/QA1YYZHPJQQkcTjEHu9Jr+RMaFwlsKn RCR4h07mKCYOqorwd6LxHYggmTsVZXh1WOMkcf+MwqTTlX/7jC0pdod0C cn5O0SihZeK6YQV005WLdpMsepC/g6XvgKrcvPjUNqEM++PmtnpCSu8a+ yAFYYJppb7Afnsc7EO0lkgreOoY+4ThEEng+0vLqfpuWc+ZxdVu0pnJnJ 3KiJ7raYUiVEjSKUGSL/Ko0v72oRSg4frLEMGZN0ogfZXCBKuNqGh6yHP ADBjNS9jUFoL0a9k14TgXby3CJ1wH2gmQV8D6HcgdrLuKFssN9o5RY5p2 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10915"; a="7376354" X-IronPort-AV: E=Sophos;i="6.04,254,1695711600"; d="scan'208";a="7376354" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Dec 2023 00:22:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10915"; a="747522206" X-IronPort-AV: E=Sophos;i="6.04,254,1695711600"; d="scan'208";a="747522206" Received: from naamamex-mobl.ger.corp.intel.com (HELO [10.12.48.131]) ([10.12.48.131]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Dec 2023 00:22:23 -0800 Message-ID: <41a1392c-0e82-4906-8744-fd527d18f6aa@linux.intel.com> Date: Wed, 6 Dec 2023 10:22:21 +0200 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [Intel-wired-lan] [PATCH iwl-next v1 10/13] igc: field get conversion Content-Language: en-US To: Jesse Brandeburg , intel-wired-lan@lists.osuosl.org Cc: Julia Lawall , netdev@vger.kernel.org, Marcin Szycik References: <20231121211921.19834-1-jesse.brandeburg@intel.com> <20231121211921.19834-11-jesse.brandeburg@intel.com> From: "naamax.meir" In-Reply-To: <20231121211921.19834-11-jesse.brandeburg@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 11/21/2023 23:19, Jesse Brandeburg wrote: > Refactor the igc driver to use FIELD_GET() for mask and shift reads, > which reduces lines of code and adds clarity of intent. > > This code was generated by the following coccinelle/spatch script and > then manually repaired in a later patch. > > @get@ > constant shift,mask; > expression a; > @@ > -((a & mask) >> shift) > +FIELD_GET(mask, a) > > and applied via: > spatch --sp-file field_prep.cocci --in-place --dir \ > drivers/net/ethernet/intel/ > > Cc: Julia Lawall > Reviewed-by: Marcin Szycik > Signed-off-by: Jesse Brandeburg > --- > drivers/net/ethernet/intel/igc/igc_base.c | 6 ++---- > drivers/net/ethernet/intel/igc/igc_i225.c | 5 ++--- > drivers/net/ethernet/intel/igc/igc_main.c | 6 ++---- > drivers/net/ethernet/intel/igc/igc_phy.c | 4 ++-- > 4 files changed, 8 insertions(+), 13 deletions(-) Tested-by: Naama Meir