lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 18 Feb 2019 22:48:57 +0800
From:   YueHaibing <yuehaibing@...wei.com>
To:     Dan Carpenter <dan.carpenter@...cle.com>
CC:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Himadri Pandya <himadri18.07@...il.com>,
        "David S. Miller" <davem@...emloft.net>,
        "Colin Ian King" <colin.king@...onical.com>,
        <devel@...verdev.osuosl.org>, <kernel-janitors@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH -next] staging: rtl8192e: Remove set but not used
 variables 'broad_addr, stype'

On 2019/2/18 22:31, Dan Carpenter wrote:
> On Mon, Feb 18, 2019 at 12:33:59PM +0000, YueHaibing wrote:
>> @@ -1747,11 +1747,10 @@ static short _rtl92e_tx(struct net_device *dev, struct sk_buff *skb)
>>  	header = (struct rtllib_hdr_1addr *)(((u8 *)skb->data) + fwinfo_size);
>>  	fc = le16_to_cpu(header->frame_ctl);
>>  	type = WLAN_FC_GET_TYPE(fc);
>> -	stype = WLAN_FC_GET_STYPE(fc);
>>  	pda_addr = header->addr1;
>>  
>>  	if (is_broadcast_ether_addr(pda_addr))
>> -		broad_addr = true;
>> +		;
>>  	else if (is_multicast_ether_addr(pda_addr))
>>  		multi_addr = true;
>>  	else
>>
> 
> This is ugly.  Please do it like this:

Thank you for correct me.

> 
> 
> diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
> index c145b689175c..29b53e2246b4 100644
> --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
> +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
> @@ -1729,7 +1729,6 @@ static short _rtl92e_tx(struct net_device *dev, struct sk_buff *skb)
>  	struct tx_desc *pdesc = NULL;
>  	struct rtllib_hdr_1addr *header = NULL;
>  	u16 fc = 0, type = 0, stype = 0;
> -	bool  multi_addr = false, broad_addr = false, uni_addr = false;
>  	u8 *pda_addr = NULL;
>  	int   idx;
>  	u32 fwinfo_size = 0;
> @@ -1751,18 +1750,11 @@ static short _rtl92e_tx(struct net_device *dev, struct sk_buff *skb)
>  	pda_addr = header->addr1;
>  
>  	if (is_broadcast_ether_addr(pda_addr))
> -		broad_addr = true;
> +		priv->stats.txbytesbroadcast += skb->len - fwinfo_size;
>  	else if (is_multicast_ether_addr(pda_addr))
> -		multi_addr = true;
> -	else
> -		uni_addr = true;
> -
> -	if (uni_addr)
> -		priv->stats.txbytesunicast += skb->len - fwinfo_size;
> -	else if (multi_addr)
>  		priv->stats.txbytesmulticast += skb->len - fwinfo_size;
>  	else
> -		priv->stats.txbytesbroadcast += skb->len - fwinfo_size;
> +		priv->stats.txbytesunicast += skb->len - fwinfo_size;
>  
>  	spin_lock_irqsave(&priv->irq_th_lock, flags);
>  	ring = &priv->tx_ring[tcb_desc->queue_index];
> 
> .
> 

Powered by blists - more mailing lists