devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Jerome Brunet <jbrunet@baylibre.com>,
	Jean Delvare <jdelvare@suse.com>,
	Guenter Roeck <linux@roeck-us.net>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Jonathan Corbet <corbet@lwn.net>,
	Delphine CC Chiu <Delphine_CC_Chiu@wiwynn.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-hwmon@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-doc@vger.kernel.org, linux-i2c@vger.kernel.org
Subject: Re: [PATCH 3/3] hwmon: (pmbus/tps25990): add initial support
Date: Tue, 10 Sep 2024 16:08:16 +0800	[thread overview]
Message-ID: <202409101522.ZoP360wM-lkp@intel.com> (raw)
In-Reply-To: <20240909-tps25990-v1-3-39b37e43e795@baylibre.com>

Hi Jerome,

kernel test robot noticed the following build errors:

[auto build test ERROR on d22bd451d5606411895ef55cb105277e4f4f6e54]

url:    https://github.com/intel-lab-lkp/linux/commits/Jerome-Brunet/dt-bindings-hwmon-pmbus-add-ti-tps25990-documentation/20240909-234152
base:   d22bd451d5606411895ef55cb105277e4f4f6e54
patch link:    https://lore.kernel.org/r/20240909-tps25990-v1-3-39b37e43e795%40baylibre.com
patch subject: [PATCH 3/3] hwmon: (pmbus/tps25990): add initial support
config: m68k-allmodconfig (https://download.01.org/0day-ci/archive/20240910/202409101522.ZoP360wM-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 14.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240910/202409101522.ZoP360wM-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/202409101522.ZoP360wM-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/hwmon/pmbus/tps25990.c: In function 'tps25990_read_word':
>> drivers/hwmon/pmbus/tps25990.c:267:23: error: implicit declaration of function 'FIELD_GET' [-Wimplicit-function-declaration]
     267 |                 ret = FIELD_GET(PK_MIN_AVG_AVG_CNT, ret);
         |                       ^~~~~~~~~
   drivers/hwmon/pmbus/tps25990.c: In function 'tps25990_write_word':
>> drivers/hwmon/pmbus/tps25990.c:337:46: error: implicit declaration of function 'FIELD_PREP' [-Wimplicit-function-declaration]
     337 |                                              FIELD_PREP(PK_MIN_AVG_AVG_CNT, value));
         |                                              ^~~~~~~~~~


vim +/FIELD_GET +267 drivers/hwmon/pmbus/tps25990.c

   254	
   255	static int tps25990_read_word(struct i2c_client *client,
   256				      int page, int phase, int reg)
   257	{
   258		int ret, addr;
   259	
   260		addr = tps25990_get_addr(reg);
   261		if (addr < 0)
   262			return addr;
   263	
   264		switch (reg) {
   265		case PMBUS_VIRT_SAMPLES:
   266			ret = pmbus_read_byte_data(client, page, addr);
 > 267			ret = FIELD_GET(PK_MIN_AVG_AVG_CNT, ret);
   268			break;
   269	
   270		case PMBUS_IIN_OC_FAULT_LIMIT:
   271			ret = pmbus_read_byte_data(client, page, addr);
   272			break;
   273	
   274		default:
   275			ret = pmbus_read_word_data(client, page, -1, addr);
   276			break;
   277		}
   278	
   279		if (ret >= 0)
   280			ret = tps25990_read_adapt_value(reg, ret);
   281	
   282		return ret;
   283	}
   284	
   285	static int tps25990_write_adapt_value(int reg, int val)
   286	{
   287		switch (reg) {
   288		case PMBUS_VIN_UV_WARN_LIMIT:
   289		case PMBUS_VIN_UV_FAULT_LIMIT:
   290		case PMBUS_VIN_OV_WARN_LIMIT:
   291		case PMBUS_VOUT_UV_WARN_LIMIT:
   292		case PMBUS_IIN_OC_WARN_LIMIT:
   293		case PMBUS_OT_WARN_LIMIT:
   294		case PMBUS_OT_FAULT_LIMIT:
   295		case PMBUS_PIN_OP_WARN_LIMIT:
   296		case PMBUS_POWER_GOOD_OFF:
   297			val >>= TPS25990_8B_SHIFT;
   298			val = clamp(val, 0, 0xff);
   299			break;
   300	
   301		case PMBUS_VIN_OV_FAULT_LIMIT:
   302			val -= TPS25990_VIN_OVF_OFF;
   303			val = DIV_ROUND_CLOSEST(val * TPS25990_VIN_OVF_DIV, TPS25990_VIN_OVF_NUM);
   304			val = clamp_val(val, 0, 0xf);
   305			break;
   306	
   307		case PMBUS_IIN_OC_FAULT_LIMIT:
   308			val -= TPS25990_IIN_OCF_OFF;
   309			val = DIV_ROUND_CLOSEST(val * TPS25990_IIN_OCF_DIV, TPS25990_IIN_OCF_NUM);
   310			val = clamp_val(val, 0, 0x3f);
   311			break;
   312	
   313		case PMBUS_VIRT_SAMPLES:
   314			val = clamp_val(val, 1, 1 << PK_MIN_AVG_AVG_CNT);
   315			val = ilog2(val);
   316			break;
   317		}
   318	
   319		return val;
   320	}
   321	
   322	static int tps25990_write_word(struct i2c_client *client,
   323				       int page, int reg, u16 value)
   324	{
   325		int addr, ret;
   326	
   327		addr = tps25990_get_addr(reg);
   328		if (addr < 0)
   329			return addr;
   330	
   331		value = tps25990_write_adapt_value(reg, value);
   332	
   333		switch (reg) {
   334		case PMBUS_VIRT_SAMPLES:
   335			ret = pmbus_update_byte_data(client, page, addr,
   336						     PK_MIN_AVG_AVG_CNT,
 > 337						     FIELD_PREP(PK_MIN_AVG_AVG_CNT, value));
   338			break;
   339	
   340		case PMBUS_IIN_OC_FAULT_LIMIT:
   341			ret = pmbus_write_byte_data(client, page, addr,
   342						    value);
   343			break;
   344	
   345		default:
   346			ret = pmbus_write_word_data(client, page, addr, value);
   347			break;
   348		}
   349	
   350		return ret;
   351	}
   352	

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

  parent reply	other threads:[~2024-09-10  8:09 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-09 15:39 [PATCH 0/3] hwmon: pmbus: add tps25990 efuse support Jerome Brunet
2024-09-09 15:39 ` [PATCH 1/3] dt-bindings: hwmon: pmbus: add ti tps25990 documentation Jerome Brunet
2024-09-10  7:48   ` Krzysztof Kozlowski
2024-09-10  9:31     ` Jerome Brunet
2024-09-11 14:45       ` Rob Herring
2024-09-11 17:26         ` Jerome Brunet
2024-09-16  8:45       ` Krzysztof Kozlowski
2024-09-09 15:39 ` [PATCH 2/3] hwmon: (pmbus/core) add POWER_GOOD signal limits support Jerome Brunet
2024-09-09 18:16   ` Guenter Roeck
2024-09-10  6:43     ` Jerome Brunet
2024-09-10 14:37       ` Guenter Roeck
2024-09-10 15:00         ` Jerome Brunet
2024-09-10 16:22           ` Guenter Roeck
2024-09-09 15:39 ` [PATCH 3/3] hwmon: (pmbus/tps25990): add initial support Jerome Brunet
2024-09-09 22:52   ` Guenter Roeck
2024-09-10  9:07     ` Jerome Brunet
2024-09-10 17:07       ` Guenter Roeck
2024-09-11  9:37         ` Jerome Brunet
2024-09-10  8:08   ` kernel test robot [this message]
2024-09-10 10:32   ` kernel test robot

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=202409101522.ZoP360wM-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=Delphine_CC_Chiu@wiwynn.com \
    --cc=conor+dt@kernel.org \
    --cc=corbet@lwn.net \
    --cc=devicetree@vger.kernel.org \
    --cc=jbrunet@baylibre.com \
    --cc=jdelvare@suse.com \
    --cc=krzk@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=robh@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).