[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20190206.201736.1146228626076916564.davem@davemloft.net>
Date: Wed, 06 Feb 2019 20:17:36 -0800 (PST)
From: David Miller <davem@...emloft.net>
To: yzhai003@....edu
Cc: csong@...ucr.edu, zhiyunq@...ucr.edu, peppe.cavallaro@...com,
alexandre.torgue@...com, maxime.ripard@...e-electrons.com,
wens@...e.org, netdev@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: stmmac: Variable "val" in function
sun8i_dwmac_set_syscon() could be uninitialized
From: Yizhuo <yzhai003@....edu>
Date: Tue, 5 Feb 2019 14:15:59 -0800
> @@ -639,9 +639,14 @@ static int sun8i_dwmac_set_syscon(struct stmmac_priv *priv)
> struct sunxi_priv_data *gmac = priv->plat->bsp_priv;
> struct device_node *node = priv->device->of_node;
> int ret;
> - u32 reg, val;
> + u32 reg, val = 0;
> +
> + ret = regmap_read(gmac->regmap, SYSCON_EMAC_REG, &val);
> + if (ret) {
> + dev_err(priv->device, "Fail to read SYSCON_EMAC_REG.\n");
> + return ret;
> + }
I agree with the other reviewer that since you check 'ret' the initialization of
'val' is no longer needed.
Powered by blists - more mailing lists