From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jaegeuk Kim Subject: Re: [PATCH 1/6] f2fs: fix the compiler warning for uninitialized use of variable Date: Mon, 03 Dec 2012 07:56:11 +0900 Message-ID: <1354488971.18849.8.camel@kjgkr> References: <1354326912-6656-1-git-send-email-linkinjeon@gmail.com> Reply-To: jaegeuk.kim@samsung.com Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-c8ekLThtiR3leZS2u5F5" Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Namjae Jeon , Pankaj Kumar , linux-f2fs-devel@lists.sourceforge.net To: Namjae Jeon Return-path: Received: from mailout1.samsung.com ([203.254.224.24]:11164 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753477Ab2LBW4l (ORCPT ); Sun, 2 Dec 2012 17:56:41 -0500 In-reply-to: <1354326912-6656-1-git-send-email-linkinjeon@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: --=-c8ekLThtiR3leZS2u5F5 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Please, add CC: linux-f2fs-devel@lists.sourceforge.net Thank you for contribution to f2fs. Looks good, and I'll merge them. Thanks, 2012-12-01 (=ED=86=A0), 10:55 +0900, Namjae Jeon: > From: Namjae Jeon >=20 > When CONFIG_CC_OPTIMIZE_FOR_SIZE is enabled in the kernel, -Os optimisati= on > flag is passed to gcc for compilation, and somehow while trying to optimi= ze > the code, compiler is might not able to see the initialisation of variabl= e > ne struct variable inside the get_node_info() function and results into > following warning: >=20 > fs/f2fs/node.c: In function 'get_node_info': > fs/f2fs/node.c:175:3: warning: 'ne.block_addr' may be used uninitialized = in > this function [-Wuninitialized] > fs/f2fs/node.c:265:24: note: 'ne.block_addr' was declared here > fs/f2fs/node.c:176:3: warning: 'ne.ino' may be used uninitialized in this > function [-Wuninitialized] > fs/f2fs/node.c:265:24: note: 'ne.ino' was declared here > fs/f2fs/node.c:177:3: warning: 'ne.version' may be used uninitialized in > this function [-Wuninitialized] > fs/f2fs/node.c:265:24: note: 'ne.version' was declared here >=20 > Hence, lets initialise the ne struct variable to zero, which will remove > this warning and also doing this does not seems to making any impact on t= he > code behavior. >=20 > Signed-off-by: Namjae Jeon > Signed-off-by: Pankaj Kumar > --- > fs/f2fs/node.c | 1 + > 1 file changed, 1 insertion(+) >=20 > diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c > index 25d3036..1987036 100644 > --- a/fs/f2fs/node.c > +++ b/fs/f2fs/node.c > @@ -266,6 +266,7 @@ void get_node_info(struct f2fs_sb_info *sbi, nid_t ni= d, struct node_info *ni) > struct nat_entry *e; > int i; > =20 > + memset(&ne, 0, sizeof(struct f2fs_nat_entry)); > ni->nid =3D nid; > =20 > /* Check nat cache */ --=20 Jaegeuk Kim Samsung --=-c8ekLThtiR3leZS2u5F5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAABAgAGBQJQu9yLAAoJEEAUqH6CSFDSVCsP/1hPjaFBKftLivru6LOJWfEr usCqo43mcHuijZ8tebhSvcwm0zHYWcD7qWMMEJq9F69Y8ziSSHW6SufembH36Rpx uaFG1T5RogcxSoBII0RcECo5wgtMYYszRj72niQEnsKU2tMlKmLcpmZMJ1lCoHSW NC4cMGsG945qMSIVtMEDdCLz3mRnYvoZ1a1fD9+MgSx0/JMIgoy38grPKqqVNGQO Gugf6knvV4unvkIpIdM++CjTR2xo/Wn4GnK8YBt8F9W5IY2UGivwDz7aYAjW4eKX 7Cub/zinSizCxnGNIi/yZYmMw0cPjJqw5gpAQVFnCnie6udjvsbmDSqj5V5kLMyn KlVECZhzPivqnVxC0rH39PU6XgKJAWOO51IjCKimJJ3SUy+xxB4DYFDD3BqxCX+l eyyVFswkGJek41B+DSgyvYS93rWeyRUaHq/XeACvxxpY/TjlknXoW62kz6ic9Hfw NUwmnOLaoHoJwbG8VeZxLBAamOWzy02Q/4f18EKHtHAX+XwMSOyhwH7KudaOp3/K 9tHvdx589MQgxpc7RsfndjsPaZKTkYm2XoMB+BCG0L8QlvuJbEg+Kk9n1gfK29tm De7UvdI5yzvo9XJlzjiaGk0/6VUN0nceuG4H6jRScz80U88AwcyTwfWOlP/0Uwt8 8EP9gyiFh7BcMuSzWqeo =Sq7G -----END PGP SIGNATURE----- --=-c8ekLThtiR3leZS2u5F5--