[groeck-staging:hwmon 7/14] drivers/hwmon/hwmon.c:789:19: error: implicit declaration of function 'is_hwmon_device'; did you mean 'to_hwmon_device'?

kernel test robot <[email protected]>
Newsgroups dev.linux.lists.oe-kbuild-all
Message-ID <[email protected]>
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon
head:   ece58c6620869b5d7f0e1305370df473367c085d
commit: b6868a406c5b0bde10303f596fa95010ad68a456 [7/14] hwmon: Ensure that 'dev' passed to hwmon_notify_event() is a hwmon device
config: alpha-defconfig (https://download.01.org/0day-ci/archive/20260822/[email protected]/config)
compiler: alpha-linux-gcc (GCC) 16.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260822/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

   In file included from arch/alpha/include/asm/bug.h:23,
                    from include/linux/bug.h:5,
                    from include/linux/thread_info.h:13,
                    from include/asm-generic/current.h:6,
                    from ./arch/alpha/include/generated/asm/current.h:1,
                    from include/linux/sched.h:12,
                    from include/linux/ratelimit.h:6,
                    from include/linux/dev_printk.h:16,
                    from include/linux/device.h:15,
                    from drivers/hwmon/hwmon.c:13:
   drivers/hwmon/hwmon.c: In function 'hwmon_notify_event':
>> drivers/hwmon/hwmon.c:789:19: error: implicit declaration of function 'is_hwmon_device'; did you mean 'to_hwmon_device'? [-Wimplicit-function-declaration]
     789 |         if (WARN(!is_hwmon_device(dev), "%s is not a hardware monitoring device\n",
         |                   ^~~~~~~~~~~~~~~
   include/asm-generic/bug.h:164:32: note: in definition of macro 'WARN'
     164 |         int __ret_warn_on = !!(condition);                              \
         |                                ^~~~~~~~~


vim +789 drivers/hwmon/hwmon.c

   778	
   779	int hwmon_notify_event(struct device *dev, enum hwmon_sensor_types type,
   780			       u32 attr, int channel)
   781	{
   782		char event[MAX_SYSFS_ATTR_NAME_LENGTH + 5];
   783		char sattr[MAX_SYSFS_ATTR_NAME_LENGTH];
   784		char *envp[] = { event, NULL };
   785		const char * const *templates;
   786		const char *template;
   787		int base;
   788	
 > 789		if (WARN(!is_hwmon_device(dev), "%s is not a hardware monitoring device\n",
   790			 dev_name(dev)))
   791			return -EINVAL;
   792		if (type >= ARRAY_SIZE(__templates))
   793			return -EINVAL;
   794		if (attr >= __templates_size[type])
   795			return -EINVAL;
   796	
   797		templates = __templates[type];
   798		template = templates[attr];
   799	
   800		base = hwmon_attr_base(type);
   801	
   802		scnprintf(sattr, MAX_SYSFS_ATTR_NAME_LENGTH, template, base + channel);
   803		scnprintf(event, sizeof(event), "NAME=%s", sattr);
   804		sysfs_notify(&dev->kobj, NULL, sattr);
   805		kobject_uevent_env(&dev->kobj, KOBJ_CHANGE, envp);
   806	
   807		if (type == hwmon_temp)
   808			hwmon_thermal_notify(dev, channel);
   809	
   810		return 0;
   811	}
   812	EXPORT_SYMBOL_GPL(hwmon_notify_event);
   813	

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.