linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Perry Yuan <Perry.Yuan@dell.com>,
	hdegoede@redhat.com, mgross@linux.intel.com, mjg59@srcf.ucam.org,
	pali@kernel.org
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
	platform-driver-x86@vger.kernel.org,
	perry_yuan <Perry.Yuan@dell.com>,
	Limonciello Mario <Mario.Limonciello@dell.com>
Subject: Re: [PATCH]  platform/x86: dell-privacy: Add support for new privacy driver
Date: Wed, 4 Nov 2020 14:43:34 +0800	[thread overview]
Message-ID: <202011041450.cZhM2aWP-lkp@intel.com> (raw)
In-Reply-To: <20201103125542.8572-1-Perry_Yuan@Dell.com>

[-- Attachment #1: Type: text/plain, Size: 8594 bytes --]

Hi Perry,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v5.10-rc2]
[cannot apply to next-20201103]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Perry-Yuan/platform-x86-dell-privacy-Add-support-for-new-privacy-driver/20201103-205721
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git b7cbaf59f62f8ab8f157698f9e31642bff525bd0
config: x86_64-randconfig-m001-20201104 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

smatch warnings:
drivers/platform/x86/dell-wmi.c:414 dell_wmi_notify() warn: inconsistent indenting
drivers/platform/x86/dell-laptop.c:2207 dell_init() warn: inconsistent indenting
drivers/platform/x86/dell-laptop.c:2289 dell_exit() warn: inconsistent indenting
drivers/platform/x86/dell-laptop.c:2291 dell_exit() warn: curly braces intended?

vim +414 drivers/platform/x86/dell-wmi.c

83fc44c32ad8b8b Pali Rohár      2014-11-11  377  
bff589be59c5092 Andy Lutomirski 2015-11-25  378  static void dell_wmi_notify(struct wmi_device *wdev,
bff589be59c5092 Andy Lutomirski 2015-11-25  379  			    union acpi_object *obj)
0b3f6109f0c9ff9 Matthew Garrett 2009-01-09  380  {
00ebbeb39b70072 Andy Lutomirski 2017-08-01  381  	struct dell_wmi_priv *priv = dev_get_drvdata(&wdev->dev);
83fc44c32ad8b8b Pali Rohár      2014-11-11  382  	u16 *buffer_entry, *buffer_end;
bff589be59c5092 Andy Lutomirski 2015-11-25  383  	acpi_size buffer_size;
83fc44c32ad8b8b Pali Rohár      2014-11-11  384  	int len, i;
0b3f6109f0c9ff9 Matthew Garrett 2009-01-09  385  
83fc44c32ad8b8b Pali Rohár      2014-11-11  386  	if (obj->type != ACPI_TYPE_BUFFER) {
83fc44c32ad8b8b Pali Rohár      2014-11-11  387  		pr_warn("bad response type %x\n", obj->type);
5ea2559726b7862 Rezwanul Kabir  2009-11-02  388  		return;
5ea2559726b7862 Rezwanul Kabir  2009-11-02  389  	}
5ea2559726b7862 Rezwanul Kabir  2009-11-02  390  
83fc44c32ad8b8b Pali Rohár      2014-11-11  391  	pr_debug("Received WMI event (%*ph)\n",
83fc44c32ad8b8b Pali Rohár      2014-11-11  392  		obj->buffer.length, obj->buffer.pointer);
83fc44c32ad8b8b Pali Rohár      2014-11-11  393  
83fc44c32ad8b8b Pali Rohár      2014-11-11  394  	buffer_entry = (u16 *)obj->buffer.pointer;
83fc44c32ad8b8b Pali Rohár      2014-11-11  395  	buffer_size = obj->buffer.length/2;
83fc44c32ad8b8b Pali Rohár      2014-11-11  396  	buffer_end = buffer_entry + buffer_size;
83fc44c32ad8b8b Pali Rohár      2014-11-11  397  
481fe5be821c3d0 Pali Rohár      2016-01-04  398  	/*
481fe5be821c3d0 Pali Rohár      2016-01-04  399  	 * BIOS/ACPI on devices with WMI interface version 0 does not clear
481fe5be821c3d0 Pali Rohár      2016-01-04  400  	 * buffer before filling it. So next time when BIOS/ACPI send WMI event
481fe5be821c3d0 Pali Rohár      2016-01-04  401  	 * which is smaller as previous then it contains garbage in buffer from
481fe5be821c3d0 Pali Rohár      2016-01-04  402  	 * previous event.
481fe5be821c3d0 Pali Rohár      2016-01-04  403  	 *
481fe5be821c3d0 Pali Rohár      2016-01-04  404  	 * BIOS/ACPI on devices with WMI interface version 1 clears buffer and
481fe5be821c3d0 Pali Rohár      2016-01-04  405  	 * sometimes send more events in buffer at one call.
481fe5be821c3d0 Pali Rohár      2016-01-04  406  	 *
481fe5be821c3d0 Pali Rohár      2016-01-04  407  	 * So to prevent reading garbage from buffer we will process only first
481fe5be821c3d0 Pali Rohár      2016-01-04  408  	 * one event on devices with WMI interface version 0.
481fe5be821c3d0 Pali Rohár      2016-01-04  409  	 */
00ebbeb39b70072 Andy Lutomirski 2017-08-01  410  	if (priv->interface_version == 0 && buffer_entry < buffer_end)
481fe5be821c3d0 Pali Rohár      2016-01-04  411  		if (buffer_end > buffer_entry + buffer_entry[0] + 1)
481fe5be821c3d0 Pali Rohár      2016-01-04  412  			buffer_end = buffer_entry + buffer_entry[0] + 1;
481fe5be821c3d0 Pali Rohár      2016-01-04  413  
83fc44c32ad8b8b Pali Rohár      2014-11-11 @414      while (buffer_entry < buffer_end) {
83fc44c32ad8b8b Pali Rohár      2014-11-11  415  
83fc44c32ad8b8b Pali Rohár      2014-11-11  416          len = buffer_entry[0];
83fc44c32ad8b8b Pali Rohár      2014-11-11  417          if (len == 0)
83fc44c32ad8b8b Pali Rohár      2014-11-11  418              break;
83fc44c32ad8b8b Pali Rohár      2014-11-11  419  
83fc44c32ad8b8b Pali Rohár      2014-11-11  420          len++;
83fc44c32ad8b8b Pali Rohár      2014-11-11  421  
83fc44c32ad8b8b Pali Rohár      2014-11-11  422          if (buffer_entry + len > buffer_end) {
83fc44c32ad8b8b Pali Rohár      2014-11-11  423              pr_warn("Invalid length of WMI event\n");
83fc44c32ad8b8b Pali Rohár      2014-11-11  424              break;
0b3f6109f0c9ff9 Matthew Garrett 2009-01-09  425          }
83fc44c32ad8b8b Pali Rohár      2014-11-11  426  
83fc44c32ad8b8b Pali Rohár      2014-11-11  427          pr_debug("Process buffer (%*ph)\n", len*2, buffer_entry);
83fc44c32ad8b8b Pali Rohár      2014-11-11  428  
83fc44c32ad8b8b Pali Rohár      2014-11-11  429          switch (buffer_entry[1]) {
e075b3c898e4055 Pali Rohár      2016-06-15  430              case 0x0000: /* One key pressed or event occurred */
e075b3c898e4055 Pali Rohár      2016-06-15  431                  if (len > 2)
0c026c361be1734 Y Paritcher     2020-06-10  432                      dell_wmi_process_key(wdev, buffer_entry[1],
bff589be59c5092 Andy Lutomirski 2015-11-25  433                              buffer_entry[2]);
83fc44c32ad8b8b Pali Rohár      2014-11-11  434                  break;
e075b3c898e4055 Pali Rohár      2016-06-15  435              case 0x0010: /* Sequence of keys pressed */
e075b3c898e4055 Pali Rohár      2016-06-15  436              case 0x0011: /* Sequence of events occurred */
83fc44c32ad8b8b Pali Rohár      2014-11-11  437                  for (i = 2; i < len; ++i)
bff589be59c5092 Andy Lutomirski 2015-11-25  438                      dell_wmi_process_key(wdev, buffer_entry[1],
e075b3c898e4055 Pali Rohár      2016-06-15  439                              buffer_entry[i]);
83fc44c32ad8b8b Pali Rohár      2014-11-11  440                  break;
cee9f60d7ca58d8 perry_yuan      2020-11-03  441              case 0x0012:
cee9f60d7ca58d8 perry_yuan      2020-11-03  442  #if IS_ENABLED(CONFIG_DELL_PRIVACY)
cee9f60d7ca58d8 perry_yuan      2020-11-03  443                  if (dell_privacy_valid()) {
cee9f60d7ca58d8 perry_yuan      2020-11-03  444                      dell_privacy_process_event(buffer_entry[1], buffer_entry[3], 
cee9f60d7ca58d8 perry_yuan      2020-11-03  445                              buffer_entry[4]);
cee9f60d7ca58d8 perry_yuan      2020-11-03  446                  } else {
cee9f60d7ca58d8 perry_yuan      2020-11-03  447                      if (len > 2)
cee9f60d7ca58d8 perry_yuan      2020-11-03  448                          dell_wmi_process_key(wdev, buffer_entry[1], buffer_entry[2]);
cee9f60d7ca58d8 perry_yuan      2020-11-03  449                  }
cee9f60d7ca58d8 perry_yuan      2020-11-03  450  #else
cee9f60d7ca58d8 perry_yuan      2020-11-03  451                  /* Extended data is currently ignored */
cee9f60d7ca58d8 perry_yuan      2020-11-03  452                  if (len > 2)
cee9f60d7ca58d8 perry_yuan      2020-11-03  453                      dell_wmi_process_key(wdev, buffer_entry[1], buffer_entry[2]);
cee9f60d7ca58d8 perry_yuan      2020-11-03  454  #endif
cee9f60d7ca58d8 perry_yuan      2020-11-03  455                  break;
e075b3c898e4055 Pali Rohár      2016-06-15  456              default: /* Unknown event */
83fc44c32ad8b8b Pali Rohár      2014-11-11  457                  pr_info("Unknown WMI event type 0x%x\n",
83fc44c32ad8b8b Pali Rohár      2014-11-11  458                          (int)buffer_entry[1]);
83fc44c32ad8b8b Pali Rohár      2014-11-11  459                  break;
0b3f6109f0c9ff9 Matthew Garrett 2009-01-09  460          }
83fc44c32ad8b8b Pali Rohár      2014-11-11  461  
83fc44c32ad8b8b Pali Rohár      2014-11-11  462          buffer_entry += len;
83fc44c32ad8b8b Pali Rohár      2014-11-11  463  
83fc44c32ad8b8b Pali Rohár      2014-11-11  464      }
83fc44c32ad8b8b Pali Rohár      2014-11-11  465  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 30706 bytes --]

  parent reply	other threads:[~2020-11-04  6:43 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-03 12:55 Perry Yuan
2020-11-03 16:22 ` kernel test robot
2020-11-03 16:50 ` kernel test robot
2020-11-03 19:14 ` Barnabás Pőcze
2020-11-04  1:49 ` Matthew Garrett
2020-11-11  7:21   ` Yuan, Perry
2020-11-11  7:24     ` Matthew Garrett
2020-11-11 14:30       ` Limonciello, Mario
2020-11-12 15:06         ` Enrico Weigelt, metux IT consult
2020-11-12 15:31           ` Limonciello, Mario
2020-11-12 15:55             ` Hans de Goede
2020-11-12 15:57               ` Limonciello, Mario
2020-11-04  6:43 ` kernel test robot [this message]
2020-11-09 11:16 ` Hans de Goede
2020-11-11  7:24   ` Yuan, Perry

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=202011041450.cZhM2aWP-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=Mario.Limonciello@dell.com \
    --cc=Perry.Yuan@dell.com \
    --cc=hdegoede@redhat.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgross@linux.intel.com \
    --cc=mjg59@srcf.ucam.org \
    --cc=pali@kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --subject='Re: [PATCH]  platform/x86: dell-privacy: Add support for new privacy driver' \
    /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

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).