watchdog: Don't use "proxy" headers
PATCH 1/1 watchdog: Don't use "proxy" headers
Update header inclusions to follow IWYU (Include What You Use) principle.
Note that kernel.h is discouraged to be included as it's written at the top of that file.
--- include/linux/watchdog.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
include/linux/watchdog.h +8 -4
@@ -9,14 +9,18 @@#ifndef _LINUX_WATCHDOG_H#define _LINUX_WATCHDOG_H -#include <linux/bitops.h> -#include <linux/cdev.h> -#include <linux/device.h> -#include <linux/kernel.h> +#include <linux/limits.h> #include <linux/notifier.h> +#include <linux/printk.h> +#include <linux/types.h> +#include <uapi/linux/watchdog.h> +struct attribute_group ; +struct device ; +struct module ; +struct watchdog_ops ;struct watchdog_device ;struct watchdog_core_data ;
Signature · 1 line
2.47.2
Quoted 5 lines · Andy Shevchenko
Update header inclusions to follow IWYU (Include What You Use) principle.
Note that
kernel.his discouraged to be included as it's written at the top of that file.
This doesn't compile in some cases, please ignore. I will send a v2 shortly after additional testing.
Signature · 2 lines
With Best Regards, Andy Shevchenko
kernel test robot
build botkernel test robot noticed the following build errors:
Hi Andy,
kernel test robot noticed the following build errors:
[auto build test ERROR on groeck-staging/hwmon-next]
[also build test ERROR on linus/master v6.16-rc3 next-20250626] [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/Andy-Shevchenko/watchdog-Don-t-use-proxy-headers/20250627-005755 base: https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-next patch link: https://lore.kernel.org/r/20250626165145.327685-1-andriy.shevchenko%40linux.intel.com patch subject: [PATCH v1 1/1] watchdog: Don't use "proxy" headers config: arc-randconfig-001-20250627 (https://download.01.org/0day-ci/archive/20250627/[email protected]/config) compiler: arc-linux-gcc (GCC) 8.5.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250627/[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 drivers/watchdog/watchdog_pretimeout.c:12:
>> drivers/watchdog/watchdog_core.h:41:16: error: field 'dev' has incomplete type
struct device dev;
^~~
drivers/watchdog/watchdog_core.h:42:14: error: field 'cdev' has incomplete type
struct cdev cdev;
^~~~
drivers/watchdog/watchdog_pretimeout.c: In function 'watchdog_pretimeout_available_governors_get':
>> drivers/watchdog/watchdog_pretimeout.c:59:12: error: implicit declaration of function 'sysfs_emit_at'; did you mean 'sysfs_streq'? [-Werror=implicit-function-declaration]
count += sysfs_emit_at(buf, count, "%s\n", priv->gov->name);
^~~~~~~~~~~~~
sysfs_streq
drivers/watchdog/watchdog_pretimeout.c: In function 'watchdog_pretimeout_governor_get':
>> drivers/watchdog/watchdog_pretimeout.c:72:11: error: implicit declaration of function 'sysfs_emit'; did you mean 'sysfs_streq'? [-Werror=implicit-function-declaration]
count = sysfs_emit(buf, "%s\n", wdd->gov->name);
^~~~~~~~~~
sysfs_streqcc1: some warnings being treated as errors
vim +/dev +41 drivers/watchdog/watchdog_core.h
45f5fed30a6460e Alan Cox 2012-05-10 31
7b7d2fdc8c3e3f9 Curtis Klein 2021-02-03 32 /*
7b7d2fdc8c3e3f9 Curtis Klein 2021-02-03 33 * struct watchdog_core_data - watchdog core internal data
7b7d2fdc8c3e3f9 Curtis Klein 2021-02-03 34 * @dev: The watchdog's internal device
7b7d2fdc8c3e3f9 Curtis Klein 2021-02-03 35 * @cdev: The watchdog's Character device.
7b7d2fdc8c3e3f9 Curtis Klein 2021-02-03 36 * @wdd: Pointer to watchdog device.
7b7d2fdc8c3e3f9 Curtis Klein 2021-02-03 37 * @lock: Lock for watchdog core.
7b7d2fdc8c3e3f9 Curtis Klein 2021-02-03 38 * @status: Watchdog core internal status bits.
7b7d2fdc8c3e3f9 Curtis Klein 2021-02-03 39 */
7b7d2fdc8c3e3f9 Curtis Klein 2021-02-03 40 struct watchdog_core_data {
7b7d2fdc8c3e3f9 Curtis Klein 2021-02-03 @41 struct device dev;
7b7d2fdc8c3e3f9 Curtis Klein 2021-02-03 42 struct cdev cdev;
7b7d2fdc8c3e3f9 Curtis Klein 2021-02-03 43 struct watchdog_device *wdd;
7b7d2fdc8c3e3f9 Curtis Klein 2021-02-03 44 struct mutex lock;
7b7d2fdc8c3e3f9 Curtis Klein 2021-02-03 45 ktime_t last_keepalive;
7b7d2fdc8c3e3f9 Curtis Klein 2021-02-03 46 ktime_t last_hw_keepalive;
7b7d2fdc8c3e3f9 Curtis Klein 2021-02-03 47 ktime_t open_deadline;
7b7d2fdc8c3e3f9 Curtis Klein 2021-02-03 48 struct hrtimer timer;
7b7d2fdc8c3e3f9 Curtis Klein 2021-02-03 49 struct kthread_work work;
7b7d2fdc8c3e3f9 Curtis Klein 2021-02-03 50 #if IS_ENABLED(CONFIG_WATCHDOG_HRTIMER_PRETIMEOUT)
7b7d2fdc8c3e3f9 Curtis Klein 2021-02-03 51 struct hrtimer pretimeout_timer;
7b7d2fdc8c3e3f9 Curtis Klein 2021-02-03 52 #endif
7b7d2fdc8c3e3f9 Curtis Klein 2021-02-03 53 unsigned long status; /* Internal status bits */
7b7d2fdc8c3e3f9 Curtis Klein 2021-02-03 54 #define _WDOG_DEV_OPEN 0 /* Opened ? */
7b7d2fdc8c3e3f9 Curtis Klein 2021-02-03 55 #define _WDOG_ALLOW_RELEASE 1 /* Did we receive the magic char ? */
7b7d2fdc8c3e3f9 Curtis Klein 2021-02-03 56 #define _WDOG_KEEPALIVE 2 /* Did we receive a keepalive ? */
7b7d2fdc8c3e3f9 Curtis Klein 2021-02-03 57 };7b7d2fdc8c3e3f9 Curtis Klein 2021-02-03 58
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki