linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 3/3] staging: r8188eu: Remove no more used variable and function
@ 2021-08-16 18:05 Fabio M. De Francesco
  2021-08-16 19:52 ` Michael Straube
  0 siblings, 1 reply; 2+ messages in thread
From: Fabio M. De Francesco @ 2021-08-16 18:05 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Larry Finger, Phillip Potter, Martin Kaiser,
	Michael Straube, linux-staging, linux-kernel
  Cc: Fabio M. De Francesco

Remove the 'sender' pointer to integer. Remove
__nat25_db_network_lookup_and_replace(). Following the deletion of the
code related to the NAT25_LOOKUP method, they are no more needed.

Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
---

v2: Rebased against latest version of Greg K-H's tree.

 drivers/staging/r8188eu/core/rtw_br_ext.c | 52 +----------------------
 1 file changed, 1 insertion(+), 51 deletions(-)

diff --git a/drivers/staging/r8188eu/core/rtw_br_ext.c b/drivers/staging/r8188eu/core/rtw_br_ext.c
index 0402f48319c4..ee52f28a1e56 100644
--- a/drivers/staging/r8188eu/core/rtw_br_ext.c
+++ b/drivers/staging/r8188eu/core/rtw_br_ext.c
@@ -295,56 +295,6 @@ static void __network_hash_unlink(struct nat25_network_db_entry *ent)
 	ent->pprev_hash = NULL;
 }
 
-static int __nat25_db_network_lookup_and_replace(struct adapter *priv,
-				struct sk_buff *skb, unsigned char *networkAddr)
-{
-	struct nat25_network_db_entry *db;
-
-	spin_lock_bh(&priv->br_ext_lock);
-
-	db = priv->nethash[__nat25_network_hash(networkAddr)];
-	while (db) {
-		if (!memcmp(db->networkAddr, networkAddr, MAX_NETWORK_ADDR_LEN)) {
-			if (!__nat25_has_expired(priv, db)) {
-				/*  replace the destination mac address */
-				memcpy(skb->data, db->macAddr, ETH_ALEN);
-				atomic_inc(&db->use_count);
-
-				DEBUG_INFO("NAT25: Lookup M:%02x%02x%02x%02x%02x%02x N:%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x"
-							"%02x%02x%02x%02x%02x%02x\n",
-					db->macAddr[0],
-					db->macAddr[1],
-					db->macAddr[2],
-					db->macAddr[3],
-					db->macAddr[4],
-					db->macAddr[5],
-					db->networkAddr[0],
-					db->networkAddr[1],
-					db->networkAddr[2],
-					db->networkAddr[3],
-					db->networkAddr[4],
-					db->networkAddr[5],
-					db->networkAddr[6],
-					db->networkAddr[7],
-					db->networkAddr[8],
-					db->networkAddr[9],
-					db->networkAddr[10],
-					db->networkAddr[11],
-					db->networkAddr[12],
-					db->networkAddr[13],
-					db->networkAddr[14],
-					db->networkAddr[15],
-					db->networkAddr[16]);
-			}
-			spin_unlock_bh(&priv->br_ext_lock);
-			return 1;
-		}
-		db = db->next_hash;
-	}
-	spin_unlock_bh(&priv->br_ext_lock);
-	return 0;
-}
-
 static void __nat25_db_network_insert(struct adapter *priv,
 				unsigned char *macAddr, unsigned char *networkAddr)
 {
@@ -493,7 +443,7 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
 		/*---------------------------------------------------*/
 		struct arphdr *arp = (struct arphdr *)(skb->data + ETH_HLEN);
 		unsigned char *arp_ptr = (unsigned char *)(arp + 1);
-		unsigned int *sender, *target;
+		unsigned int *sender;
 
 		if (arp->ar_pro != __constant_htons(ETH_P_IP)) {
 			DEBUG_WARN("NAT25: arp protocol unknown (%4x)!\n", be16_to_cpu(arp->ar_pro));
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2 3/3] staging: r8188eu: Remove no more used variable and function
  2021-08-16 18:05 [PATCH v2 3/3] staging: r8188eu: Remove no more used variable and function Fabio M. De Francesco
@ 2021-08-16 19:52 ` Michael Straube
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Straube @ 2021-08-16 19:52 UTC (permalink / raw)
  To: Fabio M. De Francesco, Greg Kroah-Hartman, Larry Finger,
	Phillip Potter, Martin Kaiser, linux-staging, linux-kernel

On 8/16/21 8:05 PM, Fabio M. De Francesco wrote:
> Remove the 'sender' pointer to integer. Remove
> __nat25_db_network_lookup_and_replace(). Following the deletion of the
> code related to the NAT25_LOOKUP method, they are no more needed.
> 
> Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
> ---
> 
> v2: Rebased against latest version of Greg K-H's tree.
> 
>   drivers/staging/r8188eu/core/rtw_br_ext.c | 52 +----------------------
>   1 file changed, 1 insertion(+), 51 deletions(-)
> 
> diff --git a/drivers/staging/r8188eu/core/rtw_br_ext.c b/drivers/staging/r8188eu/core/rtw_br_ext.c
> index 0402f48319c4..ee52f28a1e56 100644
> --- a/drivers/staging/r8188eu/core/rtw_br_ext.c
> +++ b/drivers/staging/r8188eu/core/rtw_br_ext.c
> @@ -295,56 +295,6 @@ static void __network_hash_unlink(struct nat25_network_db_entry *ent)
>   	ent->pprev_hash = NULL;
>   }
>   
> -static int __nat25_db_network_lookup_and_replace(struct adapter *priv,
> -				struct sk_buff *skb, unsigned char *networkAddr)
> -{
> -	struct nat25_network_db_entry *db;
> -
> -	spin_lock_bh(&priv->br_ext_lock);
> -
> -	db = priv->nethash[__nat25_network_hash(networkAddr)];
> -	while (db) {
> -		if (!memcmp(db->networkAddr, networkAddr, MAX_NETWORK_ADDR_LEN)) {
> -			if (!__nat25_has_expired(priv, db)) {
> -				/*  replace the destination mac address */
> -				memcpy(skb->data, db->macAddr, ETH_ALEN);
> -				atomic_inc(&db->use_count);
> -
> -				DEBUG_INFO("NAT25: Lookup M:%02x%02x%02x%02x%02x%02x N:%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x"
> -							"%02x%02x%02x%02x%02x%02x\n",
> -					db->macAddr[0],
> -					db->macAddr[1],
> -					db->macAddr[2],
> -					db->macAddr[3],
> -					db->macAddr[4],
> -					db->macAddr[5],
> -					db->networkAddr[0],
> -					db->networkAddr[1],
> -					db->networkAddr[2],
> -					db->networkAddr[3],
> -					db->networkAddr[4],
> -					db->networkAddr[5],
> -					db->networkAddr[6],
> -					db->networkAddr[7],
> -					db->networkAddr[8],
> -					db->networkAddr[9],
> -					db->networkAddr[10],
> -					db->networkAddr[11],
> -					db->networkAddr[12],
> -					db->networkAddr[13],
> -					db->networkAddr[14],
> -					db->networkAddr[15],
> -					db->networkAddr[16]);
> -			}
> -			spin_unlock_bh(&priv->br_ext_lock);
> -			return 1;
> -		}
> -		db = db->next_hash;
> -	}
> -	spin_unlock_bh(&priv->br_ext_lock);
> -	return 0;
> -}
> -
>   static void __nat25_db_network_insert(struct adapter *priv,
>   				unsigned char *macAddr, unsigned char *networkAddr)
>   {
> @@ -493,7 +443,7 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
>   		/*---------------------------------------------------*/
>   		struct arphdr *arp = (struct arphdr *)(skb->data + ETH_HLEN);
>   		unsigned char *arp_ptr = (unsigned char *)(arp + 1);
> -		unsigned int *sender, *target;
> +		unsigned int *sender;
>   
>   		if (arp->ar_pro != __constant_htons(ETH_P_IP)) {
>   			DEBUG_WARN("NAT25: arp protocol unknown (%4x)!\n", be16_to_cpu(arp->ar_pro));
> 

Acked-by: Michael Straube <straube.linux@gmail.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-16 19:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-16 18:05 [PATCH v2 3/3] staging: r8188eu: Remove no more used variable and function Fabio M. De Francesco
2021-08-16 19:52 ` Michael Straube

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).