From f5bafb0680a063d710b6e5e8ccf833f1dd371896 Mon Sep 17 00:00:00 2001 From: Cheyenne Wills Date: Wed, 07 Feb 2024 19:34:29 -0700 Subject: [PATCH] rx: Add function prototypes to rx_prototypes.h The prototype for rxk_NewSocketHost() is not in a header file, but is defined in the referencing .c file. The ARCH/rx_knet.c files that implement rxk_NewSocketHost() do not have a prototype (but when the rx_kcommon.c implementation is used it does have a prototype, since rx_kcommon.c is the "referencing .c file"). Add the prototype for rxk_NewSocketHost() to rx_prototypes.h and remove the prototype from rx_kcommon.c The prototypes for the functions rx_DebugOnOff() and rx_StatsOnOff() are defined within rx_prototypes.h, but are within a preprocessor conditional for AFS_NT40_ENV, however the implementation for these 2 functions do not have the preprocessor conditional. Rearrange the prototypes for rx_DebugOnOff() and rx_StatsOnOff() so they are outside the AFS_NT40_ENV preprocessor conditional. These functions are flagged due to missing prototypes when building against a Linux 6.8 kernel (which sets the -Wmissing-declarations and -Wmissing-prototypes compiler flags as default). Linux 6.8 commit: 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f). When building against a kernel with CONFIG_WERROR=y, the build fails. There are no functional changes in this commit. Reviewed-on: https://gerrit.openafs.org/15624 Reviewed-by: Mark Vitale Reviewed-by: Cheyenne Wills Tested-by: Benjamin Kaduk Reviewed-by: Benjamin Kaduk (cherry picked from commit 8528c36b96fe2935f42188caabf4feed0d5dbcbd) Change-Id: Ieae8be7f89f5c675c6580d8cfb02ea77ce4088f7 --- diff --git a/src/rx/rx_kcommon.c b/src/rx/rx_kcommon.c index b6a069c..c90df3d 100644 --- a/src/rx/rx_kcommon.c +++ b/src/rx/rx_kcommon.c @@ -33,7 +33,6 @@ int (*rxk_GetPacketProc) (struct rx_packet **ahandle, int asize); #endif -osi_socket *rxk_NewSocketHost(afs_uint32 ahost, short aport); extern struct interfaceAddr afs_cb_interface; rxk_ports_t rxk_ports; diff --git a/src/rx/rx_prototypes.h b/src/rx/rx_prototypes.h index 87a1049..6e1ae56 100644 --- a/src/rx/rx_prototypes.h +++ b/src/rx/rx_prototypes.h @@ -24,9 +24,10 @@ extern int rx_Init(u_int port); extern int rx_InitHost(u_int host, u_int port); -#ifdef AFS_NT40_ENV + extern void rx_DebugOnOff(int on); extern void rx_StatsOnOff(int on); +#ifdef AFS_NT40_ENV extern void rx_StartClientThread(void); #endif extern void rx_StartServer(int donateMe); @@ -332,6 +333,8 @@ extern void rxk_init(void); # endif +extern osi_socket *rxk_NewSocketHost(afs_uint32 ahost, short aport); + /* UKERNEL/rx_knet.c */ # ifdef UKERNEL extern void afs_rxevent_daemon(void);