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

zorro: Refactor conditional handling of Zorro device name database

Using an empty static inline function in the CONFIG_ZORRO_NAMES=n case
allows to drop compilation of names.c.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

+7 -11
+2 -1
drivers/zorro/Makefile
··· 2 2 # Makefile for the Zorro bus specific drivers. 3 3 # 4 4 5 - obj-$(CONFIG_ZORRO) += zorro.o zorro-driver.o zorro-sysfs.o names.o 5 + obj-$(CONFIG_ZORRO) += zorro.o zorro-driver.o zorro-sysfs.o 6 6 obj-$(CONFIG_PROC_FS) += proc.o 7 + obj-$(CONFIG_ZORRO_NAMES) += names.o 7 8 8 9 hostprogs-y := gen-devlist 9 10
-10
drivers/zorro/names.c
··· 15 15 #include <linux/zorro.h> 16 16 17 17 18 - #ifdef CONFIG_ZORRO_NAMES 19 - 20 18 struct zorro_prod_info { 21 19 __u16 prod; 22 20 unsigned short seen; ··· 95 97 } 96 98 } 97 99 } 98 - 99 - #else 100 - 101 - void __init zorro_name_device(struct zorro_dev *dev) 102 - { 103 - } 104 - 105 - #endif
+5
drivers/zorro/zorro.h
··· 1 1 2 + #ifdef CONFIG_ZORRO_NAMES 2 3 extern void zorro_name_device(struct zorro_dev *z); 4 + #else 5 + static inline void zorro_name_device(struct zorro_dev *dev) { } 6 + #endif 7 + 3 8 extern int zorro_create_sysfs_dev_files(struct zorro_dev *z); 4 9