From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-eopbgr720090.outbound.protection.outlook.com ([40.107.72.90]:59680 "EHLO NAM05-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727866AbeIOGsn (ORCPT ); Sat, 15 Sep 2018 02:48:43 -0400 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Li Zhijian , Shuah Khan , Pintu Agarwal , Sasha Levin Subject: [PATCH AUTOSEL 4.18 69/92] selftests/android: initialize heap_type to avoid compiling warning Date: Sat, 15 Sep 2018 01:30:38 +0000 Message-ID: <20180915012944.179481-68-alexander.levin@microsoft.com> References: <20180915012944.179481-1-alexander.levin@microsoft.com> In-Reply-To: <20180915012944.179481-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Li Zhijian [ Upstream commit cc7c673032fc7427087e74b75f732b43db38a256 ] Initialize heap_type to ION_HEAP_TYPE_SYSTEM to avoid "used uninitialized" compiler warning. heap_type gets used after initialization, this change is to just keep the compiler happy. root@vm-lkp-nex04-8G-7 ~/linux-v4.18-rc2/tools/testing/selftests/android# m= ake make[1]: warning: jobserver unavailable: using -j1. Add '+' to parent make= rule. make[1]: Entering directory '/root/linux-v4.18-rc2/tools/testing/selftests/= android/ion' gcc -I. -I../../../../../drivers/staging/android/uapi/ -I../../../../../us= r/include/ -Wall -O2 -g ionapp_export.c ipcsocket.c ionutils.c -o iona= pp_export ionapp_export.c: In function 'main': ionapp_export.c:91:2: warning: 'heap_type' may be used uninitialized in this function [-Wmaybe-uninitialized] printf("heap_type: %ld, heap_size: %ld\n", heap_type, heap_size); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ CC: Shuah Khan CC: Pintu Agarwal Signed-off-by: Li Zhijian Signed-off-by: Shuah Khan (Samsung OSG) Signed-off-by: Sasha Levin --- tools/testing/selftests/android/ion/ionapp_export.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/android/ion/ionapp_export.c b/tools/te= sting/selftests/android/ion/ionapp_export.c index a944e72621a9..b5fa0a2dc968 100644 --- a/tools/testing/selftests/android/ion/ionapp_export.c +++ b/tools/testing/selftests/android/ion/ionapp_export.c @@ -51,6 +51,7 @@ int main(int argc, char *argv[]) =20 heap_size =3D 0; flags =3D 0; + heap_type =3D ION_HEAP_TYPE_SYSTEM; =20 while ((opt =3D getopt(argc, argv, "hi:s:")) !=3D -1) { switch (opt) { --=20 2.17.1