Re: [PATCH] hwmon: add fan/pwm driver for corsair h100i platinum

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

 



Hi jaap,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on hwmon/hwmon-next]
[also build test ERROR on v5.8-rc5 next-20200714]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use  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/20200714-180650
base:   https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-next
config: x86_64-allyesconfig (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 02946de3802d3bc65bc9f2eb9b8d4969b5a7add8)
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
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

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

All error/warnings (new ones prefixed by >>):

>> drivers/hwmon/asetek_gen6.c:212:12: error: incompatible pointer types passing 'char [43]' to parameter of type 'const struct device *' [-Werror,-Wincompatible-pointer-types]
                   dev_info("[*] Failled setting fan curve %d,%d,%d/%d\n",
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/dev_printk.h:110:12: note: expanded from macro 'dev_info'
           _dev_info(dev, dev_fmt(fmt), ##__VA_ARGS__)
                     ^~~
   include/linux/dev_printk.h:48:37: note: passing argument to parameter 'dev' here
   void _dev_info(const struct device *dev, const char *fmt, ...);
                                       ^
>> drivers/hwmon/asetek_gen6.c:213:5: warning: incompatible integer to pointer conversion passing 'char' to parameter of type 'const char *'; take the address with & [-Wint-conversion]
                            recv_buf[0], recv_buf[1], recv_buf[2], recv_buf[3]);
                            ^~~~~~~~~~~
                            &
   include/linux/dev_printk.h:110:25: note: expanded from macro 'dev_info'
           _dev_info(dev, dev_fmt(fmt), ##__VA_ARGS__)
                                  ^~~
   include/linux/dev_printk.h:19:22: note: expanded from macro 'dev_fmt'
   #define dev_fmt(fmt) fmt
                        ^~~
   include/linux/dev_printk.h:48:54: note: passing argument to parameter 'fmt' here
   void _dev_info(const struct device *dev, const char *fmt, ...);
                                                        ^
   drivers/hwmon/asetek_gen6.c:174:5: warning: no previous prototype for function 'set_fan_rpm_curve' [-Wmissing-prototypes]
   int set_fan_rpm_curve(struct driver *cdev, struct hwmon_fan_data *fan_data,
       ^
   drivers/hwmon/asetek_gen6.c:174:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   int set_fan_rpm_curve(struct driver *cdev, struct hwmon_fan_data *fan_data,
   ^
   static 
   drivers/hwmon/asetek_gen6.c:246:12: error: incompatible pointer types passing 'char [41]' to parameter of type 'const struct device *' [-Werror,-Wincompatible-pointer-types]
                   dev_info("[*] Failled setting fan rpm %d,%d,%d/%d\n",
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/dev_printk.h:110:12: note: expanded from macro 'dev_info'
           _dev_info(dev, dev_fmt(fmt), ##__VA_ARGS__)
                     ^~~
   include/linux/dev_printk.h:48:37: note: passing argument to parameter 'dev' here
   void _dev_info(const struct device *dev, const char *fmt, ...);
                                       ^
   drivers/hwmon/asetek_gen6.c:247:5: warning: incompatible integer to pointer conversion passing 'char' to parameter of type 'const char *'; take the address with & [-Wint-conversion]
                            recv_buf[0], recv_buf[1], recv_buf[2], recv_buf[3]);
                            ^~~~~~~~~~~
                            &
   include/linux/dev_printk.h:110:25: note: expanded from macro 'dev_info'
           _dev_info(dev, dev_fmt(fmt), ##__VA_ARGS__)
                                  ^~~
   include/linux/dev_printk.h:19:22: note: expanded from macro 'dev_fmt'
   #define dev_fmt(fmt) fmt
                        ^~~
   include/linux/dev_printk.h:48:54: note: passing argument to parameter 'fmt' here
   void _dev_info(const struct device *dev, const char *fmt, ...);
                                                        ^
   drivers/hwmon/asetek_gen6.c:217:5: warning: no previous prototype for function 'set_fan_target_rpm' [-Wmissing-prototypes]
   int set_fan_target_rpm(struct driver *cdev, struct hwmon_fan_data *fan_data,
       ^
   drivers/hwmon/asetek_gen6.c:217:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   int set_fan_target_rpm(struct driver *cdev, struct hwmon_fan_data *fan_data,
   ^
   static 
   drivers/hwmon/asetek_gen6.c:251:6: warning: no previous prototype for function 'get_fan_target_rpm' [-Wmissing-prototypes]
   void get_fan_target_rpm(struct hwmon_fan_data *fan_data, long *val)
        ^
   drivers/hwmon/asetek_gen6.c:251:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   void get_fan_target_rpm(struct hwmon_fan_data *fan_data, long *val)
   ^
   static 
   drivers/hwmon/asetek_gen6.c:280:12: error: incompatible pointer types passing 'char [44]' to parameter of type 'const struct device *' [-Werror,-Wincompatible-pointer-types]
                   dev_info("[*] Failled retrieving fan rmp %d,%d,%d/%d\n",
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/dev_printk.h:110:12: note: expanded from macro 'dev_info'
           _dev_info(dev, dev_fmt(fmt), ##__VA_ARGS__)
                     ^~~
   include/linux/dev_printk.h:48:37: note: passing argument to parameter 'dev' here
   void _dev_info(const struct device *dev, const char *fmt, ...);
                                       ^
   drivers/hwmon/asetek_gen6.c:281:5: warning: incompatible integer to pointer conversion passing 'char' to parameter of type 'const char *'; take the address with & [-Wint-conversion]
                            recv_buf[0], recv_buf[1], recv_buf[2], recv_buf[3]);
                            ^~~~~~~~~~~
                            &
   include/linux/dev_printk.h:110:25: note: expanded from macro 'dev_info'
           _dev_info(dev, dev_fmt(fmt), ##__VA_ARGS__)
                                  ^~~
   include/linux/dev_printk.h:19:22: note: expanded from macro 'dev_fmt'
   #define dev_fmt(fmt) fmt
                        ^~~
   include/linux/dev_printk.h:48:54: note: passing argument to parameter 'fmt' here
   void _dev_info(const struct device *dev, const char *fmt, ...);
                                                        ^
   drivers/hwmon/asetek_gen6.c:256:5: warning: no previous prototype for function 'get_fan_current_rpm' [-Wmissing-prototypes]
   int get_fan_current_rpm(struct driver *cdev, struct hwmon_fan_data *fan_data,
       ^
   drivers/hwmon/asetek_gen6.c:256:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   int get_fan_current_rpm(struct driver *cdev, struct hwmon_fan_data *fan_data,
   ^
   static 
   drivers/hwmon/asetek_gen6.c:315:12: error: incompatible pointer types passing 'char [41]' to parameter of type 'const struct device *' [-Werror,-Wincompatible-pointer-types]
                   dev_info("[*] Failled setting fan pwm %d,%d,%d/%d\n",
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/dev_printk.h:110:12: note: expanded from macro 'dev_info'
           _dev_info(dev, dev_fmt(fmt), ##__VA_ARGS__)
                     ^~~
   include/linux/dev_printk.h:48:37: note: passing argument to parameter 'dev' here
   void _dev_info(const struct device *dev, const char *fmt, ...);
                                       ^
>> drivers/hwmon/asetek_gen6.c:316:5: warning: incompatible integer to pointer conversion passing 'unsigned char' to parameter of type 'const char *' [-Wint-conversion]
                            recv_buf[0], recv_buf[1], recv_buf[2], recv_buf[3]);
                            ^~~~~~~~~~~
   include/linux/dev_printk.h:110:25: note: expanded from macro 'dev_info'
           _dev_info(dev, dev_fmt(fmt), ##__VA_ARGS__)
                                  ^~~
   include/linux/dev_printk.h:19:22: note: expanded from macro 'dev_fmt'
   #define dev_fmt(fmt) fmt
                        ^~~
   include/linux/dev_printk.h:48:54: note: passing argument to parameter 'fmt' here
   void _dev_info(const struct device *dev, const char *fmt, ...);
                                                        ^
   drivers/hwmon/asetek_gen6.c:287:5: warning: no previous prototype for function 'set_fan_target_pwm' [-Wmissing-prototypes]
   int set_fan_target_pwm(struct driver *cdev, struct hwmon_fan_data *fan_data,
       ^
   drivers/hwmon/asetek_gen6.c:287:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   int set_fan_target_pwm(struct driver *cdev, struct hwmon_fan_data *fan_data,
   ^
   static 
   drivers/hwmon/asetek_gen6.c:320:9: warning: no previous prototype for function 'is_visible_func' [-Wmissing-prototypes]
   umode_t is_visible_func(const void *d, enum hwmon_sensor_types type, u32 attr,
           ^
   drivers/hwmon/asetek_gen6.c:320:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   umode_t is_visible_func(const void *d, enum hwmon_sensor_types type, u32 attr,
   ^
   static 
   drivers/hwmon/asetek_gen6.c:475:5: warning: no previous prototype for function 'read_func' [-Wmissing-prototypes]
   int read_func(struct device *dev, enum hwmon_sensor_types type, u32 attr,
       ^
   drivers/hwmon/asetek_gen6.c:475:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   int read_func(struct device *dev, enum hwmon_sensor_types type, u32 attr,
   ^
   static 
   drivers/hwmon/asetek_gen6.c:556:6: warning: no previous prototype for function 'does_fan_exist' [-Wmissing-prototypes]
   bool does_fan_exist(struct driver *cdev, int channel)
        ^
   drivers/hwmon/asetek_gen6.c:556:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   bool does_fan_exist(struct driver *cdev, int channel)
   ^
   static 
   drivers/hwmon/asetek_gen6.c:569:16: warning: implicit conversion from 'int' to 'char' changes value from 600 to 88 [-Wconstant-conversion]
           send_buf[3] = 600;
                       ~ ^~~
   drivers/hwmon/asetek_gen6.c:584:5: warning: no previous prototype for function 'get_fan_count' [-Wmissing-prototypes]
   int get_fan_count(struct driver *dev)
       ^
   drivers/hwmon/asetek_gen6.c:584:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   int get_fan_count(struct driver *dev)
   ^
   static 
>> drivers/hwmon/asetek_gen6.c:650:30: error: too few arguments provided to function-like macro invocation
           dev_info("[*] Setup hwmon\n");
                                       ^
   include/linux/dev_printk.h:109:9: note: macro 'dev_info' defined here
   #define dev_info(dev, fmt, ...)                                         \
           ^
>> drivers/hwmon/asetek_gen6.c:650:2: error: use of undeclared identifier 'dev_info'; did you mean '_dev_info'?
           dev_info("[*] Setup hwmon\n");
           ^~~~~~~~
           _dev_info
   include/linux/dev_printk.h:48:6: note: '_dev_info' declared here
   void _dev_info(const struct device *dev, const char *fmt, ...);
        ^
   drivers/hwmon/asetek_gen6.c:650:2: warning: expression result unused [-Wunused-value]
           dev_info("[*] Setup hwmon\n");
           ^~~~~~~~
   drivers/hwmon/asetek_gen6.c:593:6: warning: no previous prototype for function 'hwmon_init' [-Wmissing-prototypes]
   void hwmon_init(struct driver *dev)
        ^
   drivers/hwmon/asetek_gen6.c:593:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   void hwmon_init(struct driver *dev)
   ^
   static 
   drivers/hwmon/asetek_gen6.c:656:35: error: too few arguments provided to function-like macro invocation
           dev_info("[*] HWMON DISCONNECT\n");
                                            ^
   include/linux/dev_printk.h:109:9: note: macro 'dev_info' defined here
   #define dev_info(dev, fmt, ...)                                         \
           ^
   drivers/hwmon/asetek_gen6.c:656:2: error: use of undeclared identifier 'dev_info'; did you mean '_dev_info'?
           dev_info("[*] HWMON DISCONNECT\n");
           ^~~~~~~~
           _dev_info
   include/linux/dev_printk.h:48:6: note: '_dev_info' declared here
   void _dev_info(const struct device *dev, const char *fmt, ...);
        ^
   drivers/hwmon/asetek_gen6.c:656:2: warning: expression result unused [-Wunused-value]
           dev_info("[*] HWMON DISCONNECT\n");
           ^~~~~~~~
   drivers/hwmon/asetek_gen6.c:653:6: warning: no previous prototype for function 'hwmon_deinit' [-Wmissing-prototypes]
   void hwmon_deinit(struct driver *dev)
        ^
   drivers/hwmon/asetek_gen6.c:653:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   void hwmon_deinit(struct driver *dev)
   ^
   static 
   drivers/hwmon/asetek_gen6.c:670:5: warning: no previous prototype for function 'init_device' [-Wmissing-prototypes]
   int init_device(struct usb_device *udev)
       ^
   drivers/hwmon/asetek_gen6.c:670:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   int init_device(struct usb_device *udev)
   ^
   static 
   drivers/hwmon/asetek_gen6.c:688:5: warning: no previous prototype for function 'deinit_device' [-Wmissing-prototypes]
   int deinit_device(struct usb_device *udev)
       ^
   drivers/hwmon/asetek_gen6.c:688:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   int deinit_device(struct usb_device *udev)
   ^
   static 
   20 warnings and 8 errors generated.

vim +212 drivers/hwmon/asetek_gen6.c

   173	
   174	int set_fan_rpm_curve(struct driver *cdev, struct hwmon_fan_data *fan_data,
   175			      struct curve_point point[7])
   176	{
   177		int retval;
   178		int wrote;
   179		int sndpipe = usb_sndbulkpipe(cdev->udev, cdev->bulk_out_endpointAddr);
   180		int rcvpipe = usb_rcvbulkpipe(cdev->udev, cdev->bulk_in_endpointAddr);
   181		char *send_buf = cdev->bulk_out_buffer;
   182		char *recv_buf = cdev->bulk_in_buffer;
   183	
   184		memcpy(fan_data->curve, point, sizeof(fan_data->curve));
   185	
   186		send_buf[0] = 0x40;
   187		send_buf[1] = fan_data->fan_channel;
   188		send_buf[2] = point[0].temp;
   189		send_buf[3] = point[1].temp;
   190		send_buf[4] = point[2].temp;
   191		send_buf[5] = point[3].temp;
   192		send_buf[6] = point[4].temp;
   193		send_buf[7] = point[5].temp;
   194		send_buf[8] = point[6].temp;
   195		send_buf[9] = point[0].pwm;
   196		send_buf[10] = point[1].pwm;
   197		send_buf[11] = point[2].pwm;
   198		send_buf[12] = point[3].pwm;
   199		send_buf[13] = point[4].pwm;
   200		send_buf[14] = point[5].pwm;
   201		send_buf[15] = point[6].pwm;
   202	
   203		retval = usb_bulk_msg(cdev->udev, sndpipe, send_buf, 16, &wrote, 100);
   204		if (retval != 0)
   205			return retval;
   206	
   207		retval = usb_bulk_msg(cdev->udev, rcvpipe, recv_buf, 4, &wrote, 100);
   208		if (retval != 0)
   209			return retval;
   210	
   211		if (!check_succes(send_buf[0], recv_buf))
 > 212			dev_info("[*] Failled setting fan curve %d,%d,%d/%d\n",
 > 213				 recv_buf[0], recv_buf[1], recv_buf[2], recv_buf[3]);
   214		return 0;
   215	}
   216	
   217	int set_fan_target_rpm(struct driver *cdev, struct hwmon_fan_data *fan_data,
   218			       long val)
   219	{
   220		int retval;
   221		int wrote;
   222		int sndpipe = usb_sndbulkpipe(cdev->udev, cdev->bulk_out_endpointAddr);
   223		int rcvpipe = usb_rcvbulkpipe(cdev->udev, cdev->bulk_in_endpointAddr);
   224	
   225		char *send_buf = cdev->bulk_out_buffer;
   226		char *recv_buf = cdev->bulk_in_buffer;
   227	
   228		fan_data->fan_target = val;
   229		fan_data->fan_pwm_target = 0;
   230	
   231		send_buf[0] = 0x43;
   232		send_buf[1] = fan_data->fan_channel;
   233		send_buf[2] = (fan_data->fan_target >> 8);
   234		send_buf[3] = fan_data->fan_target;
   235	
   236		retval = usb_bulk_msg(cdev->udev, sndpipe, send_buf, 4, &wrote, 100);
   237		if (retval != 0)
   238			return retval;
   239	
   240		retval = usb_bulk_msg(cdev->udev, rcvpipe, recv_buf, 6, &wrote, 100000);
   241		if (retval != 0)
   242			return retval;
   243	
   244		//no error
   245		if (!check_succes(send_buf[0], recv_buf))
   246			dev_info("[*] Failled setting fan rpm %d,%d,%d/%d\n",
   247				 recv_buf[0], recv_buf[1], recv_buf[2], recv_buf[3]);
   248		return 0;
   249	}
   250	
   251	void get_fan_target_rpm(struct hwmon_fan_data *fan_data, long *val)
   252	{
   253		*val = fan_data->fan_target;
   254	}
   255	
   256	int get_fan_current_rpm(struct driver *cdev, struct hwmon_fan_data *fan_data,
   257				long *val)
   258	{
   259		int retval;
   260		int wrote;
   261		int sndpipe = usb_sndbulkpipe(cdev->udev, cdev->bulk_out_endpointAddr);
   262		int rcvpipe = usb_rcvbulkpipe(cdev->udev, cdev->bulk_in_endpointAddr);
   263	
   264		char *send_buf = cdev->bulk_out_buffer;
   265		char *recv_buf = cdev->bulk_in_buffer;
   266	
   267		send_buf[0] = 0x41;
   268		send_buf[1] = fan_data->fan_channel;
   269	
   270		retval = usb_bulk_msg(cdev->udev, sndpipe, send_buf, 2, &wrote, 100);
   271		if (retval != 0)
   272			return retval;
   273	
   274		retval = usb_bulk_msg(cdev->udev, rcvpipe, recv_buf, 6, &wrote, 100);
   275		if (retval != 0)
   276			return retval;
   277	
   278		if (!check_succes(0x41, recv_buf) ||
   279		    recv_buf[3] != fan_data->fan_channel)
   280			dev_info("[*] Failled retrieving fan rmp %d,%d,%d/%d\n",
   281				 recv_buf[0], recv_buf[1], recv_buf[2], recv_buf[3]);
   282	
   283		*val = (((uint8_t)recv_buf[4]) << 8) + (uint8_t)recv_buf[5];
   284		return 0;
   285	}
   286	
   287	int set_fan_target_pwm(struct driver *cdev, struct hwmon_fan_data *fan_data,
   288			       long val)
   289	{
   290		int retval;
   291		int wrote;
   292		int sndpipe = usb_sndbulkpipe(cdev->udev, cdev->bulk_out_endpointAddr);
   293		int rcvpipe = usb_rcvbulkpipe(cdev->udev, cdev->bulk_in_endpointAddr);
   294	
   295		unsigned char *send_buf = cdev->bulk_out_buffer;
   296		unsigned char *recv_buf = cdev->bulk_in_buffer;
   297	
   298		fan_data->fan_pwm_target = val;
   299		fan_data->fan_target = 0;
   300	
   301		send_buf[0] = 0x42;
   302		send_buf[1] = fan_data->fan_channel;
   303		send_buf[3] = fan_data->fan_pwm_target;
   304	
   305		retval = usb_bulk_msg(cdev->udev, sndpipe, send_buf, 4, &wrote, 100);
   306		if (retval != 0)
   307			return retval;
   308	
   309		retval = usb_bulk_msg(cdev->udev, rcvpipe, recv_buf, 6, &wrote, 100000);
   310		if (retval != 0)
   311			return retval;
   312	
   313		//no error
   314		if (!check_succes(send_buf[0], recv_buf))
   315			dev_info("[*] Failled setting fan pwm %d,%d,%d/%d\n",
 > 316				 recv_buf[0], recv_buf[1], recv_buf[2], recv_buf[3]);
   317		return 0;
   318	}
   319	

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

Attachment: .config.gz
Description: application/gzip


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

  Powered by Linux