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: <20211119010957.n2aziuq5ijrgsxuo@skbuf>
Date:   Fri, 19 Nov 2021 03:09:57 +0200
From:   Vladimir Oltean <olteanv@...il.com>
To:     Ansuel Smith <ansuelsmth@...il.com>
Cc:     Andrew Lunn <andrew@...n.ch>,
        Vivien Didelot <vivien.didelot@...il.com>,
        Florian Fainelli <f.fainelli@...il.com>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Russell King <linux@...linux.org.uk>,
        linux-kernel@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [net-next PATCH 07/19] net: dsa: qca8k: set regmap init as
 mandatory for regmap conversion

On Wed, Nov 17, 2021 at 10:04:39PM +0100, Ansuel Smith wrote:
> In preparation for regmap conversion, make regmap init mandatory and
> fail if any error occurs.
> 
> Signed-off-by: Ansuel Smith <ansuelsmth@...il.com>
> ---

Huh. Odd that someone would initialize a regmap in a driver and then
proceed to not use it for anything. Looks like it's been sitting there
since 6b93fb46480a ("net-next: dsa: add new driver for qca8xxx family").

Reviewed-by: Vladimir Oltean <olteanv@...il.com>

>  drivers/net/dsa/qca8k.c | 14 ++++++++------
>  1 file changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c
> index ee04b48875e7..792b999da37c 100644
> --- a/drivers/net/dsa/qca8k.c
> +++ b/drivers/net/dsa/qca8k.c
> @@ -1110,6 +1110,14 @@ qca8k_setup(struct dsa_switch *ds)
>  	int cpu_port, ret, i;
>  	u32 mask;
>  
> +	/* Start by setting up the register mapping */
> +	priv->regmap = devm_regmap_init(ds->dev, NULL, priv,
> +					&qca8k_regmap_config);
> +	if (IS_ERR(priv->regmap)) {
> +		dev_err(priv->dev, "regmap initialization failed");
> +		return PTR_ERR(priv->regmap);
> +	}
> +
>  	/* Check the detected switch id */
>  	ret = qca8k_read_switch_id(priv);
>  	if (ret)
> @@ -1126,12 +1134,6 @@ qca8k_setup(struct dsa_switch *ds)
>  	if (ret)
>  		return ret;
>  
> -	/* Start by setting up the register mapping */
> -	priv->regmap = devm_regmap_init(ds->dev, NULL, priv,
> -					&qca8k_regmap_config);
> -	if (IS_ERR(priv->regmap))
> -		dev_warn(priv->dev, "regmap initialization failed");
> -
>  	ret = qca8k_setup_mdio_bus(priv);
>  	if (ret)
>  		return ret;
> -- 
> 2.32.0
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ