Re: [PATCH v4] watchdog: add driver for StreamLabs USB watchdog device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Alexey,

I love your patch! Perhaps something to improve:

[auto build test WARNING on groeck-staging/hwmon-next]
[also build test WARNING on linus/master v5.19-rc6 next-20220715]
[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#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Alexey-Klimov/watchdog-add-driver-for-StreamLabs-USB-watchdog-device/20220717-000621
base:   https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-next
config: arc-randconfig-s032-20220717 (https://download.01.org/0day-ci/archive/20220717/202207170459.ZyslrGcE-lkp@xxxxxxxxx/config)
compiler: arceb-elf-gcc (GCC) 12.1.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.4-39-gce1a6720-dirty
        # https://github.com/intel-lab-lkp/linux/commit/897fbad1d3a4917a703454a9f79728c6af44d0a4
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Alexey-Klimov/watchdog-add-driver-for-StreamLabs-USB-watchdog-device/20220717-000621
        git checkout 897fbad1d3a4917a703454a9f79728c6af44d0a4
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arc SHELL=/bin/bash drivers/watchdog/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@xxxxxxxxx>


sparse warnings: (new ones prefixed by >>)
>> drivers/watchdog/streamlabs_wdt.c:70:23: sparse: sparse: restricted __le16 degrades to integer
>> drivers/watchdog/streamlabs_wdt.c:96:16: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned short [usertype] @@     got restricted __le16 [usertype] @@
   drivers/watchdog/streamlabs_wdt.c:96:16: sparse:     expected unsigned short [usertype]
   drivers/watchdog/streamlabs_wdt.c:96:16: sparse:     got restricted __le16 [usertype]
   drivers/watchdog/streamlabs_wdt.c:97:16: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned short [usertype] @@     got restricted __le16 [usertype] @@
   drivers/watchdog/streamlabs_wdt.c:97:16: sparse:     expected unsigned short [usertype]
   drivers/watchdog/streamlabs_wdt.c:97:16: sparse:     got restricted __le16 [usertype]
   drivers/watchdog/streamlabs_wdt.c:98:16: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned short [usertype] @@     got restricted __le16 [usertype] @@
   drivers/watchdog/streamlabs_wdt.c:98:16: sparse:     expected unsigned short [usertype]
   drivers/watchdog/streamlabs_wdt.c:98:16: sparse:     got restricted __le16 [usertype]

vim +70 drivers/watchdog/streamlabs_wdt.c

    57	
    58	static bool nowayout = WATCHDOG_NOWAYOUT;
    59	module_param(nowayout, bool, 0);
    60	MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
    61				__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
    62	
    63	/*
    64	 * This function is used to check if watchdog actually changed
    65	 * its state to disabled that is reported in first two bytes of response
    66	 * message.
    67	 */
    68	static int usb_streamlabs_wdt_check_stop(u16 *buf)
    69	{
  > 70		if (buf[0] != cpu_to_le16(STREAMLABS_CMD_STOP))
    71			return -EINVAL;
    72	
    73		return 0;
    74	}
    75	
    76	static int usb_streamlabs_wdt_validate_response(u8 *buf)
    77	{
    78		/*
    79		 * If watchdog device understood the command it will acknowledge
    80		 * with values 1,2,3,4 at indexes 10, 11, 12, 13 in response message
    81		 * when response treated as 8bit message.
    82		 */
    83		if (buf[10] != 1 || buf[11] != 2 || buf[12] != 3 || buf[13] != 4)
    84			return -EPROTO;
    85	
    86		return 0;
    87	}
    88	
    89	static void usb_streamlabs_wdt_prepare_buf(u16 *buf, u16 cmd,
    90							unsigned long timeout_msec)
    91	{
    92		/*
    93		 * remaining elements expected to be zero everytime during
    94		 * communication
    95		 */
  > 96		buf[0] = cpu_to_le16(cmd);
    97		buf[1] = cpu_to_le16(0x8000);
    98		buf[3] = cpu_to_le16(timeout_msec);
    99		buf[5] = 0x0;
   100		buf[6] = 0x0;
   101	}
   102	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux