public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Delphine CC Chiu <Delphine_CC_Chiu@wiwynn.com>,
	patrick@stwcx.xyz, Jean Delvare <jdelvare@suse.com>,
	Guenter Roeck <linux@roeck-us.net>
Cc: oe-kbuild-all@lists.linux.dev,
	Delphine CC Chiu <Delphine_CC_Chiu@wiwynn.com>,
	linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hwmon: max31790: support to config PWM as TACH
Date: Sat, 9 Sep 2023 02:38:56 +0800	[thread overview]
Message-ID: <202309090228.2bSFmAO8-lkp@intel.com> (raw)
In-Reply-To: <20230906084837.3043030-3-Delphine_CC_Chiu@wiwynn.com>

Hi Delphine,

kernel test robot noticed the following build warnings:

[auto build test WARNING on groeck-staging/hwmon-next]
[also build test WARNING on linus/master v6.5 next-20230908]
[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/Delphine-CC-Chiu/hwmon-max31790-support-to-config-PWM-as-TACH/20230906-165344
base:   https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-next
patch link:    https://lore.kernel.org/r/20230906084837.3043030-3-Delphine_CC_Chiu%40wiwynn.com
patch subject: [PATCH] hwmon: max31790: support to config PWM as TACH
config: x86_64-randconfig-161-20230907 (https://download.01.org/0day-ci/archive/20230909/202309090228.2bSFmAO8-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce: (https://download.01.org/0day-ci/archive/20230909/202309090228.2bSFmAO8-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202309090228.2bSFmAO8-lkp@intel.com/

smatch warnings:
drivers/hwmon/max31790.c:511 max31790_config_pwm_as_tach() warn: unsigned 'fan_config' is never less than zero.

vim +/fan_config +511 drivers/hwmon/max31790.c

   482	
   483	static int max31790_config_pwm_as_tach(struct device *dev,
   484					       struct i2c_client *client)
   485	{
   486		struct device_node *np = dev->of_node;
   487		int i, ret = 0, size, channel;
   488		u8 pwm_index[NR_CHANNEL] = { 0 };
   489		u8 fan_config;
   490	
   491		size = of_property_count_u8_elems(np, "pwm-as-tach");
   492	
   493		if ((size > 0) && (size <= NR_CHANNEL)) {
   494			ret = of_property_read_u8_array(np, "pwm-as-tach", pwm_index,
   495							size);
   496			if (ret) {
   497				dev_err(dev,
   498					"Property 'pwm-as-tach' cannot be read.\n");
   499				return ret;
   500			}
   501	
   502			for (i = 0; i < size; i++) {
   503				if ((pwm_index[i] == 0) ||
   504				    (pwm_index[i] > NR_CHANNEL)) {
   505					continue;
   506				}
   507	
   508				channel = pwm_index[i] - 1;
   509				fan_config = i2c_smbus_read_byte_data(
   510					client, MAX31790_REG_FAN_CONFIG(channel));
 > 511				if (fan_config < 0) {
   512					dev_err(dev,
   513						"Read fan config for channel %d failed.\n",
   514						channel);
   515					return fan_config;
   516				}
   517	
   518				fan_config |= (MAX31790_FAN_CFG_CTRL_MON |
   519					       MAX31790_FAN_CFG_TACH_INPUT);
   520				i2c_smbus_write_byte_data(
   521					client, MAX31790_REG_FAN_CONFIG(channel),
   522					fan_config);
   523			}
   524		}
   525	
   526		return 0;
   527	}
   528	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

  parent reply	other threads:[~2023-09-08 18:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-06  8:48 [PATCH v1 0/1] hwmon: max31790: support to config PWM as TACH Delphine CC Chiu
2023-09-06  8:48 ` [PATCH v1 1/1] " Delphine CC Chiu
2023-09-06  8:48 ` [PATCH] " Delphine CC Chiu
2023-09-06 16:20   ` Guenter Roeck
2023-09-13  8:51     ` Delphine_CC_Chiu/WYHQ/Wiwynn
2023-09-13 13:37       ` Guenter Roeck
2023-09-15  8:13         ` Delphine_CC_Chiu/WYHQ/Wiwynn
2023-09-08 18:38   ` kernel test robot [this message]
2023-09-06 16:11 ` [PATCH v1 0/1] " Guenter Roeck

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=202309090228.2bSFmAO8-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=Delphine_CC_Chiu@wiwynn.com \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=patrick@stwcx.xyz \
    /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