Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1740131

[PATCH v2 14/14] platform/x86: dell-wmi-smbios: clean up wmi descriptor check

From Mario Limonciello <mario.limonciello@dell.com>
Newsgroups linux.kernel
Subject [PATCH v2 14/14] platform/x86: dell-wmi-smbios: clean up wmi descriptor check
Date 2017-09-26 21:00 +0200
Message-ID <uu3fl-8sI-45@gated-at.bofh.it> (permalink)
References <uu3fk-8sI-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Some cases the wrong type was used for errors and checks can be
done more cleanly.

Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
---
 drivers/platform/x86/dell-wmi-smbios.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/platform/x86/dell-wmi-smbios.c b/drivers/platform/x86/dell-wmi-smbios.c
index 232a9dd482b1..290e9853818b 100644
--- a/drivers/platform/x86/dell-wmi-smbios.c
+++ b/drivers/platform/x86/dell-wmi-smbios.c
@@ -340,16 +340,16 @@ int dell_wmi_check_descriptor_buffer(struct wmi_device *wdev, u32 *version)
 	}
 	desc_buffer = (u32 *)obj->buffer.pointer;
 
-	if (desc_buffer[0] != 0x4C4C4544 && desc_buffer[1] != 0x494D5720)
-		dev_warn(&wdev->dev, "Dell descriptor buffer has invalid signature (%*ph)\n",
-			8, desc_buffer);
+	if (strncmp(obj->string.pointer, "DELL WMI", 8) != 0)
+		dev_warn(&wdev->dev, "Dell descriptor buffer has invalid signature (%8ph)\n",
+			desc_buffer);
 
 	if (desc_buffer[2] != 0 && desc_buffer[2] != 1)
-		dev_warn(&wdev->dev, "Dell descriptor buffer has unknown version (%d)\n",
+		dev_warn(&wdev->dev, "Dell descriptor buffer has unknown version (%u)\n",
 			desc_buffer[2]);
 
 	if (desc_buffer[3] != 4096)
-		dev_warn(&wdev->dev, "Dell descriptor buffer has invalid buffer length (%d)\n",
+		dev_warn(&wdev->dev, "Dell descriptor buffer has invalid buffer length (%u)\n",
 			desc_buffer[3]);
 
 	*version = desc_buffer[2];
-- 
2.14.1

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 00/14] Introduce support for Dell SMBIOS over WMI Mario Limonciello <mario.limonciello@dell.com> - 2017-09-26 21:00 +0200
  [PATCH v2 06/14] platform/x86: wmi: Cleanup exit routine in reverse order of init Mario Limonciello <mario.limonciello@dell.com> - 2017-09-26 21:00 +0200
  [PATCH v2 09/14] platform/x86: dell-smbios: rename to dell-wmi-smbios Mario Limonciello <mario.limonciello@dell.com> - 2017-09-26 21:00 +0200
    Re: [PATCH v2 09/14] platform/x86: dell-smbios: rename to dell-wmi-smbios Pali Rohár <pali.rohar@gmail.com> - 2017-09-26 22:10 +0200
      RE: [PATCH v2 09/14] platform/x86: dell-smbios: rename to  dell-wmi-smbios <Mario.Limonciello@dell.com> - 2017-09-26 22:20 +0200
        Re: [PATCH v2 09/14] platform/x86: dell-smbios: rename to  dell-wmi-smbios Darren Hart <dvhart@infradead.org> - 2017-09-28 00:40 +0200
    Re: [PATCH v2 09/14] platform/x86: dell-smbios: rename to  dell-wmi-smbios kbuild test robot <lkp@intel.com> - 2017-09-29 17:40 +0200
  [PATCH v2 07/14] platform/x86: wmi: destroy on cleanup rather than unregister Mario Limonciello <mario.limonciello@dell.com> - 2017-09-26 21:00 +0200
  [PATCH v2 12/14] platform/x86: dell-wmi-smbios: introduce character device for userspace Mario Limonciello <mario.limonciello@dell.com> - 2017-09-26 21:00 +0200
    Re: [PATCH v2 12/14] platform/x86: dell-wmi-smbios: introduce  character device for userspace Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-09-26 21:10 +0200
    RE: [PATCH v2 12/14] platform/x86: dell-wmi-smbios: introduce  character device for userspace <Mario.Limonciello@dell.com> - 2017-09-26 22:20 +0200
    Re: [PATCH v2 12/14] platform/x86: dell-wmi-smbios: introduce character device for userspace Pali Rohár <pali.rohar@gmail.com> - 2017-09-26 22:20 +0200
  [PATCH v2 10/14] platform/x86: dell-wmi-smbios: Use Dell WMI descriptor check Mario Limonciello <mario.limonciello@dell.com> - 2017-09-26 21:00 +0200
  [PATCH v2 08/14] platform/x86: dell-smbios: Introduce a WMI-ACPI interface Mario Limonciello <mario.limonciello@dell.com> - 2017-09-26 21:00 +0200
    Re: [PATCH v2 08/14] platform/x86: dell-smbios: Introduce a WMI-ACPI  interface Darren Hart <dvhart@infradead.org> - 2017-09-28 00:20 +0200
  [PATCH v2 11/14] platform/x86: wmi: create character devices when requested by drivers Mario Limonciello <mario.limonciello@dell.com> - 2017-09-26 21:00 +0200
  [PATCH v2 01/14] platform/x86: dell-wmi: label driver as handling notifications Mario Limonciello <mario.limonciello@dell.com> - 2017-09-26 21:00 +0200
  [PATCH v2 13/14] platform/x86: Kconfig: Change the default settings for dell-wmi-smbios Mario Limonciello <mario.limonciello@dell.com> - 2017-09-26 21:00 +0200
  [PATCH v2 03/14] platform/x86: dell-wmi: Don't match on descriptor GUID modalias Mario Limonciello <mario.limonciello@dell.com> - 2017-09-26 21:00 +0200
    Re: [PATCH v2 03/14] platform/x86: dell-wmi: Don't match on  descriptor GUID modalias Darren Hart <dvhart@infradead.org> - 2017-09-27 19:30 +0200
      RE: [PATCH v2 03/14] platform/x86: dell-wmi: Don't match on  descriptor GUID modalias <Mario.Limonciello@dell.com> - 2017-09-27 19:40 +0200
        Re: [PATCH v2 03/14] platform/x86: dell-wmi: Don't match on  descriptor GUID modalias Darren Hart <dvhart@infradead.org> - 2017-09-27 19:50 +0200
  [PATCH v2 14/14] platform/x86: dell-wmi-smbios: clean up wmi descriptor check Mario Limonciello <mario.limonciello@dell.com> - 2017-09-26 21:00 +0200
    Re: [PATCH v2 14/14] platform/x86: dell-wmi-smbios: clean up wmi descriptor check Pali Rohár <pali.rohar@gmail.com> - 2017-09-26 22:20 +0200
      RE: [PATCH v2 14/14] platform/x86: dell-wmi-smbios: clean up wmi  descriptor check <Mario.Limonciello@dell.com> - 2017-09-26 22:30 +0200
  [PATCH v2 04/14] platform/x86: dell-smbios: Add pr_fmt definition to driver Mario Limonciello <mario.limonciello@dell.com> - 2017-09-26 21:00 +0200
  [PATCH v2 05/14] platform/x86: wmi: sort include list Mario Limonciello <mario.limonciello@dell.com> - 2017-09-26 21:00 +0200
  [PATCH v2 02/14] platform/x86: dell-smbios: drop needless includes Mario Limonciello <mario.limonciello@dell.com> - 2017-09-26 21:00 +0200
    Re: [PATCH v2 02/14] platform/x86: dell-smbios: drop needless  includes Darren Hart <dvhart@infradead.org> - 2017-09-27 19:50 +0200
      RE: [PATCH v2 02/14] platform/x86: dell-smbios: drop needless  includes <Mario.Limonciello@dell.com> - 2017-09-27 19:50 +0200
      Re: [PATCH v2 02/14] platform/x86: dell-smbios: drop needless  includes Darren Hart <dvhart@infradead.org> - 2017-09-27 20:00 +0200
  Re: [PATCH v2 00/14] Introduce support for Dell SMBIOS over WMI Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-09-26 21:10 +0200
    RE: [PATCH v2 00/14] Introduce support for Dell SMBIOS over WMI <Mario.Limonciello@dell.com> - 2017-09-26 21:20 +0200
      Re: [PATCH v2 00/14] Introduce support for Dell SMBIOS over WMI Darren Hart <dvhart@infradead.org> - 2017-09-27 19:20 +0200
        RE: [PATCH v2 00/14] Introduce support for Dell SMBIOS over WMI <Mario.Limonciello@dell.com> - 2017-09-27 19:40 +0200
          Re: [PATCH v2 00/14] Introduce support for Dell SMBIOS over WMI Darren Hart <dvhart@infradead.org> - 2017-09-27 19:40 +0200

csiph-web