Skip to contentSkip to conversation

staging: r8188eu: remove inline markings from functions in rtw_br_ext.c

PATCH In review Greg Kroah-Hartman 2 participants 4 messages Aug 16, 2021 Staging

lore
Share & tools
lore

Greg Kroah-Hartman

author maintainer
#0 lore raw

PATCH 1/2 staging: r8188eu: remove inline markings from functions in rtw_br_ext.c

The compiler is free to ignore, or follow, "inline" markings so they really have no use in .c files, so just remove them.

This allows functions to properly show up as being unused when all callers to them are removed, otherwise gcc does not warn you about this.

---
 drivers/staging/r8188eu/core/rtw_br_ext.c | 24 +++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)
drivers/staging/r8188eu/core/rtw_br_ext.c +12 -12
index 22737cd0fe44..fb2bb36f9e2c 100644
@@ -49,7 +49,7 @@
 -----------------------------------------------------------------*/
 
 /* Find a tag in pppoe frame and return the pointer */
-static inline unsigned char *__nat25_find_pppoe_tag(struct pppoe_hdr *ph, unsigned short type)
+static unsigned char *__nat25_find_pppoe_tag(struct pppoe_hdr *ph, unsigned short type)
 {
 	unsigned char *cur_ptr, *start_ptr;
 	unsigned short tagLen, tagType;
@@ -66,7 +66,7 @@ static inline unsigned char *__nat25_find_pppoe_tag(struct pppoe_hdr *ph, unsign
 	return NULL;
 }
 
-static inline int __nat25_add_pppoe_tag(struct sk_buff *skb, struct pppoe_tag *tag)
+static int __nat25_add_pppoe_tag(struct sk_buff *skb, struct pppoe_tag *tag)
 {
 	struct pppoe_hdr *ph = (struct pppoe_hdr *)(skb->data + ETH_HLEN);
 	int data_len;
@@ -106,7 +106,7 @@ static int skb_pull_and_merge(struct sk_buff *skb, unsigned char *src, int len)
 	return 0;
 }
 
-static inline unsigned long __nat25_timeout(struct adapter *priv)
+static unsigned long __nat25_timeout(struct adapter *priv)
 {
 	unsigned long timeout;
 
@@ -115,7 +115,7 @@ static inline unsigned long __nat25_timeout(struct adapter *priv)
 	return timeout;
 }
 
-static inline int  __nat25_has_expired(struct adapter *priv,
+static int  __nat25_has_expired(struct adapter *priv,
 				struct nat25_network_db_entry *fdb)
 {
 	if (time_before_eq(fdb->ageing_timer, __nat25_timeout(priv)))
@@ -124,7 +124,7 @@ static inline int  __nat25_has_expired(struct adapter *priv,
 	return 0;
 }
 
-static inline void __nat25_generate_ipv4_network_addr(unsigned char *networkAddr,
+static void __nat25_generate_ipv4_network_addr(unsigned char *networkAddr,
 				unsigned int *ipAddr)
 {
 	memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
@@ -133,7 +133,7 @@ static inline void __nat25_generate_ipv4_network_addr(unsigned char *networkAddr
 	memcpy(networkAddr+7, (unsigned char *)ipAddr, 4);
 }
 
-static inline void __nat25_generate_ipx_network_addr_with_node(unsigned char *networkAddr,
+static void __nat25_generate_ipx_network_addr_with_node(unsigned char *networkAddr,
 				__be32 *ipxNetAddr, unsigned char *ipxNodeAddr)
 {
 	memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
@@ -143,7 +143,7 @@ static inline void __nat25_generate_ipx_network_addr_with_node(unsigned char *ne
 	memcpy(networkAddr+5, ipxNodeAddr, 6);
 }
 
-static inline void __nat25_generate_ipx_network_addr_with_socket(unsigned char *networkAddr,
+static void __nat25_generate_ipx_network_addr_with_socket(unsigned char *networkAddr,
 				__be32 *ipxNetAddr, __be16 *ipxSocketAddr)
 {
 	memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
@@ -153,7 +153,7 @@ static inline void __nat25_generate_ipx_network_addr_with_socket(unsigned char *
 	memcpy(networkAddr+5, ipxSocketAddr, 2);
 }
 
-static inline void __nat25_generate_apple_network_addr(unsigned char *networkAddr,
+static void __nat25_generate_apple_network_addr(unsigned char *networkAddr,
 				__be16 *network, unsigned char *node)
 {
 	memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
@@ -163,7 +163,7 @@ static inline void __nat25_generate_apple_network_addr(unsigned char *networkAdd
 	networkAddr[3] = *node;
 }
 
-static inline void __nat25_generate_pppoe_network_addr(unsigned char *networkAddr,
+static void __nat25_generate_pppoe_network_addr(unsigned char *networkAddr,
 				unsigned char *ac_mac, __be16 *sid)
 {
 	memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
@@ -258,7 +258,7 @@ static int update_nd_link_layer_addr(unsigned char *data, int len, unsigned char
 	return 0;
 }
 
-static inline int __nat25_network_hash(unsigned char *networkAddr)
+static int __nat25_network_hash(unsigned char *networkAddr)
 {
 	if (networkAddr[0] == NAT25_IPV4) {
 		unsigned long x;
@@ -305,7 +305,7 @@ static inline int __nat25_network_hash(unsigned char *networkAddr)
 	}
 }
 
-static inline void __network_hash_link(struct adapter *priv,
+static void __network_hash_link(struct adapter *priv,
 				struct nat25_network_db_entry *ent, int hash)
 {
 	/*  Caller must spin_lock already! */
@@ -316,7 +316,7 @@ static inline void __network_hash_link(struct adapter *priv,
 	ent->pprev_hash = &priv->nethash[hash];
 }
 
-static inline void __network_hash_unlink(struct nat25_network_db_entry *ent)
+static void __network_hash_unlink(struct nat25_network_db_entry *ent)
 {
 	/*  Caller must spin_lock already! */
 	*ent->pprev_hash = ent->next_hash;
Signature · 1 line
2.32.0
author maintainer
#1 lore raw

PATCH 2/2 staging: r8188eu: remove ipx support from driver

The ipx.h header files are being removed from the kernel, and support for them was long removed from the tree, so remove all references to it in the r8188eu driver as well, to allow it to continue to build properly in linux-next

---
 drivers/staging/r8188eu/core/rtw_br_ext.c | 228 ----------------------
 1 file changed, 228 deletions(-)
drivers/staging/r8188eu/core/rtw_br_ext.c +0 -228
index fb2bb36f9e2c..8be025992270 100644
@@ -5,7 +5,6 @@
 
 #include "../include/linux/if_arp.h"
 #include "../include/net/ip.h"
-#include "../include/net/ipx.h"
 #include "../include/linux/atalk.h"
 #include "../include/linux/udp.h"
 #include "../include/linux/if_pppox.h"
@@ -133,36 +132,6 @@ static void __nat25_generate_ipv4_network_addr(unsigned char *networkAddr,
 	memcpy(networkAddr+7, (unsigned char *)ipAddr, 4);
 }
 
-static void __nat25_generate_ipx_network_addr_with_node(unsigned char *networkAddr,
-				__be32 *ipxNetAddr, unsigned char *ipxNodeAddr)
-{
-	memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
-
-	networkAddr[0] = NAT25_IPX;
-	memcpy(networkAddr+1, ipxNetAddr, 4);
-	memcpy(networkAddr+5, ipxNodeAddr, 6);
-}
-
-static void __nat25_generate_ipx_network_addr_with_socket(unsigned char *networkAddr,
-				__be32 *ipxNetAddr, __be16 *ipxSocketAddr)
-{
-	memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
-
-	networkAddr[0] = NAT25_IPX;
-	memcpy(networkAddr+1, ipxNetAddr, 4);
-	memcpy(networkAddr+5, ipxSocketAddr, 2);
-}
-
-static void __nat25_generate_apple_network_addr(unsigned char *networkAddr,
-				__be16 *network, unsigned char *node)
-{
-	memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
-
-	networkAddr[0] = NAT25_APPLE;
-	memcpy(networkAddr+1, network, 2);
-	networkAddr[3] = *node;
-}
-
 static void __nat25_generate_pppoe_network_addr(unsigned char *networkAddr,
 				unsigned char *ac_mac, __be16 *sid)
 {
@@ -584,203 +553,6 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
 		default:
 			return -1;
 		}
-	} else if ((protocol == ETH_P_IPX) ||
-		   (protocol <= ETH_FRAME_LEN)) {
-		/*---------------------------------------------------*/
-		/*         Handle IPX and Apple Talk frame           */
-		/*---------------------------------------------------*/
-		unsigned char ipx_header[2] = {0xFF, 0xFF};
-		struct ipxhdr	*ipx = NULL;
-		struct elapaarp	*ea = NULL;
-		struct ddpehdr	*ddp = NULL;
-		unsigned char *framePtr = skb->data + ETH_HLEN;
-
-		if (protocol == ETH_P_IPX) {
-			DEBUG_INFO("NAT25: Protocol = IPX (Ethernet II)\n");
-			ipx = (struct ipxhdr *)framePtr;
-		} else if (protocol <= ETH_FRAME_LEN) {
-			if (!memcmp(ipx_header, framePtr, 2)) {
-				DEBUG_INFO("NAT25: Protocol = IPX (Ethernet 802.3)\n");
-				ipx = (struct ipxhdr *)framePtr;
-			} else {
-				unsigned char ipx_8022_type =  0xE0;
-				unsigned char snap_8022_type = 0xAA;
-
-				if (*framePtr == snap_8022_type) {
-					unsigned char ipx_snap_id[5] = {0x0, 0x0, 0x0, 0x81, 0x37};		/*  IPX SNAP ID */
-					unsigned char aarp_snap_id[5] = {0x00, 0x00, 0x00, 0x80, 0xF3};	/*  Apple Talk AARP SNAP ID */
-					unsigned char ddp_snap_id[5] = {0x08, 0x00, 0x07, 0x80, 0x9B};	/*  Apple Talk DDP SNAP ID */
-
-					framePtr += 3;	/*  eliminate the 802.2 header */
-
-					if (!memcmp(ipx_snap_id, framePtr, 5)) {
-						framePtr += 5;	/*  eliminate the SNAP header */
-
-						DEBUG_INFO("NAT25: Protocol = IPX (Ethernet SNAP)\n");
-						ipx = (struct ipxhdr *)framePtr;
-					} else if (!memcmp(aarp_snap_id, framePtr, 5)) {
-						framePtr += 5;	/*  eliminate the SNAP header */
-
-						ea = (struct elapaarp *)framePtr;
-					} else if (!memcmp(ddp_snap_id, framePtr, 5)) {
-						framePtr += 5;	/*  eliminate the SNAP header */
-
-						ddp = (struct ddpehdr *)framePtr;
-					} else {
-						DEBUG_WARN("NAT25: Protocol = Ethernet SNAP %02x%02x%02x%02x%02x\n", framePtr[0],
-							framePtr[1], framePtr[2], framePtr[3], framePtr[4]);
-						return -1;
-					}
-				} else if (*framePtr == ipx_8022_type) {
-					framePtr += 3;	/*  eliminate the 802.2 header */
-
-					if (!memcmp(ipx_header, framePtr, 2)) {
-						DEBUG_INFO("NAT25: Protocol = IPX (Ethernet 802.2)\n");
-						ipx = (struct ipxhdr *)framePtr;
-					} else {
-						return -1;
-					}
-				} else {
-					return -1;
-				}
-			}
-		} else {
-			return -1;
-		}
-
-		/*   IPX   */
-		if (ipx) {
-			switch (method) {
-			case NAT25_CHECK:
-				if (!memcmp(skb->data+ETH_ALEN, ipx->ipx_source.node, ETH_ALEN))
-					DEBUG_INFO("NAT25: Check IPX skb_copy\n");
-				return 0;
-			case NAT25_INSERT:
-				DEBUG_INFO("NAT25: Insert IPX, Dest =%08x,%02x%02x%02x%02x%02x%02x,%04x Source =%08x,%02x%02x%02x%02x%02x%02x,%04x\n",
-					ipx->ipx_dest.net,
-					ipx->ipx_dest.node[0],
-					ipx->ipx_dest.node[1],
-					ipx->ipx_dest.node[2],
-					ipx->ipx_dest.node[3],
-					ipx->ipx_dest.node[4],
-					ipx->ipx_dest.node[5],
-					ipx->ipx_dest.sock,
-					ipx->ipx_source.net,
-					ipx->ipx_source.node[0],
-					ipx->ipx_source.node[1],
-					ipx->ipx_source.node[2],
-					ipx->ipx_source.node[3],
-					ipx->ipx_source.node[4],
-					ipx->ipx_source.node[5],
-					ipx->ipx_source.sock);
-
-				if (!memcmp(skb->data+ETH_ALEN, ipx->ipx_source.node, ETH_ALEN)) {
-					DEBUG_INFO("NAT25: Use IPX Net, and Socket as network addr\n");
-
-					__nat25_generate_ipx_network_addr_with_socket(networkAddr, &ipx->ipx_source.net, &ipx->ipx_source.sock);
-
-					/*  change IPX source node addr to wlan STA address */
-					memcpy(ipx->ipx_source.node, GET_MY_HWADDR(priv), ETH_ALEN);
-				} else {
-					__nat25_generate_ipx_network_addr_with_node(networkAddr, &ipx->ipx_source.net, ipx->ipx_source.node);
-				}
-				__nat25_db_network_insert(priv, skb->data+ETH_ALEN, networkAddr);
-				__nat25_db_print(priv);
-				return 0;
-			case NAT25_LOOKUP:
-				if (!memcmp(GET_MY_HWADDR(priv), ipx->ipx_dest.node, ETH_ALEN)) {
-					DEBUG_INFO("NAT25: Lookup IPX, Modify Destination IPX Node addr\n");
-
-					__nat25_generate_ipx_network_addr_with_socket(networkAddr, &ipx->ipx_dest.net, &ipx->ipx_dest.sock);
-
-					__nat25_db_network_lookup_and_replace(priv, skb, networkAddr);
-
-					/*  replace IPX destination node addr with Lookup destination MAC addr */
-					memcpy(ipx->ipx_dest.node, skb->data, ETH_ALEN);
-				} else {
-					__nat25_generate_ipx_network_addr_with_node(networkAddr, &ipx->ipx_dest.net, ipx->ipx_dest.node);
-
-					__nat25_db_network_lookup_and_replace(priv, skb, networkAddr);
-				}
-				return 0;
-			default:
-				return -1;
-			}
-		} else if (ea) {
-			/* Sanity check fields. */
-			if (ea->hw_len != ETH_ALEN || ea->pa_len != AARP_PA_ALEN) {
-				DEBUG_WARN("NAT25: Appletalk AARP Sanity check fail!\n");
-				return -1;
-			}
-
-			switch (method) {
-			case NAT25_CHECK:
-				return 0;
-			case NAT25_INSERT:
-				/*  change to AARP source mac address to wlan STA address */
-				memcpy(ea->hw_src, GET_MY_HWADDR(priv), ETH_ALEN);
-
-				DEBUG_INFO("NAT25: Insert AARP, Source =%d,%d Destination =%d,%d\n",
-					ea->pa_src_net,
-					ea->pa_src_node,
-					ea->pa_dst_net,
-					ea->pa_dst_node);
-
-				__nat25_generate_apple_network_addr(networkAddr, &ea->pa_src_net, &ea->pa_src_node);
-
-				__nat25_db_network_insert(priv, skb->data+ETH_ALEN, networkAddr);
-
-				__nat25_db_print(priv);
-				return 0;
-			case NAT25_LOOKUP:
-				DEBUG_INFO("NAT25: Lookup AARP, Source =%d,%d Destination =%d,%d\n",
-					ea->pa_src_net,
-					ea->pa_src_node,
-					ea->pa_dst_net,
-					ea->pa_dst_node);
-
-				__nat25_generate_apple_network_addr(networkAddr, &ea->pa_dst_net, &ea->pa_dst_node);
-
-				__nat25_db_network_lookup_and_replace(priv, skb, networkAddr);
-
-				/*  change to AARP destination mac address to Lookup result */
-				memcpy(ea->hw_dst, skb->data, ETH_ALEN);
-				return 0;
-			default:
-				return -1;
-			}
-		} else if (ddp) {
-			switch (method) {
-			case NAT25_CHECK:
-				return -1;
-			case NAT25_INSERT:
-				DEBUG_INFO("NAT25: Insert DDP, Source =%d,%d Destination =%d,%d\n",
-					ddp->deh_snet,
-					ddp->deh_snode,
-					ddp->deh_dnet,
-					ddp->deh_dnode);
-
-				__nat25_generate_apple_network_addr(networkAddr, &ddp->deh_snet, &ddp->deh_snode);
-
-				__nat25_db_network_insert(priv, skb->data+ETH_ALEN, networkAddr);
-
-				__nat25_db_print(priv);
-				return 0;
-			case NAT25_LOOKUP:
-				DEBUG_INFO("NAT25: Lookup DDP, Source =%d,%d Destination =%d,%d\n",
-					ddp->deh_snet,
-					ddp->deh_snode,
-					ddp->deh_dnet,
-					ddp->deh_dnode);
-				__nat25_generate_apple_network_addr(networkAddr, &ddp->deh_dnet, &ddp->deh_dnode);
-				__nat25_db_network_lookup_and_replace(priv, skb, networkAddr);
-				return 0;
-			default:
-				return -1;
-			}
-		}
-
-		return -1;
 	} else if ((protocol == ETH_P_PPP_DISC) ||
 		   (protocol == ETH_P_PPP_SES)) {
 		/*---------------------------------------------------*/
Signature · 1 line
2.32.0
Acked-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] staging: r8188eu: remove ipx support from driver

Quoted 266 lines · Greg Kroah-Hartman

The ipx.h header files are being removed from the kernel, and support for them was long removed from the tree, so remove all references to it in the r8188eu driver as well, to allow it to continue to build properly in linux-next

---
 drivers/staging/r8188eu/core/rtw_br_ext.c | 228 ----------------------
 1 file changed, 228 deletions(-)
drivers/staging/r8188eu/core/rtw_br_ext.c +0 -229
index fb2bb36f9e2c..8be025992270 100644
@@ -5,7 +5,6 @@
 
 #include "../include/linux/if_arp.h"
 #include "../include/net/ip.h"
-#include "../include/net/ipx.h"
 #include "../include/linux/atalk.h"
 #include "../include/linux/udp.h"
 #include "../include/linux/if_pppox.h"
@@ -133,36 +132,6 @@ static void __nat25_generate_ipv4_network_addr(unsigned char *networkAddr,
        memcpy(networkAddr+7, (unsigned char *)ipAddr, 4);
 }
 
-static void __nat25_generate_ipx_network_addr_with_node(unsigned char *networkAddr,
-                               __be32 *ipxNetAddr, unsigned char *ipxNodeAddr)
-{
-       memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
-
-       networkAddr[0] = NAT25_IPX;
-       memcpy(networkAddr+1, ipxNetAddr, 4);
-       memcpy(networkAddr+5, ipxNodeAddr, 6);
-}
-
-static void __nat25_generate_ipx_network_addr_with_socket(unsigned char *networkAddr,
-                               __be32 *ipxNetAddr, __be16 *ipxSocketAddr)
-{
-       memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
-
-       networkAddr[0] = NAT25_IPX;
-       memcpy(networkAddr+1, ipxNetAddr, 4);
-       memcpy(networkAddr+5, ipxSocketAddr, 2);
-}
-
-static void __nat25_generate_apple_network_addr(unsigned char *networkAddr,
-                               __be16 *network, unsigned char *node)
-{
-       memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
-
-       networkAddr[0] = NAT25_APPLE;
-       memcpy(networkAddr+1, network, 2);
-       networkAddr[3] = *node;
-}
-
 static void __nat25_generate_pppoe_network_addr(unsigned char *networkAddr,
                                unsigned char *ac_mac, __be16 *sid)
 {
@@ -584,203 +553,6 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
                default:
                        return -1;
                }
-       } else if ((protocol == ETH_P_IPX) ||
-                  (protocol <= ETH_FRAME_LEN)) {
-               /*---------------------------------------------------*/
-               /*         Handle IPX and Apple Talk frame           */
-               /*---------------------------------------------------*/
-               unsigned char ipx_header[2] = {0xFF, 0xFF};
-               struct ipxhdr   *ipx = NULL;
-               struct elapaarp *ea = NULL;
-               struct ddpehdr  *ddp = NULL;
-               unsigned char *framePtr = skb->data + ETH_HLEN;
-
-               if (protocol == ETH_P_IPX) {
-                       DEBUG_INFO("NAT25: Protocol = IPX (Ethernet II)\n");
-                       ipx = (struct ipxhdr *)framePtr;
-               } else if (protocol <= ETH_FRAME_LEN) {
-                       if (!memcmp(ipx_header, framePtr, 2)) {
-                               DEBUG_INFO("NAT25: Protocol = IPX (Ethernet 802.3)\n");
-                               ipx = (struct ipxhdr *)framePtr;
-                       } else {
-                               unsigned char ipx_8022_type =  0xE0;
-                               unsigned char snap_8022_type = 0xAA;
-
-                               if (*framePtr == snap_8022_type) {
-                                       unsigned char ipx_snap_id[5] = {0x0, 0x0, 0x0, 0x81, 0x37};             /*  IPX SNAP ID */
-                                       unsigned char aarp_snap_id[5] = {0x00, 0x00, 0x00, 0x80, 0xF3}; /*  Apple Talk AARP SNAP ID */
-                                       unsigned char ddp_snap_id[5] = {0x08, 0x00, 0x07, 0x80, 0x9B};  /*  Apple Talk DDP SNAP ID */
-
-                                       framePtr += 3;  /*  eliminate the 802.2 header */
-
-                                       if (!memcmp(ipx_snap_id, framePtr, 5)) {
-                                               framePtr += 5;  /*  eliminate the SNAP header */
-
-                                               DEBUG_INFO("NAT25: Protocol = IPX (Ethernet SNAP)\n");
-                                               ipx = (struct ipxhdr *)framePtr;
-                                       } else if (!memcmp(aarp_snap_id, framePtr, 5)) {
-                                               framePtr += 5;  /*  eliminate the SNAP header */
-
-                                               ea = (struct elapaarp *)framePtr;
-                                       } else if (!memcmp(ddp_snap_id, framePtr, 5)) {
-                                               framePtr += 5;  /*  eliminate the SNAP header */
-
-                                               ddp = (struct ddpehdr *)framePtr;
-                                       } else {
-                                               DEBUG_WARN("NAT25: Protocol = Ethernet SNAP %02x%02x%02x%02x%02x\n", framePtr[0],
-                                                       framePtr[1], framePtr[2], framePtr[3], framePtr[4]);
-                                               return -1;
-                                       }
-                               } else if (*framePtr == ipx_8022_type) {
-                                       framePtr += 3;  /*  eliminate the 802.2 header */
-
-                                       if (!memcmp(ipx_header, framePtr, 2)) {
-                                               DEBUG_INFO("NAT25: Protocol = IPX (Ethernet 802.2)\n");
-                                               ipx = (struct ipxhdr *)framePtr;
-                                       } else {
-                                               return -1;
-                                       }
-                               } else {
-                                       return -1;
-                               }
-                       }
-               } else {
-                       return -1;
-               }
-
-               /*   IPX   */
-               if (ipx) {
-                       switch (method) {
-                       case NAT25_CHECK:
-                               if (!memcmp(skb->data+ETH_ALEN, ipx->ipx_source.node, ETH_ALEN))
-                                       DEBUG_INFO("NAT25: Check IPX skb_copy\n");
-                               return 0;
-                       case NAT25_INSERT:
-                               DEBUG_INFO("NAT25: Insert IPX, Dest =%08x,%02x%02x%02x%02x%02x%02x,%04x Source =%08x,%02x%02x%02x%02x%02x%02x,%04x\n",
-                                       ipx->ipx_dest.net,
-                                       ipx->ipx_dest.node[0],
-                                       ipx->ipx_dest.node[1],
-                                       ipx->ipx_dest.node[2],
-                                       ipx->ipx_dest.node[3],
-                                       ipx->ipx_dest.node[4],
-                                       ipx->ipx_dest.node[5],
-                                       ipx->ipx_dest.sock,
-                                       ipx->ipx_source.net,
-                                       ipx->ipx_source.node[0],
-                                       ipx->ipx_source.node[1],
-                                       ipx->ipx_source.node[2],
-                                       ipx->ipx_source.node[3],
-                                       ipx->ipx_source.node[4],
-                                       ipx->ipx_source.node[5],
-                                       ipx->ipx_source.sock);
-
-                               if (!memcmp(skb->data+ETH_ALEN, ipx->ipx_source.node, ETH_ALEN)) {
-                                       DEBUG_INFO("NAT25: Use IPX Net, and Socket as network addr\n");
-
-                                       __nat25_generate_ipx_network_addr_with_socket(networkAddr, &ipx->ipx_source.net, &ipx->ipx_source.sock);
-
-                                       /*  change IPX source node addr to wlan STA address */
-                                       memcpy(ipx->ipx_source.node, GET_MY_HWADDR(priv), ETH_ALEN);
-                               } else {
-                                       __nat25_generate_ipx_network_addr_with_node(networkAddr, &ipx->ipx_source.net, ipx->ipx_source.node);
-                               }
-                               __nat25_db_network_insert(priv, skb->data+ETH_ALEN, networkAddr);
-                               __nat25_db_print(priv);
-                               return 0;
-                       case NAT25_LOOKUP:
-                               if (!memcmp(GET_MY_HWADDR(priv), ipx->ipx_dest.node, ETH_ALEN)) {
-                                       DEBUG_INFO("NAT25: Lookup IPX, Modify Destination IPX Node addr\n");
-
-                                       __nat25_generate_ipx_network_addr_with_socket(networkAddr, &ipx->ipx_dest.net, &ipx->ipx_dest.sock);
-
-                                       __nat25_db_network_lookup_and_replace(priv, skb, networkAddr);
-
-                                       /*  replace IPX destination node addr with Lookup destination MAC addr */
-                                       memcpy(ipx->ipx_dest.node, skb->data, ETH_ALEN);
-                               } else {
-                                       __nat25_generate_ipx_network_addr_with_node(networkAddr, &ipx->ipx_dest.net, ipx->ipx_dest.node);
-
-                                       __nat25_db_network_lookup_and_replace(priv, skb, networkAddr);
-                               }
-                               return 0;
-                       default:
-                               return -1;
-                       }
-               } else if (ea) {
-                       /* Sanity check fields. */
-                       if (ea->hw_len != ETH_ALEN || ea->pa_len != AARP_PA_ALEN) {
-                               DEBUG_WARN("NAT25: Appletalk AARP Sanity check fail!\n");
-                               return -1;
-                       }
-
-                       switch (method) {
-                       case NAT25_CHECK:
-                               return 0;
-                       case NAT25_INSERT:
-                               /*  change to AARP source mac address to wlan STA address */
-                               memcpy(ea->hw_src, GET_MY_HWADDR(priv), ETH_ALEN);
-
-                               DEBUG_INFO("NAT25: Insert AARP, Source =%d,%d Destination =%d,%d\n",
-                                       ea->pa_src_net,
-                                       ea->pa_src_node,
-                                       ea->pa_dst_net,
-                                       ea->pa_dst_node);
-
-                               __nat25_generate_apple_network_addr(networkAddr, &ea->pa_src_net, &ea->pa_src_node);
-
-                               __nat25_db_network_insert(priv, skb->data+ETH_ALEN, networkAddr);
-
-                               __nat25_db_print(priv);
-                               return 0;
-                       case NAT25_LOOKUP:
-                               DEBUG_INFO("NAT25: Lookup AARP, Source =%d,%d Destination =%d,%d\n",
-                                       ea->pa_src_net,
-                                       ea->pa_src_node,
-                                       ea->pa_dst_net,
-                                       ea->pa_dst_node);
-
-                               __nat25_generate_apple_network_addr(networkAddr, &ea->pa_dst_net, &ea->pa_dst_node);
-
-                               __nat25_db_network_lookup_and_replace(priv, skb, networkAddr);
-
-                               /*  change to AARP destination mac address to Lookup result */
-                               memcpy(ea->hw_dst, skb->data, ETH_ALEN);
-                               return 0;
-                       default:
-                               return -1;
-                       }
-               } else if (ddp) {
-                       switch (method) {
-                       case NAT25_CHECK:
-                               return -1;
-                       case NAT25_INSERT:
-                               DEBUG_INFO("NAT25: Insert DDP, Source =%d,%d Destination =%d,%d\n",
-                                       ddp->deh_snet,
-                                       ddp->deh_snode,
-                                       ddp->deh_dnet,
-                                       ddp->deh_dnode);
-
-                               __nat25_generate_apple_network_addr(networkAddr, &ddp->deh_snet, &ddp->deh_snode);
-
-                               __nat25_db_network_insert(priv, skb->data+ETH_ALEN, networkAddr);
-
-                               __nat25_db_print(priv);
-                               return 0;
-                       case NAT25_LOOKUP:
-                               DEBUG_INFO("NAT25: Lookup DDP, Source =%d,%d Destination =%d,%d\n",
-                                       ddp->deh_snet,
-                                       ddp->deh_snode,
-                                       ddp->deh_dnet,
-                                       ddp->deh_dnode);
-                               __nat25_generate_apple_network_addr(networkAddr, &ddp->deh_dnet, &ddp->deh_dnode);
-                               __nat25_db_network_lookup_and_replace(priv, skb, networkAddr);
-                               return 0;
-                       default:
-                               return -1;
-                       }
-               }
-
-               return -1;
        } else if ((protocol == ETH_P_PPP_DISC) ||
                   (protocol == ETH_P_PPP_SES)) {
                /*---------------------------------------------------*/
--
Quoted 2 lines

2.32.0

Regards,
Phil

Acked-by on v1 1/2
#3 lore raw
In reply to Greg Kroah-Hartman
Quoted 125 lines · Greg Kroah-Hartman

The compiler is free to ignore, or follow, "inline" markings so they really have no use in .c files, so just remove them.

This allows functions to properly show up as being unused when all callers to them are removed, otherwise gcc does not warn you about this.

---
 drivers/staging/r8188eu/core/rtw_br_ext.c | 24 +++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)
drivers/staging/r8188eu/core/rtw_br_ext.c +12 -13
index 22737cd0fe44..fb2bb36f9e2c 100644
@@ -49,7 +49,7 @@
 -----------------------------------------------------------------*/
 
 /* Find a tag in pppoe frame and return the pointer */
-static inline unsigned char *__nat25_find_pppoe_tag(struct pppoe_hdr *ph, unsigned short type)
+static unsigned char *__nat25_find_pppoe_tag(struct pppoe_hdr *ph, unsigned short type)
 {
        unsigned char *cur_ptr, *start_ptr;
        unsigned short tagLen, tagType;
@@ -66,7 +66,7 @@ static inline unsigned char *__nat25_find_pppoe_tag(struct pppoe_hdr *ph, unsign
        return NULL;
 }
 
-static inline int __nat25_add_pppoe_tag(struct sk_buff *skb, struct pppoe_tag *tag)
+static int __nat25_add_pppoe_tag(struct sk_buff *skb, struct pppoe_tag *tag)
 {
        struct pppoe_hdr *ph = (struct pppoe_hdr *)(skb->data + ETH_HLEN);
        int data_len;
@@ -106,7 +106,7 @@ static int skb_pull_and_merge(struct sk_buff *skb, unsigned char *src, int len)
        return 0;
 }
 
-static inline unsigned long __nat25_timeout(struct adapter *priv)
+static unsigned long __nat25_timeout(struct adapter *priv)
 {
        unsigned long timeout;
 
@@ -115,7 +115,7 @@ static inline unsigned long __nat25_timeout(struct adapter *priv)
        return timeout;
 }
 
-static inline int  __nat25_has_expired(struct adapter *priv,
+static int  __nat25_has_expired(struct adapter *priv,
                                struct nat25_network_db_entry *fdb)
 {
        if (time_before_eq(fdb->ageing_timer, __nat25_timeout(priv)))
@@ -124,7 +124,7 @@ static inline int  __nat25_has_expired(struct adapter *priv,
        return 0;
 }
 
-static inline void __nat25_generate_ipv4_network_addr(unsigned char *networkAddr,
+static void __nat25_generate_ipv4_network_addr(unsigned char *networkAddr,
                                unsigned int *ipAddr)
 {
        memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
@@ -133,7 +133,7 @@ static inline void __nat25_generate_ipv4_network_addr(unsigned char *networkAddr
        memcpy(networkAddr+7, (unsigned char *)ipAddr, 4);
 }
 
-static inline void __nat25_generate_ipx_network_addr_with_node(unsigned char *networkAddr,
+static void __nat25_generate_ipx_network_addr_with_node(unsigned char *networkAddr,
                                __be32 *ipxNetAddr, unsigned char *ipxNodeAddr)
 {
        memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
@@ -143,7 +143,7 @@ static inline void __nat25_generate_ipx_network_addr_with_node(unsigned char *ne
        memcpy(networkAddr+5, ipxNodeAddr, 6);
 }
 
-static inline void __nat25_generate_ipx_network_addr_with_socket(unsigned char *networkAddr,
+static void __nat25_generate_ipx_network_addr_with_socket(unsigned char *networkAddr,
                                __be32 *ipxNetAddr, __be16 *ipxSocketAddr)
 {
        memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
@@ -153,7 +153,7 @@ static inline void __nat25_generate_ipx_network_addr_with_socket(unsigned char *
        memcpy(networkAddr+5, ipxSocketAddr, 2);
 }
 
-static inline void __nat25_generate_apple_network_addr(unsigned char *networkAddr,
+static void __nat25_generate_apple_network_addr(unsigned char *networkAddr,
                                __be16 *network, unsigned char *node)
 {
        memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
@@ -163,7 +163,7 @@ static inline void __nat25_generate_apple_network_addr(unsigned char *networkAdd
        networkAddr[3] = *node;
 }
 
-static inline void __nat25_generate_pppoe_network_addr(unsigned char *networkAddr,
+static void __nat25_generate_pppoe_network_addr(unsigned char *networkAddr,
                                unsigned char *ac_mac, __be16 *sid)
 {
        memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
@@ -258,7 +258,7 @@ static int update_nd_link_layer_addr(unsigned char *data, int len, unsigned char
        return 0;
 }
 
-static inline int __nat25_network_hash(unsigned char *networkAddr)
+static int __nat25_network_hash(unsigned char *networkAddr)
 {
        if (networkAddr[0] == NAT25_IPV4) {
                unsigned long x;
@@ -305,7 +305,7 @@ static inline int __nat25_network_hash(unsigned char *networkAddr)
        }
 }
 
-static inline void __network_hash_link(struct adapter *priv,
+static void __network_hash_link(struct adapter *priv,
                                struct nat25_network_db_entry *ent, int hash)
 {
        /*  Caller must spin_lock already! */
@@ -316,7 +316,7 @@ static inline void __network_hash_link(struct adapter *priv,
        ent->pprev_hash = &priv->nethash[hash];
 }
 
-static inline void __network_hash_unlink(struct nat25_network_db_entry *ent)
+static void __network_hash_unlink(struct nat25_network_db_entry *ent)
 {
        /*  Caller must spin_lock already! */
        *ent->pprev_hash = ent->next_hash;
--
Quoted 2 lines

2.32.0

Regards,
Phil