From nobody Wed Feb 11 18:50:07 2026 Received: from mailtransmit04.runbox.com (mailtransmit04.runbox.com [185.226.149.37]) (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 14A772FFDC2; Tue, 9 Dec 2025 10:03:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.226.149.37 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765274617; cv=none; b=ZALPXkbeYQjVMIQnhfuU/3kueXI9KaGabk9+0S4OY6PFgHZyAys8k2YJu3mfPzJZFpYYVa69kpvx+7c+Oc+ZeBqMveCUYBYUdBz8N/tIit8+yBaA0Eydf0JnxneGRc/OBiqt8W9eI4lHi7tej0cSkzjb3Lxx777uOhT/NZjx1+E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765274617; c=relaxed/simple; bh=rP9m/rvG+prYCOhaV5Vk15KN9R/2YCE3Pl0ckBAm7Jc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ZXk5p+A9U2bdwnHBlUSbwpIoijoc0NJ6a2p99eNuyPvCvfT4Ac42RAtIg5BqHBXoCA+jkxDkb6p281B0GFZdipOS4i+qqPyW24m4dpEuTehH30gqoqhSPcQOUxLUK6g9fm1yWD4dknNpr0JqJ2B97kU7eiVCPW0gjDpidgpp+08= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=runbox.com; dkim=pass (2048-bit key) header.d=runbox.com header.i=@runbox.com header.b=ahMmWdVl; arc=none smtp.client-ip=185.226.149.37 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=runbox.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=runbox.com header.i=@runbox.com header.b="ahMmWdVl" Received: from mailtransmit02.runbox ([10.9.9.162] helo=aibo.runbox.com) by mailtransmit04.runbox.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1vSuZ7-00HD4r-Bh; Tue, 09 Dec 2025 11:03:29 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=runbox.com; s=selector2; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To :Message-Id:Date:Subject:Cc:To:From; bh=H2G28ggF6h59sr0IjReK2Fd4VYXjVxOwedV//eDOpk8=; b=ahMmWdVl8RLYzOF1MAadDGXmPt xiAVULaxy0b6WCEXncURcdHsvKgFllppN/7/PM0lipbp4T2aA7v7gtR4LOoqUlttXAXB/RkDo1Rs1 Glnti1EHMlGAQPmqgXtw+IMiS+npBsYIaLHTPt4OUY+bQE1ejrTMNBuLIxiDKQRyvAGidwWLTZCR+ yLQL3mPS9BvwWk4AhlbSTuKRKrtUI64a+XU6ghMHUbs6ilqpagwCy1S87ccKg+wlPy0KMBRU8SlRP ApkuNVAlW7JhmxkF7ycp0z6eWMMHaRTWatx70ihKcL/1/gpgPsldlmkzQiB5UNpoq97WCu1tcJWiD VSp2Wffg==; Received: from [10.9.9.73] (helo=submission02.runbox) by mailtransmit02.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1vSuZ6-0000Dx-LZ; Tue, 09 Dec 2025 11:03:28 +0100 Received: by submission02.runbox with esmtpsa [Authenticated ID (1493616)] (TLS1.2:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.93) id 1vSuZ1-00CND9-CB; Tue, 09 Dec 2025 11:03:23 +0100 From: david.laight.linux@gmail.com To: Yury Norov , Rasmus Villemoes , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, Geert Uytterhoeven , Alexandre Belloni , Jonathan Cameron , Crt Mori , Richard Genoud , Andy Shevchenko , Luo Jie , Peter Zijlstra , Jakub Kicinski , netdev@vger.kernel.org, "David S . Miller" , Simon Horman , Mika Westerberg , Andreas Noever , Yehezkel Bernat , Nicolas Frattaroli Cc: David Laight Subject: [PATCH 1/9] nfp: Call FIELD_PREP() in NFP_ETH_SET_BIT_CONFIG() wrapper Date: Tue, 9 Dec 2025 10:03:05 +0000 Message-Id: <20251209100313.2867-2-david.laight.linux@gmail.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20251209100313.2867-1-david.laight.linux@gmail.com> References: <20251209100313.2867-1-david.laight.linux@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: David Laight Rather than use a define that should be internal to the implementation of FIELD_PREP(), pass the shifted 'val' to nfp_eth_set_bit_config() and change the test for 'value unchanged' to match. This is a simpler change than the one used to avoid calling both FIELD_GET() and FIELD_PREP() with non-constant mask values. Signed-off-by: David Laight --- .../ethernet/netronome/nfp/nfpcore/nfp_nsp_eth.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp_eth.c b/dri= vers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp_eth.c index 5cfddc9a5d87..4a71ff47fbef 100644 --- a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp_eth.c +++ b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp_eth.c @@ -509,8 +509,7 @@ int nfp_eth_set_configured(struct nfp_cpp *cpp, unsigne= d int idx, bool configed) =20 static int nfp_eth_set_bit_config(struct nfp_nsp *nsp, unsigned int raw_idx, - const u64 mask, const unsigned int shift, - u64 val, const u64 ctrl_bit) + const u64 mask, u64 shifted_val, const u64 ctrl_bit) { union eth_table_entry *entries =3D nfp_nsp_config_entries(nsp); unsigned int idx =3D nfp_nsp_config_idx(nsp); @@ -527,11 +526,11 @@ nfp_eth_set_bit_config(struct nfp_nsp *nsp, unsigned = int raw_idx, =20 /* Check if we are already in requested state */ reg =3D le64_to_cpu(entries[idx].raw[raw_idx]); - if (val =3D=3D (reg & mask) >> shift) + if (shifted_val =3D=3D (reg & mask)) return 0; =20 reg &=3D ~mask; - reg |=3D (val << shift) & mask; + reg |=3D shifted_val; entries[idx].raw[raw_idx] =3D cpu_to_le64(reg); =20 entries[idx].control |=3D cpu_to_le64(ctrl_bit); @@ -571,12 +570,9 @@ int nfp_eth_set_idmode(struct nfp_cpp *cpp, unsigned i= nt idx, bool state) return nfp_eth_config_commit_end(nsp); } =20 -#define NFP_ETH_SET_BIT_CONFIG(nsp, raw_idx, mask, val, ctrl_bit) \ - ({ \ - __BF_FIELD_CHECK(mask, 0ULL, val, "NFP_ETH_SET_BIT_CONFIG: "); \ - nfp_eth_set_bit_config(nsp, raw_idx, mask, __bf_shf(mask), \ - val, ctrl_bit); \ - }) +#define NFP_ETH_SET_BIT_CONFIG(nsp, raw_idx, mask, val, ctrl_bit) \ + nfp_eth_set_bit_config(nsp, raw_idx, mask, FIELD_PREP(mask, val), \ + ctrl_bit) =20 /** * __nfp_eth_set_aneg() - set PHY autonegotiation control bit --=20 2.39.5