linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Y Paritcher <y.linux@paritcher.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
	platform-driver-x86@vger.kernel.org,
	"Matthew Garrett" <mjg59@srcf.ucam.org>,
	"Pali Rohár" <pali@kernel.org>
Subject: Re: [PATCH 3/3] platform/x86: dell-wmi: add keys to bios_to_linux_keycode
Date: Mon, 8 Jun 2020 14:36:25 +0800	[thread overview]
Message-ID: <202006081404.59gC9C0e%lkp@intel.com> (raw)
In-Reply-To: <13951508596a3f654c6d47f5380ddb4f38e2f6b5.1591584631.git.y.linux@paritcher.com>

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

Hi Paritcher,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on tip/auto-latest]
[also build test WARNING on platform-drivers-x86/for-next linus/master linux/master v5.7 next-20200605]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Y-Paritcher/platform-x86-dell-wmi-new-keys/20200608-122408
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 22a1c800c96c83b7f4e3e02fad767502b70124fa
config: i386-randconfig-s002-20200608 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.1-247-gcadbd124-dirty
        # save the attached .config to linux build tree
        make W=1 C=1 ARCH=i386 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

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 >>, old ones prefixed by <<):

drivers/platform/x86/dell-wmi.c: In function 'handle_dmi_entry':
>> drivers/platform/x86/dell-wmi.c:506:38: warning: comparison is always true due to limited range of data type [-Wtype-limits]
506 |   u16 keycode = (bios_entry->keycode <
|                                      ^

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

a464afb9581f6a Andy Lutomirski   2016-02-15  464  
bff589be59c509 Andy Lutomirski   2015-11-25  465  static void handle_dmi_entry(const struct dmi_header *dm, void *opaque)
5ea2559726b786 Rezwanul Kabir    2009-11-02  466  {
18b6f80f509503 Andy Lutomirski   2016-02-15  467  	struct dell_dmi_results *results = opaque;
18b6f80f509503 Andy Lutomirski   2016-02-15  468  	struct dell_bios_hotkey_table *table;
a464afb9581f6a Andy Lutomirski   2016-02-15  469  	int hotkey_num, i, pos = 0;
890a7c8e8dc2d0 Dmitry Torokhov   2010-08-04  470  	struct key_entry *keymap;
18b6f80f509503 Andy Lutomirski   2016-02-15  471  
18b6f80f509503 Andy Lutomirski   2016-02-15  472  	if (results->err || results->keymap)
18b6f80f509503 Andy Lutomirski   2016-02-15  473  		return;		/* We already found the hotkey table. */
18b6f80f509503 Andy Lutomirski   2016-02-15  474  
074df51ca84d32 Andy Lutomirski   2016-02-17  475  	/* The Dell hotkey table is type 0xB2.  Scan until we find it. */
b13de7019c1b67 Andy Lutomirski   2016-02-15  476  	if (dm->type != 0xb2)
18b6f80f509503 Andy Lutomirski   2016-02-15  477  		return;
18b6f80f509503 Andy Lutomirski   2016-02-15  478  
18b6f80f509503 Andy Lutomirski   2016-02-15  479  	table = container_of(dm, struct dell_bios_hotkey_table, header);
18b6f80f509503 Andy Lutomirski   2016-02-15  480  
b13de7019c1b67 Andy Lutomirski   2016-02-15  481  	hotkey_num = (table->header.length -
b13de7019c1b67 Andy Lutomirski   2016-02-15  482  		      sizeof(struct dell_bios_hotkey_table)) /
18b6f80f509503 Andy Lutomirski   2016-02-15  483  				sizeof(struct dell_bios_keymap_entry);
b13de7019c1b67 Andy Lutomirski   2016-02-15  484  	if (hotkey_num < 1) {
b13de7019c1b67 Andy Lutomirski   2016-02-15  485  		/*
b13de7019c1b67 Andy Lutomirski   2016-02-15  486  		 * Historically, dell-wmi would ignore a DMI entry of
b13de7019c1b67 Andy Lutomirski   2016-02-15  487  		 * fewer than 7 bytes.  Sizes between 4 and 8 bytes are
b13de7019c1b67 Andy Lutomirski   2016-02-15  488  		 * nonsensical (both the header and all entries are 4
b13de7019c1b67 Andy Lutomirski   2016-02-15  489  		 * bytes), so we approximate the old behavior by
b13de7019c1b67 Andy Lutomirski   2016-02-15  490  		 * ignoring tables with fewer than one entry.
b13de7019c1b67 Andy Lutomirski   2016-02-15  491  		 */
b13de7019c1b67 Andy Lutomirski   2016-02-15  492  		return;
b13de7019c1b67 Andy Lutomirski   2016-02-15  493  	}
5ea2559726b786 Rezwanul Kabir    2009-11-02  494  
e075b3c898e405 Pali Rohár        2016-06-15  495  	keymap = kcalloc(hotkey_num, sizeof(struct key_entry), GFP_KERNEL);
18b6f80f509503 Andy Lutomirski   2016-02-15  496  	if (!keymap) {
18b6f80f509503 Andy Lutomirski   2016-02-15  497  		results->err = -ENOMEM;
18b6f80f509503 Andy Lutomirski   2016-02-15  498  		return;
18b6f80f509503 Andy Lutomirski   2016-02-15  499  	}
5ea2559726b786 Rezwanul Kabir    2009-11-02  500  
5ea2559726b786 Rezwanul Kabir    2009-11-02  501  	for (i = 0; i < hotkey_num; i++) {
890a7c8e8dc2d0 Dmitry Torokhov   2010-08-04  502  		const struct dell_bios_keymap_entry *bios_entry =
18b6f80f509503 Andy Lutomirski   2016-02-15  503  					&table->keymap[i];
cbc61f114af5fb Andy Lutomirski   2015-11-30  504  
cbc61f114af5fb Andy Lutomirski   2015-11-30  505  		/* Uninitialized entries are 0 aka KEY_RESERVED. */
cbc61f114af5fb Andy Lutomirski   2015-11-30 @506  		u16 keycode = (bios_entry->keycode <
cbc61f114af5fb Andy Lutomirski   2015-11-30  507  			       ARRAY_SIZE(bios_to_linux_keycode)) ?
890a7c8e8dc2d0 Dmitry Torokhov   2010-08-04  508  			bios_to_linux_keycode[bios_entry->keycode] :
890a7c8e8dc2d0 Dmitry Torokhov   2010-08-04  509  			KEY_RESERVED;
8cb8e63b569895 Gabriele Mazzotta 2014-12-04  510  
cbc61f114af5fb Andy Lutomirski   2015-11-30  511  		/*
cbc61f114af5fb Andy Lutomirski   2015-11-30  512  		 * Log if we find an entry in the DMI table that we don't
cbc61f114af5fb Andy Lutomirski   2015-11-30  513  		 * understand.  If this happens, we should figure out what
cbc61f114af5fb Andy Lutomirski   2015-11-30  514  		 * the entry means and add it to bios_to_linux_keycode.
cbc61f114af5fb Andy Lutomirski   2015-11-30  515  		 */
cbc61f114af5fb Andy Lutomirski   2015-11-30  516  		if (keycode == KEY_RESERVED) {
cbc61f114af5fb Andy Lutomirski   2015-11-30  517  			pr_info("firmware scancode 0x%x maps to unrecognized keycode 0x%x\n",
cbc61f114af5fb Andy Lutomirski   2015-11-30  518  				bios_entry->scancode, bios_entry->keycode);
cbc61f114af5fb Andy Lutomirski   2015-11-30  519  			continue;
cbc61f114af5fb Andy Lutomirski   2015-11-30  520  		}
cbc61f114af5fb Andy Lutomirski   2015-11-30  521  
8cb8e63b569895 Gabriele Mazzotta 2014-12-04  522  		if (keycode == KEY_KBDILLUMTOGGLE)
a464afb9581f6a Andy Lutomirski   2016-02-15  523  			keymap[pos].type = KE_IGNORE;
8cb8e63b569895 Gabriele Mazzotta 2014-12-04  524  		else
a464afb9581f6a Andy Lutomirski   2016-02-15  525  			keymap[pos].type = KE_KEY;
a464afb9581f6a Andy Lutomirski   2016-02-15  526  		keymap[pos].code = bios_entry->scancode;
a464afb9581f6a Andy Lutomirski   2016-02-15  527  		keymap[pos].keycode = keycode;
a464afb9581f6a Andy Lutomirski   2016-02-15  528  
a464afb9581f6a Andy Lutomirski   2016-02-15  529  		pos++;
a464afb9581f6a Andy Lutomirski   2016-02-15  530  	}
a464afb9581f6a Andy Lutomirski   2016-02-15  531  
18b6f80f509503 Andy Lutomirski   2016-02-15  532  	results->keymap = keymap;
e075b3c898e405 Pali Rohár        2016-06-15  533  	results->keymap_size = pos;
5ea2559726b786 Rezwanul Kabir    2009-11-02  534  }
5ea2559726b786 Rezwanul Kabir    2009-11-02  535  

:::::: The code at line 506 was first introduced by commit
:::::: cbc61f114af5fb078d84dc8864152f4db1712bc5 dell-wmi: Improve unknown hotkey handling

:::::: TO: Andy Lutomirski <luto@kernel.org>
:::::: CC: Darren Hart <dvhart@linux.intel.com>

---
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: 39047 bytes --]

  reply	other threads:[~2020-06-08  7:14 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-08  4:22 [PATCH 0/3] platform/x86: dell-wmi: new keys Y Paritcher
2020-06-08  4:22 ` [PATCH 1/3] platform/x86: dell-wmi: add new backlight events Y Paritcher
2020-06-08  8:35   ` Pali Rohár
2020-06-08 15:30     ` Mario.Limonciello
2020-06-08 20:11       ` Y Paritcher
2020-06-08 20:14         ` Mario.Limonciello
2020-06-08 20:36           ` Pali Rohár
2020-06-08 20:38             ` Mario.Limonciello
2020-06-08  4:22 ` [PATCH 2/3] platform/x86: dell-wmi: add new keymap type 0x0012 Y Paritcher
2020-06-08  8:50   ` Pali Rohár
2020-06-08 20:12     ` Y Paritcher
2020-06-08 15:40   ` Mario.Limonciello
2020-06-08 20:12     ` Y Paritcher
2020-06-08 20:30       ` Pali Rohár
2020-06-08 20:36       ` Mario.Limonciello
2020-06-08 21:03         ` Y Paritcher
2020-06-08 22:00           ` Mario.Limonciello
2020-06-08 22:53             ` Y Paritcher
2020-06-09 10:44         ` Hans de Goede
2020-06-09 15:36           ` Mario.Limonciello
2020-06-09 16:14             ` Hans de Goede
2020-06-09 19:41               ` Mario.Limonciello
2020-06-09 15:49         ` Pali Rohár
2020-06-09 16:45           ` Sebastian Reichel
2020-06-09 16:59             ` Hans de Goede
2020-06-19 15:31               ` Sebastian Reichel
2020-06-19 17:26                 ` Mario.Limonciello
2020-06-09  8:04     ` Pali Rohár
2020-06-08  4:22 ` [PATCH 3/3] platform/x86: dell-wmi: add keys to bios_to_linux_keycode Y Paritcher
2020-06-08  6:36   ` kernel test robot [this message]
2020-06-08  7:36   ` kernel test robot
2020-06-08  9:00   ` Pali Rohár
2020-06-08 15:46     ` Mario.Limonciello
2020-06-08 20:12       ` Y Paritcher
2020-06-08 20:48       ` Pali Rohár
2020-06-08 20:58         ` Mario.Limonciello
2020-06-09  8:27           ` Pali Rohár
2020-06-08 23:05 ` [PATCH v2 0/3] platform/x86: dell-wmi: new keys Y Paritcher
2020-06-08 23:05   ` [PATCH v2 1/3] platform/x86: dell-wmi: add new backlight events Y Paritcher
2020-06-08 23:24     ` Pali Rohár
2020-06-08 23:05   ` [PATCH v2 2/3] platform/x86: dell-wmi: add new keymap type 0x0012 Y Paritcher
2020-06-08 23:33     ` Pali Rohár
2020-06-09  0:26       ` Mario.Limonciello
2020-06-09  0:57         ` Y Paritcher
2020-06-09  8:40           ` Pali Rohár
2020-06-09  8:50         ` Pali Rohár
2020-06-08 23:05   ` [PATCH v2 3/3] platform/x86: dell-wmi: add new dmi keys to bios_to_linux_keycode Y Paritcher
2020-06-08 23:27     ` Randy Dunlap
2020-06-08 23:55       ` Pali Rohár
2020-06-09  0:43         ` Y Paritcher
2020-06-09  8:35           ` Pali Rohár
2020-06-09 19:49         ` Mario.Limonciello
2020-06-10  9:44           ` Pali Rohár
2020-06-10 12:35             ` Mario.Limonciello
2020-06-12 14:14               ` Pali Rohár
2020-06-12 14:59                 ` Mario.Limonciello
2020-06-09  3:52 ` [PATCH v3 0/3] platform/x86: dell-wmi: new keys Y Paritcher
2020-06-09  3:52   ` [PATCH v3 1/3] platform/x86: dell-wmi: add new backlight events Y Paritcher
2020-06-09 16:02     ` Mario.Limonciello
2020-06-09  3:52   ` [PATCH v3 2/3] platform/x86: dell-wmi: add new keymap type 0x0012 Y Paritcher
2020-06-09  3:52   ` [PATCH v3 3/3] platform/x86: dell-wmi: add new dmi mapping for keycode 0xffff Y Paritcher
2020-06-09  9:19     ` Pali Rohár
2020-06-10 17:56 ` [PATCH v4 0/3] platform/x86: dell-wmi: new keys Y Paritcher
2020-06-10 17:56   ` [PATCH v4 1/3] platform/x86: dell-wmi: add new backlight events Y Paritcher
2020-06-10 17:56   ` [PATCH v4 2/3] platform/x86: dell-wmi: add new keymap type 0x0012 Y Paritcher
2020-06-10 17:56   ` [PATCH v4 3/3] platform/x86: dell-wmi: add new dmi mapping for keycode 0xffff Y Paritcher
2020-06-10 19:22   ` [PATCH v4 0/3] platform/x86: dell-wmi: new keys Mario.Limonciello
2020-07-09 19:29     ` Andy Shevchenko
2020-07-13  7:29       ` Pali Rohár
2020-08-14  8:10         ` Pali Rohár
2020-06-12 14:09   ` Pali Rohár

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=202006081404.59gC9C0e%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjg59@srcf.ucam.org \
    --cc=pali@kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=y.linux@paritcher.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).