From: Shuah Khan <shuah@kernel.org>
To: Li Zhijian <lizhijian@cn.fujitsu.com>,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Pintu Agarwal <pintu.ping@gmail.com>, Shuah Khan <shuah@kernel.org>
Subject: Re: [PATCH v2] selftests/android: initialize heap_type to avoid compiling warning
Date: Wed, 11 Jul 2018 10:17:37 -0600 [thread overview]
Message-ID: <53f02d65-9a91-2661-3052-d46032389e3a@kernel.org> (raw)
In-Reply-To: <1531274880-9375-1-git-send-email-lizhijian@cn.fujitsu.com>
On 07/10/2018 08:08 PM, Li Zhijian wrote:
> root@vm-lkp-nex04-8G-7 ~/linux-v4.18-rc2/tools/testing/selftests/android# make
> 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../../../../../usr/include/ -Wall -O2 -g ionapp_export.c ipcsocket.c ionutils.c -o ionapp_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 <shuah@kernel.org>
> CC: Pintu Agarwal <pintu.ping@gmail.com>
> Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
> ---
> 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/testing/selftests/android/ion/ionapp_export.c
> index a944e72..b5fa0a2 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[])
>
> heap_size = 0;
> flags = 0;
> + heap_type = ION_HEAP_TYPE_SYSTEM;
>
> while ((opt = getopt(argc, argv, "hi:s:")) != -1) {
> switch (opt) {
>
Thanks. Applied to linux-kselftest next after updating the commit message
"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."
thanks,
-- Shuah
prev parent reply other threads:[~2018-07-11 16:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-11 2:08 [PATCH v2] selftests/android: initialize heap_type to avoid compiling warning Li Zhijian
2018-07-11 16:17 ` Shuah Khan [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53f02d65-9a91-2661-3052-d46032389e3a@kernel.org \
--to=shuah@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=lizhijian@cn.fujitsu.com \
--cc=pintu.ping@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).