All of lore.kernel.org
 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: llvm@lists.linux.dev, 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 18:32:18 +0800	[thread overview]
Message-ID: <202409101807.GjHADcvQ-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: hexagon-allyesconfig (https://download.01.org/0day-ci/archive/20240910/202409101807.GjHADcvQ-lkp@intel.com/config)
compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project 05f5a91d00b02f4369f46d076411c700755ae041)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240910/202409101807.GjHADcvQ-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/202409101807.GjHADcvQ-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from drivers/hwmon/pmbus/tps25990.c:9:
   In file included from include/linux/i2c.h:19:
   In file included from include/linux/regulator/consumer.h:35:
   In file included from include/linux/suspend.h:5:
   In file included from include/linux/swap.h:9:
   In file included from include/linux/memcontrol.h:13:
   In file included from include/linux/cgroup.h:25:
   In file included from include/linux/kernel_stat.h:8:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:11:
   In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:14:
   In file included from arch/hexagon/include/asm/io.h:328:
   include/asm-generic/io.h:548:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     548 |         val = __raw_readb(PCI_IOBASE + addr);
         |                           ~~~~~~~~~~ ^
   include/asm-generic/io.h:561:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     561 |         val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
         |                                                         ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu'
      37 | #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
         |                                                   ^
   In file included from drivers/hwmon/pmbus/tps25990.c:9:
   In file included from include/linux/i2c.h:19:
   In file included from include/linux/regulator/consumer.h:35:
   In file included from include/linux/suspend.h:5:
   In file included from include/linux/swap.h:9:
   In file included from include/linux/memcontrol.h:13:
   In file included from include/linux/cgroup.h:25:
   In file included from include/linux/kernel_stat.h:8:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:11:
   In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:14:
   In file included from arch/hexagon/include/asm/io.h:328:
   include/asm-generic/io.h:574:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     574 |         val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
         |                                                         ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu'
      35 | #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
         |                                                   ^
   In file included from drivers/hwmon/pmbus/tps25990.c:9:
   In file included from include/linux/i2c.h:19:
   In file included from include/linux/regulator/consumer.h:35:
   In file included from include/linux/suspend.h:5:
   In file included from include/linux/swap.h:9:
   In file included from include/linux/memcontrol.h:13:
   In file included from include/linux/cgroup.h:25:
   In file included from include/linux/kernel_stat.h:8:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:11:
   In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:14:
   In file included from arch/hexagon/include/asm/io.h:328:
   include/asm-generic/io.h:585:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     585 |         __raw_writeb(value, PCI_IOBASE + addr);
         |                             ~~~~~~~~~~ ^
   include/asm-generic/io.h:595:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     595 |         __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
         |                                                       ~~~~~~~~~~ ^
   include/asm-generic/io.h:605:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     605 |         __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
         |                                                       ~~~~~~~~~~ ^
   In file included from drivers/hwmon/pmbus/tps25990.c:9:
   In file included from include/linux/i2c.h:19:
   In file included from include/linux/regulator/consumer.h:35:
   In file included from include/linux/suspend.h:5:
   In file included from include/linux/swap.h:9:
   In file included from include/linux/memcontrol.h:21:
   In file included from include/linux/mm.h:2228:
   include/linux/vmstat.h:514:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     514 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
>> drivers/hwmon/pmbus/tps25990.c:267:9: error: call to undeclared function 'FIELD_GET'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     267 |                 ret = FIELD_GET(PK_MIN_AVG_AVG_CNT, ret);
         |                       ^
>> drivers/hwmon/pmbus/tps25990.c:337:11: error: call to undeclared function 'FIELD_PREP'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     337 |                                              FIELD_PREP(PK_MIN_AVG_AVG_CNT, value));
         |                                              ^
   7 warnings and 2 errors generated.


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 10:33 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
2024-09-10 10:32   ` kernel test robot [this message]

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=202409101807.GjHADcvQ-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=llvm@lists.linux.dev \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.