mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Mayank Mahajan <mayankmahajan.x@nxp.com>,
	linux@roeck-us.net, corbet@lwn.net, robh@kernel.org,
	krzk+dt@kernel.org, conor+dt@kernel.org,
	linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	priyanka.jain@nxp.com, vikash.bansal@nxp.com,
	Mayank Mahajan <mayankmahajan.x@nxp.com>
Subject: Re: [PATCH v4 2/3] hwmon: (tmp108) Add support for P3T1035 and P3T2030
Date: Sat, 17 Jan 2026 05:37:02 +0800	[thread overview]
Message-ID: <202601170516.uQw9DKHB-lkp@intel.com> (raw)
In-Reply-To: <20260116113554.986-2-mayankmahajan.x@nxp.com>

Hi Mayank,

kernel test robot noticed the following build errors:

[auto build test ERROR on 983d014aafb14ee5e4915465bf8948e8f3a723b5]

url:    https://github.com/intel-lab-lkp/linux/commits/Mayank-Mahajan/hwmon-tmp108-Add-support-for-P3T1035-and-P3T2030/20260116-193800
base:   983d014aafb14ee5e4915465bf8948e8f3a723b5
patch link:    https://lore.kernel.org/r/20260116113554.986-2-mayankmahajan.x%40nxp.com
patch subject: [PATCH v4 2/3] hwmon: (tmp108) Add support for P3T1035 and P3T2030
config: i386-buildonly-randconfig-004-20260117 (https://download.01.org/0day-ci/archive/20260117/202601170516.uQw9DKHB-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260117/202601170516.uQw9DKHB-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/202601170516.uQw9DKHB-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/hwmon/tmp108.c:123:33: error: call to undeclared function 'FIELD_GET'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     123 |                         *temp = tmp108->sample_times[FIELD_GET(TMP108_CONF_CONVRATE_FLD, regval)];
         |                                                      ^
>> drivers/hwmon/tmp108.c:210:9: error: call to undeclared function 'FIELD_PREP'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     210 |                                                   FIELD_PREP(TMP108_CONF_CONVRATE_FLD, index));
         |                                                   ^
   2 errors generated.


vim +/FIELD_GET +123 drivers/hwmon/tmp108.c

   109	
   110	static int tmp108_read(struct device *dev, enum hwmon_sensor_types type,
   111			       u32 attr, int channel, long *temp)
   112	{
   113		struct tmp108 *tmp108 = dev_get_drvdata(dev);
   114		unsigned int regval;
   115		int err, hyst;
   116	
   117		if (type == hwmon_chip) {
   118			if (attr == hwmon_chip_update_interval) {
   119				err = regmap_read(tmp108->regmap, TMP108_REG_CONF,
   120						  &regval);
   121				if (err < 0)
   122					return err;
 > 123				*temp = tmp108->sample_times[FIELD_GET(TMP108_CONF_CONVRATE_FLD, regval)];
   124				return 0;
   125			}
   126			return -EOPNOTSUPP;
   127		}
   128	
   129		switch (attr) {
   130		case hwmon_temp_input:
   131			/* Is it too early to return a conversion ? */
   132			if (time_before(jiffies, tmp108->ready_time)) {
   133				dev_dbg(dev, "%s: Conversion not ready yet..\n",
   134					__func__);
   135				return -EAGAIN;
   136			}
   137			err = regmap_read(tmp108->regmap, TMP108_REG_TEMP, &regval);
   138			if (err < 0)
   139				return err;
   140			*temp = tmp108_temp_reg_to_mC(regval);
   141			break;
   142		case hwmon_temp_min:
   143		case hwmon_temp_max:
   144			err = regmap_read(tmp108->regmap, attr == hwmon_temp_min ?
   145					  TMP108_REG_TLOW : TMP108_REG_THIGH, &regval);
   146			if (err < 0)
   147				return err;
   148			*temp = tmp108_temp_reg_to_mC(regval);
   149			break;
   150		case hwmon_temp_min_alarm:
   151		case hwmon_temp_max_alarm:
   152			err = regmap_read(tmp108->regmap, TMP108_REG_CONF, &regval);
   153			if (err < 0)
   154				return err;
   155			*temp = !!(regval & (attr == hwmon_temp_min_alarm ?
   156					     TMP108_CONF_FL : TMP108_CONF_FH));
   157			break;
   158		case hwmon_temp_min_hyst:
   159		case hwmon_temp_max_hyst:
   160			err = regmap_read(tmp108->regmap, TMP108_REG_CONF, &regval);
   161			if (err < 0)
   162				return err;
   163			switch (regval & TMP108_CONF_HYSTERESIS_MASK) {
   164			case TMP108_HYSTERESIS_0C:
   165			default:
   166				hyst = 0;
   167				break;
   168			case TMP108_HYSTERESIS_1C:
   169				hyst = 1000;
   170				break;
   171			case TMP108_HYSTERESIS_2C:
   172				hyst = 2000;
   173				break;
   174			case TMP108_HYSTERESIS_4C:
   175				hyst = 4000;
   176				break;
   177			}
   178			err = regmap_read(tmp108->regmap, attr == hwmon_temp_min_hyst ?
   179					  TMP108_REG_TLOW : TMP108_REG_THIGH, &regval);
   180			if (err < 0)
   181				return err;
   182			*temp = tmp108_temp_reg_to_mC(regval);
   183			if (attr == hwmon_temp_min_hyst)
   184				*temp += hyst;
   185			else
   186				*temp -= hyst;
   187			break;
   188		default:
   189			return -EOPNOTSUPP;
   190		}
   191	
   192		return 0;
   193	}
   194	
   195	static int tmp108_write(struct device *dev, enum hwmon_sensor_types type,
   196				u32 attr, int channel, long temp)
   197	{
   198		struct tmp108 *tmp108 = dev_get_drvdata(dev);
   199		u32 regval, mask;
   200		u8 index;
   201		int err;
   202	
   203		if (type == hwmon_chip) {
   204			if (attr == hwmon_chip_update_interval) {
   205				index = find_closest_descending(temp, tmp108->sample_times,
   206								tmp108->n_sample_times);
   207				return regmap_update_bits(tmp108->regmap,
   208							  TMP108_REG_CONF,
   209							  TMP108_CONF_CONVRATE_MASK,
 > 210							  FIELD_PREP(TMP108_CONF_CONVRATE_FLD, index));
   211			}
   212			return -EOPNOTSUPP;
   213		}
   214	
   215		switch (attr) {
   216		case hwmon_temp_min:
   217		case hwmon_temp_max:
   218			temp = clamp_val(temp, TMP108_TEMP_MIN_MC, TMP108_TEMP_MAX_MC);
   219			return regmap_write(tmp108->regmap,
   220					    attr == hwmon_temp_min ?
   221						TMP108_REG_TLOW : TMP108_REG_THIGH,
   222					    tmp108_mC_to_temp_reg(temp));
   223		case hwmon_temp_min_hyst:
   224		case hwmon_temp_max_hyst:
   225			temp = clamp_val(temp, TMP108_TEMP_MIN_MC, TMP108_TEMP_MAX_MC);
   226			err = regmap_read(tmp108->regmap,
   227					  attr == hwmon_temp_min_hyst ?
   228						TMP108_REG_TLOW : TMP108_REG_THIGH,
   229					  &regval);
   230			if (err < 0)
   231				return err;
   232			if (attr == hwmon_temp_min_hyst)
   233				temp -= tmp108_temp_reg_to_mC(regval);
   234			else
   235				temp = tmp108_temp_reg_to_mC(regval) - temp;
   236			if (temp < 500)
   237				mask = TMP108_HYSTERESIS_0C;
   238			else if (temp < 1500)
   239				mask = TMP108_HYSTERESIS_1C;
   240			else if (temp < 3000)
   241				mask = TMP108_HYSTERESIS_2C;
   242			else
   243				mask = TMP108_HYSTERESIS_4C;
   244			return regmap_update_bits(tmp108->regmap, TMP108_REG_CONF,
   245						  TMP108_CONF_HYSTERESIS_MASK, mask);
   246		default:
   247			return -EOPNOTSUPP;
   248		}
   249	}
   250	

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

  reply	other threads:[~2026-01-16 21:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-16 11:35 [PATCH v4 1/3] dt-bindings: hwmon: ti,tmp108: Add P3T1035,P3T2030 Mayank Mahajan
2026-01-16 11:35 ` [PATCH v4 2/3] hwmon: (tmp108) Add support for P3T1035 and P3T2030 Mayank Mahajan
2026-01-16 21:37   ` kernel test robot [this message]
2026-01-16 22:28   ` Frank Li
2026-01-17  0:36     ` Guenter Roeck
2026-01-18 17:30       ` Frank Li
2026-01-19  1:45         ` Guenter Roeck
2026-01-16 11:35 ` [PATCH v4 3/3] hwmon: (tmp108) Add P3T1035 and P3T2030 support Mayank Mahajan
2026-01-16 14:38 ` [PATCH v4 1/3] dt-bindings: hwmon: ti,tmp108: Add P3T1035,P3T2030 Krzysztof Kozlowski

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=202601170516.uQw9DKHB-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=conor+dt@kernel.org \
    --cc=corbet@lwn.net \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=llvm@lists.linux.dev \
    --cc=mayankmahajan.x@nxp.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=priyanka.jain@nxp.com \
    --cc=robh@kernel.org \
    --cc=vikash.bansal@nxp.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

all inboxes | Powered by JetHome®