From nobody Fri Oct 3 10:11:28 2025 Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) (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 7154F283FD8; Tue, 2 Sep 2025 23:36:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.142.180.65 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756856203; cv=none; b=plBFEvM9KP7nnkWoEyse5bdpIGf26s1Hp7r7URkEWLh8AwuQMfC/IaXf48ZLLjXa3YL0nXeEWECTPhrhuwi4bSNvQNLmj7o0Mpk3ZNDZEwUR70S38pEdpjaHIMhkDjsEi/5i1Q+qbkLSyKe6DTkQOBs3huCkwPnU3rQuOJue+as= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756856203; c=relaxed/simple; bh=SqW5rL6tPt8FEZ6wHBs4qEYofN3IQ+erQHIFkyk6/O8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=OmR621UCtZ+KuK4q4Q6X5NoBVk3C0lI2G0r3rrIKVPv37aMdcpkFTTLJIcAiVBpUPCDKQPlk/fNw+zyhs9l4nNIzQzPHtv1WzCBTfprATmMWKiTEWFdiF2LqKDy8MbTOKGoqKvAacUF1vbF9yYiIFiPudeAl/zPS7MLMrupdrHI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org; spf=pass smtp.mailfrom=makrotopia.org; arc=none smtp.client-ip=185.142.180.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=makrotopia.org Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.98.2) (envelope-from ) id 1utaYF-000000001J9-3i0s; Tue, 02 Sep 2025 23:36:35 +0000 Date: Wed, 3 Sep 2025 00:36:32 +0100 From: Daniel Golle To: Hauke Mehrtens , Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Russell King , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andreas Schirm , Lukas Stockmann , Alexander Sverdlin , Peter Christen , Avinash Jayaraman , Bing tao Xu , Liang Xu , Juraj Povazanec , "Fanni (Fang-Yi) Chan" , "Benny (Ying-Tsan) Weng" , "Livia M. Rosu" , John Crispin Subject: [RFC PATCH net-next 5/6] net: dsa: lantiq_gswip: optimize regmap_write_bits() statements Message-ID: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Further optimize the previous naive conversion of the *_mask() accessor functions to regmap_write_bits by manually removing redundant mask operands. Signed-off-by: Daniel Golle --- drivers/net/dsa/lantiq/lantiq_gswip.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/net/dsa/lantiq/lantiq_gswip.c b/drivers/net/dsa/lantiq= /lantiq_gswip.c index 1fd18b3899b7..b26daf39d3d2 100644 --- a/drivers/net/dsa/lantiq/lantiq_gswip.c +++ b/drivers/net/dsa/lantiq/lantiq_gswip.c @@ -278,7 +278,7 @@ static int gswip_pce_table_entry_read(struct gswip_priv= *priv, regmap_write_bits(priv->gswip, GSWIP_PCE_TBL_CTRL, GSWIP_PCE_TBL_CTRL_ADDR_MASK | GSWIP_PCE_TBL_CTRL_OPMOD_MASK | - tbl->table | addr_mode | GSWIP_PCE_TBL_CTRL_BAS, + GSWIP_PCE_TBL_CTRL_BAS, tbl->table | addr_mode | GSWIP_PCE_TBL_CTRL_BAS); =20 err =3D gswip_switch_r_timeout(priv, GSWIP_PCE_TBL_CTRL, @@ -342,8 +342,7 @@ static int gswip_pce_table_entry_write(struct gswip_pri= v *priv, regmap_write(priv->gswip, GSWIP_PCE_TBL_ADDR, tbl->index); regmap_write_bits(priv->gswip, GSWIP_PCE_TBL_CTRL, GSWIP_PCE_TBL_CTRL_ADDR_MASK | - GSWIP_PCE_TBL_CTRL_OPMOD_MASK | - tbl->table | addr_mode, + GSWIP_PCE_TBL_CTRL_OPMOD_MASK, tbl->table | addr_mode); =20 for (i =3D 0; i < ARRAY_SIZE(tbl->key); i++) @@ -354,8 +353,7 @@ static int gswip_pce_table_entry_write(struct gswip_pri= v *priv, =20 regmap_write_bits(priv->gswip, GSWIP_PCE_TBL_CTRL, GSWIP_PCE_TBL_CTRL_ADDR_MASK | - GSWIP_PCE_TBL_CTRL_OPMOD_MASK | - tbl->table | addr_mode, + GSWIP_PCE_TBL_CTRL_OPMOD_MASK, tbl->table | addr_mode); =20 regmap_write(priv->gswip, GSWIP_PCE_TBL_MASK, tbl->mask); --=20 2.51.0