mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Ye Xiang <xiang.ye@intel.com>,
	jikos@kernel.org, jic23@kernel.org,
	srinivas.pandruvada@linux.intel.com
Cc: kbuild-all@lists.01.org, linux-input@vger.kernel.org,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	Ye Xiang <xiang.ye@intel.com>
Subject: Re: [PATCH 1/4] HID: hid-sensor-custom: Add custom sensor iio support
Date: Thu, 19 Nov 2020 14:56:45 +0800	[thread overview]
Message-ID: <202011191413.TlmB6kRb-lkp@intel.com> (raw)
In-Reply-To: <20201119030326.6447-2-xiang.ye@intel.com>

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

Hi Ye,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on iio/togreg]
[also build test WARNING on linus/master v5.10-rc4 next-20201118]
[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/Ye-Xiang/add-custom-hinge-sensor-support/20201119-110842
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
config: c6x-randconfig-r003-20201119 (attached as .config)
compiler: c6x-elf-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/1f33733d65038ade4af057df7e5c126485ecb7c6
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Ye-Xiang/add-custom-hinge-sensor-support/20201119-110842
        git checkout 1f33733d65038ade4af057df7e5c126485ecb7c6
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=c6x 

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/hid/hid-sensor-custom.c: In function 'store_value':
   drivers/hid/hid-sensor-custom.c:401:7: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
     401 |   int ret;
         |       ^~~
   In file included from include/linux/device.h:15,
                    from include/linux/miscdevice.h:7,
                    from drivers/hid/hid-sensor-custom.c:11:
   drivers/hid/hid-sensor-custom.c: In function 'get_known_custom_sensor_index':
>> drivers/hid/hid-sensor-custom.c:847:24: warning: format '%ld' expects argument of type 'long int', but argument 3 has type '__kernel_size_t' {aka 'unsigned int'} [-Wformat=]
     847 |   hid_err(hsdev->hdev, " %ld != %ld\n", strlen(buf),
         |                        ^~~~~~~~~~~~~~~
   include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
      19 | #define dev_fmt(fmt) fmt
         |                      ^~~
   include/linux/hid.h:1180:2: note: in expansion of macro 'dev_err'
    1180 |  dev_err(&(hid)->dev, fmt, ##__VA_ARGS__)
         |  ^~~~~~~
   drivers/hid/hid-sensor-custom.c:847:3: note: in expansion of macro 'hid_err'
     847 |   hid_err(hsdev->hdev, " %ld != %ld\n", strlen(buf),
         |   ^~~~~~~
   drivers/hid/hid-sensor-custom.c:847:28: note: format string is defined here
     847 |   hid_err(hsdev->hdev, " %ld != %ld\n", strlen(buf),
         |                          ~~^
         |                            |
         |                            long int
         |                          %d
   In file included from include/linux/device.h:15,
                    from include/linux/miscdevice.h:7,
                    from drivers/hid/hid-sensor-custom.c:11:
   drivers/hid/hid-sensor-custom.c:847:24: warning: format '%ld' expects argument of type 'long int', but argument 4 has type '__kernel_size_t' {aka 'unsigned int'} [-Wformat=]
     847 |   hid_err(hsdev->hdev, " %ld != %ld\n", strlen(buf),
         |                        ^~~~~~~~~~~~~~~
   include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
      19 | #define dev_fmt(fmt) fmt
         |                      ^~~
   include/linux/hid.h:1180:2: note: in expansion of macro 'dev_err'
    1180 |  dev_err(&(hid)->dev, fmt, ##__VA_ARGS__)
         |  ^~~~~~~
   drivers/hid/hid-sensor-custom.c:847:3: note: in expansion of macro 'hid_err'
     847 |   hid_err(hsdev->hdev, " %ld != %ld\n", strlen(buf),
         |   ^~~~~~~
   drivers/hid/hid-sensor-custom.c:847:35: note: format string is defined here
     847 |   hid_err(hsdev->hdev, " %ld != %ld\n", strlen(buf),
         |                                 ~~^
         |                                   |
         |                                   long int
         |                                 %d

vim +847 drivers/hid/hid-sensor-custom.c

   771	
   772	static int get_known_custom_sensor_index(struct hid_sensor_hub_device *hsdev)
   773	{
   774		struct hid_sensor_hub_attribute_info sensor_manufacturer = { 0 };
   775		struct hid_sensor_hub_attribute_info sensor_luid_info = { 0 };
   776		int report_size;
   777		int ret;
   778		u16 *w_buf;
   779		int w_buf_len;
   780		char *buf;
   781		int buf_len;
   782		int i;
   783		int index;
   784	
   785		w_buf_len = sizeof(u16) * HID_CUSTOM_MAX_FEATURE_BYTES;
   786		buf_len = sizeof(char) * HID_CUSTOM_MAX_FEATURE_BYTES;
   787		w_buf = kzalloc(w_buf_len, GFP_KERNEL);
   788		if (!w_buf)
   789			return -1;
   790	
   791		buf = kzalloc(buf_len, GFP_KERNEL);
   792		if (!buf) {
   793			kfree(w_buf);
   794			return -1;
   795		}
   796	
   797		/* get manufacturer info */
   798		ret = sensor_hub_input_get_attribute_info(
   799			hsdev, HID_FEATURE_REPORT, hsdev->usage,
   800			HID_USAGE_SENSOR_PROP_MANUFACTURER, &sensor_manufacturer);
   801		if (ret < 0)
   802			goto err_out;
   803	
   804		report_size =
   805			sensor_hub_get_feature(hsdev, sensor_manufacturer.report_id,
   806					       sensor_manufacturer.index, w_buf_len,
   807					       w_buf);
   808		if (report_size <= 0) {
   809			hid_err(hsdev->hdev,
   810				"Failed to get sensor manufacturer info %d\n",
   811				report_size);
   812			goto err_out;
   813		}
   814	
   815		/* convert from wide char to char */
   816		for (i = 0; i < buf_len - 1 && w_buf[i]; i++)
   817			buf[i] = (char)w_buf[i];
   818	
   819		/* ensure it's ISH sensor */
   820		if (strncmp(buf, "INTEL", strlen("INTEL")))
   821			goto err_out;
   822	
   823		memset(w_buf, 0, w_buf_len);
   824		memset(buf, 0, buf_len);
   825	
   826		/* get real usage id */
   827		ret = sensor_hub_input_get_attribute_info(
   828			hsdev, HID_FEATURE_REPORT, hsdev->usage,
   829			HID_USAGE_SENSOR_PROP_SERIAL_NUM, &sensor_luid_info);
   830		if (ret < 0)
   831			goto err_out;
   832	
   833		report_size = sensor_hub_get_feature(hsdev, sensor_luid_info.report_id,
   834						     sensor_luid_info.index, w_buf_len,
   835						     w_buf);
   836		if (report_size <= 0) {
   837			hid_err(hsdev->hdev, "Failed to get real usage info %d\n",
   838				report_size);
   839			goto err_out;
   840		}
   841	
   842		/* convert from wide char to char */
   843		for (i = 0; i < buf_len - 1 && w_buf[i]; i++)
   844			buf[i] = (char)w_buf[i];
   845	
   846		if (strlen(buf) != strlen(known_sensor_luid[0]) + 5) {
 > 847			hid_err(hsdev->hdev, " %ld != %ld\n", strlen(buf),
   848				strlen(known_sensor_luid[0]));
   849			goto err_out;
   850		}
   851	
   852		/* get table index with luid (not matching 'LUID: ' in luid) */
   853		index = get_luid_table_index(&buf[5]);
   854		kfree(w_buf);
   855		kfree(buf);
   856		return index;
   857	
   858	err_out:
   859		kfree(w_buf);
   860		kfree(buf);
   861		return -1;
   862	}
   863	

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

  reply	other threads:[~2020-11-19  6:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-19  3:03 [PATCH 0/4] add custom hinge sensor support Ye Xiang
2020-11-19  3:03 ` [PATCH 1/4] HID: hid-sensor-custom: Add custom sensor iio support Ye Xiang
2020-11-19  6:56   ` kernel test robot [this message]
2020-11-19  3:03 ` [PATCH 2/4] iio: hid-sensor-trigger: Decrement runtime pm enable count on driver removal Ye Xiang
2020-11-19  3:03 ` [PATCH 3/4] iio: hid-sensor-trigger: Use iio->trig instead trig field internal structure Ye Xiang
2020-11-19  3:03 ` [PATCH 4/4] iio: hid-sensors: Add hinge sensor driver Ye Xiang

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=202011191413.TlmB6kRb-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=jic23@kernel.org \
    --cc=jikos@kernel.org \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=srinivas.pandruvada@linux.intel.com \
    --cc=xiang.ye@intel.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

Powered by JetHome