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

isdn: kcapi: don't build unused procfs code

The procfs file is completely unused without CONFIG_PROC_FS but causes
a compile time warning:

drivers/isdn/capi/kcapi_proc.c:97:36: error: unused variable 'seq_controller_ops' [-Werror,-Wunused-const-variable]
static const struct seq_operations seq_controller_ops = {
drivers/isdn/capi/kcapi_proc.c:104:36: error: unused variable 'seq_contrstats_ops' [-Werror,-Wunused-const-variable]
drivers/isdn/capi/kcapi_proc.c:179:36: error: unused variable 'seq_applications_ops' [-Werror,-Wunused-const-variable]
drivers/isdn/capi/kcapi_proc.c:186:36: error: unused variable 'seq_applstats_ops' [-Werror,-Wunused-const-variable]

Remove the file from the build in that config and make the calls into
it conditional instead.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20240403080702.3509288-27-arnd@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Arnd Bergmann and committed by
Jakub Kicinski
91188544 17b35355

+7 -3
+2 -1
drivers/isdn/capi/Makefile
··· 2 2 # Makefile for the CAPI subsystem used by BT_CMTP 3 3 4 4 obj-$(CONFIG_BT_CMTP) += kernelcapi.o 5 - kernelcapi-y := kcapi.o capiutil.o capi.o kcapi_proc.o 5 + kernelcapi-y := kcapi.o capiutil.o capi.o 6 + kernelcapi-$(CONFIG_PROC_FS) += kcapi_proc.o
+5 -2
drivers/isdn/capi/kcapi.c
··· 917 917 return err; 918 918 } 919 919 920 - kcapi_proc_init(); 920 + if (IS_ENABLED(CONFIG_PROC_FS)) 921 + kcapi_proc_init(); 922 + 921 923 return 0; 922 924 } 923 925 924 926 void kcapi_exit(void) 925 927 { 926 - kcapi_proc_exit(); 928 + if (IS_ENABLED(CONFIG_PROC_FS)) 929 + kcapi_proc_exit(); 927 930 928 931 cdebug_exit(); 929 932 destroy_workqueue(kcapi_wq);