lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <37673fb9-b40d-4fb6-aa7b-09cc1fcd2499@lunn.ch>
Date: Wed, 22 Oct 2025 04:35:28 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Daniel Golle <daniel@...rotopia.org>
Cc: Hauke Mehrtens <hauke@...ke-m.de>, Vladimir Oltean <olteanv@...il.com>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	Russell King <linux@...linux.org.uk>, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	Andreas Schirm <andreas.schirm@...mens.com>,
	Lukas Stockmann <lukas.stockmann@...mens.com>,
	Alexander Sverdlin <alexander.sverdlin@...mens.com>,
	Peter Christen <peter.christen@...mens.com>,
	Avinash Jayaraman <ajayaraman@...linear.com>,
	Bing tao Xu <bxu@...linear.com>, Liang Xu <lxu@...linear.com>,
	Juraj Povazanec <jpovazanec@...linear.com>,
	"Fanni (Fang-Yi) Chan" <fchan@...linear.com>,
	"Benny (Ying-Tsan) Weng" <yweng@...linear.com>,
	"Livia M. Rosu" <lrosu@...linear.com>,
	John Crispin <john@...ozen.org>
Subject: Re: [PATCH net-next v3 3/7] net: dsa: lantiq_gswip: convert trivial
 accessor uses to regmap

On Sun, Oct 19, 2025 at 01:48:22PM +0100, Daniel Golle wrote:
> Use coccinelle semantic patch to convert all trivial uses of the register
> accessor functions to use the regmap API directly.
> 
> // Replace gswip_switch_w with regmap_write
> @@
> expression priv, val, offset;
> @@
> - gswip_switch_w(priv, val, offset)
> + regmap_write(priv->gswip, offset, val)
> 
> // Replace gswip_mdio_w with regmap_write
> @@
> expression priv, val, offset;
> @@
> - gswip_mdio_w(priv, val, offset)
> + regmap_write(priv->mdio, offset, val)
> 
> // Replace gswip_switch_r in simple assignment - only for u32
> @@
> expression priv, offset;
> u32 var;
> @@
> - var = gswip_switch_r(priv, offset)
> + regmap_read(priv->gswip, offset, &var)
> 
> // Replace gswip_switch_mask with regmap_set_bits when clear is 0
> @@
> expression priv, set, offset;
> @@
> - gswip_switch_mask(priv, 0, set, offset)
> + regmap_set_bits(priv->gswip, offset, set)
> 
> // Replace gswip_mdio_mask with regmap_set_bits when clear is 0
> @@
> expression priv, set, offset;
> @@
> - gswip_mdio_mask(priv, 0, set, offset)
> + regmap_set_bits(priv->mdio, offset, set)
> 
> // Replace gswip_switch_mask with regmap_clear_bits when set is 0
> @@
> expression priv, clear, offset;
> @@
> - gswip_switch_mask(priv, clear, 0, offset)
> + regmap_clear_bits(priv->gswip, offset, clear)
> 
> // Replace gswip_mdio_mask with regmap_clear_bits when set is 0
> @@
> expression priv, clear, offset;
> @@
> - gswip_mdio_mask(priv, clear, 0, offset)
> + regmap_clear_bits(priv->mdio, offset, clear)
> 
> Remove gswip_switch_w() and gswip_mdio_w() functions as they now no
> longer have any users.
> 
> Signed-off-by: Daniel Golle <daniel@...rotopia.org>

Reviewed-by: Andrew Lunn <andrew@...n.ch>

    Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ