From: Hans de Goede <hdegoede@redhat.com>
To: kernel test robot <lkp@intel.com>,
Maximilian Luz <luzmaximilian@gmail.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
Andy Shevchenko <andy.shevchenko@gmail.com>
Subject: Re: drivers/platform/surface/surface3-wmi.c:60:14: warning: variable 'status' set but not used
Date: Mon, 4 Jan 2021 15:52:26 +0100 [thread overview]
Message-ID: <184b4ec6-65f1-5a22-487b-20cc0fb1b587@redhat.com> (raw)
In-Reply-To: <202012291140.j73hBz45-lkp@intel.com>
Hi,
On 12/29/20 4:58 AM, kernel test robot wrote:
> Hi Maximilian,
>
> FYI, the error/warning still remains.
>
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: dea8dcf2a9fa8cc540136a6cd885c3beece16ec3
> commit: f23027ca3d48b6f93c5994069fb25b73539fdf34 platform/surface: Move Surface 3 WMI driver to platform/surface
> date: 9 weeks ago
> config: x86_64-randconfig-r001-20201221 (attached as .config)
> compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
> reproduce (this is a W=1 build):
> # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f23027ca3d48b6f93c5994069fb25b73539fdf34
> git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> git fetch --no-tags linus master
> git checkout f23027ca3d48b6f93c5994069fb25b73539fdf34
> # save the attached .config to linux build tree
> make W=1 ARCH=x86_64
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
>
> All warnings (new ones prefixed by >>):
>
> drivers/platform/surface/surface3-wmi.c: In function 's3_wmi_query_block':
>>> drivers/platform/surface/surface3-wmi.c:60:14: warning: variable 'status' set but not used [-Wunused-but-set-variable]
> 60 | acpi_status status;
> | ^~~~~~
I guess fixing this would require something like this:
From: Hans de Goede <hdegoede@redhat.com>
Subject: [PATCH] platform/surface: surface3-wmi: Fix variable 'status' set but not used compiler warning
Explictly check the status rather then relying on output.pointer staying
NULL on an error. This silences the following compiler warning:
drivers/platform/surface/surface3-wmi.c:60:14: warning: variable 'status' set but not used [-Wunused-but-set-variable]
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
drivers/platform/surface/surface3-wmi.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/platform/surface/surface3-wmi.c b/drivers/platform/surface/surface3-wmi.c
index 130b6f52a600..4b7f79c0b78e 100644
--- a/drivers/platform/surface/surface3-wmi.c
+++ b/drivers/platform/surface/surface3-wmi.c
@@ -63,6 +63,10 @@ static int s3_wmi_query_block(const char *guid, int instance, int *ret)
mutex_lock(&s3_wmi_lock);
status = wmi_query_block(guid, instance, &output);
+ if (ACPI_FAILURE(status)) {
+ error = -EIO;
+ goto out_free_unlock;
+ }
obj = output.pointer;
Maximilian, can you review and/or test this fix please ?
Regards,
Hans
next prev parent reply other threads:[~2021-01-04 14:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-29 3:58 kernel test robot
2021-01-04 14:52 ` Hans de Goede [this message]
2021-01-04 15:24 ` Maximilian Luz
2021-02-04 11:36 ` Hans de Goede
2021-02-04 15:10 ` Maximilian Luz
2021-02-09 1:52 kernel test robot
2021-02-09 10:12 ` Hans de Goede
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=184b4ec6-65f1-5a22-487b-20cc0fb1b587@redhat.com \
--to=hdegoede@redhat.com \
--cc=andy.shevchenko@gmail.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=luzmaximilian@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
all inboxes | Powered by JetHome®