Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp123071imj; Thu, 7 Feb 2019 01:27:53 -0800 (PST) X-Google-Smtp-Source: AHgI3IYiv/rzMeUe66KCmbSA/b0wSXu0a33Oq0ZfeHOEBPgfuTQ4v1g6lxy9PuSndae3+Y9v0DYQ X-Received: by 2002:a17:902:9a81:: with SMTP id w1mr14936781plp.19.1549531673823; Thu, 07 Feb 2019 01:27:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549531673; cv=none; d=google.com; s=arc-20160816; b=CSCosGA8+AM07tXPqDOiVXcyHZbLLz7hlyQN7McNryFuzXMmqDnJ+bNRD51bnFTrmr pKDX7hq1F0cII0xCM5FRE+gIiAU7etGYHq/YKCcHBjCZLuYOpnpVLHEIw8IOsMSiX+Cv 7ue1wpyYDQBqlJ9aDBYL+IgJG9hwWhvqtN2Qez83y0RXf3ANdQy/kNys6x68+SKyFcwQ bfU44Kw1P8E3DOI2QFTeG8yUjUnTg+YFJ6Fmrz0W2hTewuXYOQgDanpcxA+5J+s11G9g XRaozXnTCxdT1zzQjIZgDlBy0dmS9UyssVI0Jz+WQg2WfeVLOXSh26Xontum6oHM+gRw lcrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=PF38LFl/FdUlOM8AjgyIAAKDpV7127bK/UzpmvajBfM=; b=PIbgw/m9G30jgvaDw9IoFIgsv3wVBjgv8yHBRRTZOz9ydOg+4v/j3RXkRbmxJFfjnq tQcvzUvlW/FXEWCgRV9CVvYu2RWK8S4fmFfQOX1o6nrYg1A1mQpsZcPc781KaPq+97mz UBni3YFj0UUlpeUMR7dOomj9dhnPkw5T2KFm3PU9mzFDVEhkjD0vnQNM4P6alFTVxIYi K8qSvQds2ubbJX2aFFvXWCTlt0j34mQLKOfMLCzCwLycwIOXDCBVgCH61oxUv9PzwcQb Bwoo3Tw7/q3HrWUOQq2e4JSGh2i7OLAoLKkQRBmcs0/5b5NoLxVsNtSh05iLCQFmFaHi vraQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a2si7142952pgw.264.2019.02.07.01.27.38; Thu, 07 Feb 2019 01:27:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727122AbfBGJZi (ORCPT + 99 others); Thu, 7 Feb 2019 04:25:38 -0500 Received: from relay11.mail.gandi.net ([217.70.178.231]:45035 "EHLO relay11.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726809AbfBGJY6 (ORCPT ); Thu, 7 Feb 2019 04:24:58 -0500 Received: from localhost (aaubervilliers-681-1-80-177.w90-88.abo.wanadoo.fr [90.88.22.177]) (Authenticated sender: maxime.ripard@bootlin.com) by relay11.mail.gandi.net (Postfix) with ESMTPSA id D3DD210000F; Thu, 7 Feb 2019 09:24:54 +0000 (UTC) Date: Thu, 7 Feb 2019 10:24:54 +0100 From: Maxime Ripard To: Yizhuo Zhai Cc: David Miller , Chengyu Song , Zhiyun Qian , Giuseppe Cavallaro , Alexandre Torgue , Chen-Yu Tsai , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: stmmac: Variable "val" in function sun8i_dwmac_set_syscon() could be uninitialized Message-ID: <20190207092454.xq5jvnfnuhcp37nm@flea> References: <20190205221559.17545-1-yzhai003@ucr.edu> <20190206.201736.1146228626076916564.davem@davemloft.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="b2zwkslu724bwfel" Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --b2zwkslu724bwfel Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Feb 06, 2019 at 09:53:16PM -0800, Yizhuo Zhai wrote: >=20 >=20 > On Wed, Feb 6, 2019 at 9:52 PM Yizhuo Zhai wrote: > > > > Thanks, but why initialization matters here? Is performance the main co= ncern? > > > > On Wed, Feb 6, 2019 at 8:17 PM David Miller wrote: > >> > >> From: Yizhuo > >> 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 =3D priv->plat->bsp_priv; > >> > struct device_node *node =3D priv->device->of_node; > >> > int ret; > >> > - u32 reg, val; > >> > + u32 reg, val =3D 0; > >> > + > >> > + ret =3D 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 initial= ization of > >> 'val' is no longer needed. > > Thanks, but why initialization matters here? Is performance the main > concern? Not really, but if we turn this the other way around, why should we do something that doesn't bring anything? Maxime --=20 Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com --b2zwkslu724bwfel Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCXFv5ZgAKCRDj7w1vZxhR xbinAQCsh3JO2mI1qvmsvNyCd6VyFGOI43tcOkD82skXiUg9dAD/YvGF3TSHZJKp cAOI+cr8VR4R3TTVsQD56oQioQFJfQY= =RDQE -----END PGP SIGNATURE----- --b2zwkslu724bwfel--