[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aa6b93c6-f4a7-add7-13ed-d60ae4e749ca@codeaurora.org>
Date: Mon, 1 Feb 2021 12:44:51 +0530
From: Vijayanand Jitta <vjitta@...eaurora.org>
To: Stephen Rothwell <sfr@...b.auug.org.au>,
Andrew Morton <akpm@...ux-foundation.org>
Cc: Vinayak Menon <vinmenon@...eaurora.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linux Next Mailing List <linux-next@...r.kernel.org>
Subject: Re: linux-next: build warning after merge of the akpm tree
On 1/28/2021 2:16 PM, Stephen Rothwell wrote:
> Hi all,
>
> After merging the akpm tree, today's linux-next build (x86_64
> allmodconfig) produced this warning:
>
> lib/stackdepot.c: In function 'is_stack_depot_disabled':
> lib/stackdepot.c:154:2: warning: ignoring return value of 'kstrtobool' declared with attribute 'warn_unused_result' [-Wunused-result]
> 154 | kstrtobool(str, &stack_depot_disable);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Introduced by commit
>
> b9779abb09a8 ("lib: stackdepot: add support to disable stack depot")
>
> Interestingly, we have 2 declarations of kstrtobool - one in
> linux/kernel.h (which has __must_check) and one in linux/strings.h
> (which doesn't).
>
I have sent out the fix to lkml, Copied it below for your reference.
Please Feel free to apply or squash it to the original commit.
Thanks,
Vijay
--
From: Vijayanand Jitta <vjitta@...eaurora.org>
fix the below ignoring return value warning for kstrtobool
in is_stack_depot_disabled function.
lib/stackdepot.c: In function 'is_stack_depot_disabled':
lib/stackdepot.c:154:2: warning: ignoring return value of 'kstrtobool'
declared with attribute 'warn_unused_result' [-Wunused-result]
Fixes: b9779abb09a8 ("lib: stackdepot: add support to disable stack depot")
Signed-off-by: Vijayanand Jitta <vjitta@...eaurora.org>
---
lib/stackdepot.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/stackdepot.c b/lib/stackdepot.c
index cc21116..49f67a0 100644
--- a/lib/stackdepot.c
+++ b/lib/stackdepot.c
@@ -151,8 +151,10 @@ static struct stack_record **stack_table;
static int __init is_stack_depot_disabled(char *str)
{
- kstrtobool(str, &stack_depot_disable);
- if (stack_depot_disable) {
+ int ret;
+
+ ret = kstrtobool(str, &stack_depot_disable);
+ if (!ret && stack_depot_disable) {
pr_info("Stack Depot is disabled\n");
stack_table = NULL;
}
--
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a
member of Code Aurora Forum, hosted by The Linux Foundation
Powered by blists - more mailing lists