Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

um: harddog: fix modular build

Since we no longer (want to) export any libc symbols the
_user portions of any drivers need to be built into image
rather than the module. I missed this for the watchdog.
Fix the watchdog accordingly.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Richard Weinberger <richard@nod.at>

authored by

Johannes Berg and committed by
Richard Weinberger
73a23d77 ac9a7868

+23 -7
+3 -1
arch/um/drivers/Makefile
··· 16 16 hostaudio-objs := hostaudio_kern.o 17 17 ubd-objs := ubd_kern.o ubd_user.o 18 18 port-objs := port_kern.o port_user.o 19 - harddog-objs := harddog_kern.o harddog_user.o 19 + harddog-objs := harddog_kern.o 20 + harddog-builtin-$(CONFIG_UML_WATCHDOG) := harddog_user.o harddog_user_exp.o 20 21 rtc-objs := rtc_kern.o rtc_user.o 21 22 22 23 LDFLAGS_pcap.o = $(shell $(CC) $(KBUILD_CFLAGS) -print-file-name=libpcap.a) ··· 61 60 obj-$(CONFIG_TTY_CHAN) += tty.o 62 61 obj-$(CONFIG_XTERM_CHAN) += xterm.o xterm_kern.o 63 62 obj-$(CONFIG_UML_WATCHDOG) += harddog.o 63 + obj-y += $(harddog-builtin-y) $(harddog-builtin-m) 64 64 obj-$(CONFIG_BLK_DEV_COW_COMMON) += cow_user.o 65 65 obj-$(CONFIG_UML_RANDOM) += random.o 66 66 obj-$(CONFIG_VIRTIO_UML) += virtio_uml.o
+9
arch/um/drivers/harddog.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + #ifndef UM_WATCHDOG_H 3 + #define UM_WATCHDOG_H 4 + 5 + int start_watchdog(int *in_fd_ret, int *out_fd_ret, char *sock); 6 + void stop_watchdog(int in_fd, int out_fd); 7 + int ping_watchdog(int fd); 8 + 9 + #endif /* UM_WATCHDOG_H */
+1 -6
arch/um/drivers/harddog_kern.c
··· 47 47 #include <linux/spinlock.h> 48 48 #include <linux/uaccess.h> 49 49 #include "mconsole.h" 50 + #include "harddog.h" 50 51 51 52 MODULE_LICENSE("GPL"); 52 53 ··· 60 59 /* 61 60 * Allow only one person to hold it open 62 61 */ 63 - 64 - extern int start_watchdog(int *in_fd_ret, int *out_fd_ret, char *sock); 65 62 66 63 static int harddog_open(struct inode *inode, struct file *file) 67 64 { ··· 91 92 return err; 92 93 } 93 94 94 - extern void stop_watchdog(int in_fd, int out_fd); 95 - 96 95 static int harddog_release(struct inode *inode, struct file *file) 97 96 { 98 97 /* ··· 108 111 109 112 return 0; 110 113 } 111 - 112 - extern int ping_watchdog(int fd); 113 114 114 115 static ssize_t harddog_write(struct file *file, const char __user *data, size_t len, 115 116 loff_t *ppos)
+1
arch/um/drivers/harddog_user.c
··· 7 7 #include <unistd.h> 8 8 #include <errno.h> 9 9 #include <os.h> 10 + #include "harddog.h" 10 11 11 12 struct dog_data { 12 13 int stdin_fd;
+9
arch/um/drivers/harddog_user_exp.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + #include <linux/export.h> 3 + #include "harddog.h" 4 + 5 + #if IS_MODULE(CONFIG_UML_WATCHDOG) 6 + EXPORT_SYMBOL(start_watchdog); 7 + EXPORT_SYMBOL(stop_watchdog); 8 + EXPORT_SYMBOL(ping_watchdog); 9 + #endif