public inbox for linux-hwmon@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: "jaap aarts" <jaap.aarts1@gmail.com>,
	"Jean Delvare" <jdelvare@suse.com>,
	"Guenter Roeck" <linux@roeck-us.net>,
	"linux-hwmon@vger.kernel.org" <linux-hwmon@vger.kernel.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"Barnabás Pőcze" <pobrn@protonmail.com>
Cc: kbuild-all@lists.01.org, jaap aarts <jaap.aarts1@gmail.com>
Subject: Re: [PATCH V4] hwmon: add fan/pwm driver for corsair h100i platinum
Date: Sun, 16 Aug 2020 17:34:40 +0800	[thread overview]
Message-ID: <202008161737.Ehki3MRg%lkp@intel.com> (raw)
In-Reply-To: <20200815211617.86565-1-jaap.aarts1@gmail.com>

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

Hi jaap,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on hwmon/hwmon-next]
[also build test WARNING on v5.8 next-20200814]
[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/jaap-aarts/hwmon-add-fan-pwm-driver-for-corsair-h100i-platinum/20200816-085929
base:   https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-next
config: nios2-randconfig-c003-20200816 (attached as .config)
compiler: nios2-linux-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
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=nios2 

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/hwmon/corsair_hydro_i_pro.c: In function 'hwmon_init':
>> drivers/hwmon/corsair_hydro_i_pro.c:529:17: warning: variable 'hwmon_dev' set but not used [-Wunused-but-set-variable]
     529 |  struct device *hwmon_dev;
         |                 ^~~~~~~~~
   drivers/hwmon/corsair_hydro_i_pro.c: In function 'init_device':
>> drivers/hwmon/corsair_hydro_i_pro.c:584:3: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
     584 |   ;
         |   ^

vim +/hwmon_dev +529 drivers/hwmon/corsair_hydro_i_pro.c

   525	
   526	static void hwmon_init(struct hydro_i_pro_device *hdev)
   527	{
   528		u8 fan_id;
 > 529		struct device *hwmon_dev;
   530		struct hwmon_fan_data *fan;
   531		struct hwmon_data *data = devm_kzalloc(
   532			&hdev->udev->dev, sizeof(struct hwmon_data), GFP_KERNEL);
   533		struct hwmon_chip_info *hwmon_info = devm_kzalloc(
   534			&hdev->udev->dev, sizeof(struct hwmon_chip_info), GFP_KERNEL);
   535	
   536		/* You did something bad!! Either adjust  max_fan_count or the fancount for the config!*/
   537		WARN_ON(hdev->config->fancount >= max_pwm_channel_count);
   538		data->channel_count = hdev->config->fancount;
   539	
   540		/* For each fan create a data channel a fan config entry and a pwm config entry */
   541		for (fan_id = 0; fan_id < data->channel_count; fan_id++) {
   542			fan = devm_kzalloc(&hdev->udev->dev,
   543					   sizeof(struct hwmon_fan_data), GFP_KERNEL);
   544			fan->fan_channel = fan_id;
   545			fan->mode = 0;
   546			data->channel_data[fan_id] = fan;
   547		}
   548	
   549		hwmon_info->ops = &i_pro_ops;
   550		hwmon_info->info = hdev->config->hwmon_info;
   551	
   552		data->hdev = hdev;
   553		hwmon_dev = devm_hwmon_device_register_with_info(
   554			&hdev->udev->dev, hdev->config->name, data, hwmon_info, NULL);
   555		dev_info(&hdev->udev->dev, "setup hwmon for %s\n", hdev->config->name);
   556	}
   557	
   558	const int USB_VENDOR_ID_CORSAIR = 0x1b1c;
   559	const int USB_PRODUCT_ID_H100I_PRO = 0x0c15;
   560	/*
   561	 * Devices that work with this driver.
   562	 * More devices should work, however none have been tested.
   563	 */
   564	static const struct usb_device_id astk_table[] = {
   565		{ USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_PRODUCT_ID_H100I_PRO),
   566		  .driver_info = (kernel_ulong_t)&config_table[0] },
   567		{},
   568	};
   569	
   570	MODULE_DEVICE_TABLE(usb, astk_table);
   571	
   572	static int init_device(struct usb_device *udev)
   573	{
   574		int retval;
   575	
   576		/*
   577		 * This is needed because when running windows in a vm with proprietary driver
   578		 * and you switch to this driver, the device will not respond unless you run this.
   579		 */
   580		retval = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x00, 0x40,
   581					 0xffff, 0x0000, 0, 0, 0);
   582		/*this always returns error*/
   583		if (retval)
 > 584			;
   585	
   586		retval = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x02, 0x40,
   587					 0x0002, 0x0000, 0, 0, 0);
   588		return retval;
   589	}
   590	

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

  parent reply	other threads:[~2020-08-16  9:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-15 21:16 [PATCH V4] hwmon: add fan/pwm driver for corsair h100i platinum jaap aarts
2020-08-15 21:22 ` jaap aarts
2020-08-15 22:54 ` Barnabás Pőcze
2020-08-16  0:01   ` Guenter Roeck
2020-08-16  0:27     ` Barnabás Pőcze
2020-08-16  0:51       ` Guenter Roeck
2020-08-16  1:35         ` Barnabás Pőcze
2020-08-16  8:57   ` jaap aarts
2020-08-16  9:34 ` kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-08-16  0:04 Guenter Roeck
2020-08-16  9:05 ` jaap aarts

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=202008161737.Ehki3MRg%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=jaap.aarts1@gmail.com \
    --cc=jdelvare@suse.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=pobrn@protonmail.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