From 6dcf37d8109a31ec1b95438a70e485a66fede848 Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Sat, 26 Sep 2009 18:04:06 +0100 Subject: [PATCH] Remove some more warnings from rx The mtu variable in InitPeerParams is in the wrong place. It's only required when the (never used) AFS_USERSPACE_IP_ADDR code is enabled. Move the variable to the appropriate location, and indent the if and endif directives in this section to try to make it clearer what the control flow is (my brain hurt) Remove the unused rx_pthread_n_event_wakeups variable ANSIfy rxi_syscall - we can't prototype it yet, sadly. Reviewed-on: http://gerrit.openafs.org/503 Tested-by: Derrick Brashear Reviewed-by: Derrick Brashear --- src/rx/rx_kcommon.c | 24 +++++++++++++----------- src/rx/rx_pthread.c | 8 -------- src/rx/rx_user.c | 6 +++--- 3 files changed, 16 insertions(+), 22 deletions(-) diff --git a/src/rx/rx_kcommon.c b/src/rx/rx_kcommon.c index 00b7cced3..d6f5be39f 100644 --- a/src/rx/rx_kcommon.c +++ b/src/rx/rx_kcommon.c @@ -409,10 +409,10 @@ rxi_InitPeerParams(struct rx_peer *pp) u_short rxmtu; #ifdef ADAPT_MTU - afs_int32 mtu; -#ifndef AFS_SUN5_ENV -#ifdef AFS_USERSPACE_IP_ADDR +# ifndef AFS_SUN5_ENV +# ifdef AFS_USERSPACE_IP_ADDR afs_int32 i; + afs_int32 mtu; i = rxi_Findcbi(pp->host); if (i == -1) { @@ -436,26 +436,26 @@ rxi_InitPeerParams(struct rx_peer *pp) } else { /* couldn't find the interface, so assume the worst */ pp->ifMTU = MIN(RX_REMOTE_PACKET_SIZE, rx_MyMaxSendSize); } -#else /* AFS_USERSPACE_IP_ADDR */ +# else /* AFS_USERSPACE_IP_ADDR */ AFS_IFNET_T ifn; -#if !defined(AFS_SGI62_ENV) +# if !defined(AFS_SGI62_ENV) if (numMyNetAddrs == 0) (void)rxi_GetIFInfo(); -#endif +# endif ifn = rxi_FindIfnet(pp->host, NULL); if (ifn) { pp->timeout.sec = 2; /* pp->timeout.usec = 0; */ pp->ifMTU = MIN(RX_MAX_PACKET_SIZE, rx_MyMaxSendSize); -#ifdef IFF_POINTOPOINT +# ifdef IFF_POINTOPOINT if (ifnet_flags(ifn) & IFF_POINTOPOINT) { /* wish we knew the bit rate and the chunk size, sigh. */ pp->timeout.sec = 4; pp->ifMTU = RX_PP_PACKET_SIZE; } -#endif /* IFF_POINTOPOINT */ +# endif /* IFF_POINTOPOINT */ /* Diminish the packet size to one based on the MTU given by * the interface. */ if (ifnet_mtu(ifn) > (RX_IPUDP_SIZE + RX_HEADER_SIZE)) { @@ -468,8 +468,10 @@ rxi_InitPeerParams(struct rx_peer *pp) /* pp->timeout.usec = 0; */ pp->ifMTU = MIN(RX_REMOTE_PACKET_SIZE, rx_MyMaxSendSize); } -#endif /* else AFS_USERSPACE_IP_ADDR */ -#else /* AFS_SUN5_ENV */ +# endif /* else AFS_USERSPACE_IP_ADDR */ +# else /* AFS_SUN5_ENV */ + afs_int32 mtu; + mtu = rxi_FindIfMTU(pp->host); if (mtu <= 0) { @@ -493,7 +495,7 @@ rxi_InitPeerParams(struct rx_peer *pp) } else { /* couldn't find the interface, so assume the worst */ pp->ifMTU = MIN(RX_REMOTE_PACKET_SIZE,rx_MyMaxSendSize); } -#endif /* AFS_SUN5_ENV */ +# endif /* AFS_SUN5_ENV */ #else /* ADAPT_MTU */ pp->rateFlag = 2; /* start timing after two full packets */ pp->timeout.sec = 2; diff --git a/src/rx/rx_pthread.c b/src/rx/rx_pthread.c index 88e1c0344..c3996ef7a 100644 --- a/src/rx/rx_pthread.c +++ b/src/rx/rx_pthread.c @@ -40,14 +40,6 @@ #include #include -/* - * Number of times the event handling thread was signalled because a new - * event was scheduled earlier than the lastest event. - * - * Protected by event_handler_mutex - */ -static long rx_pthread_n_event_wakeups; - /* Set rx_pthread_event_rescheduled if event_handler should just try * again instead of sleeping. * diff --git a/src/rx/rx_user.c b/src/rx/rx_user.c index 36d3b1f2f..4f331e44e 100644 --- a/src/rx/rx_user.c +++ b/src/rx/rx_user.c @@ -9,6 +9,8 @@ /* rx_user.c contains routines specific to the user space UNIX implementation of rx */ +/* rxi_syscall is currently not prototyped */ + #include #include @@ -459,9 +461,7 @@ fudge_netmask(afs_uint32 addr) #if !defined(AFS_AIX_ENV) && !defined(AFS_NT40_ENV) && !defined(AFS_LINUX20_ENV) int -rxi_syscall(a3, a4, a5) - afs_uint32 a3, a4; - void *a5; +rxi_syscall(afs_uint32 a3, afs_uint32 a4, void *a5) { afs_uint32 rcode; void (*old) (int); -- 2.39.5