Re: [PATCH] staging: rtl8712: avoid multiple line dereference

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 07, 2021 at 01:15:17AM +0200, Sergei Krainov wrote:
> fix post-commit hook checkpatch issues:
> 
> WARNING: Avoid multiple line dereference - prefer 'adapter->mlmepriv.cur_network.network.InfrastructureMode'
> +			adapter->mlmepriv.cur_network.network.
> +			InfrastructureMode)
> 
> WARNING: Avoid multiple line dereference - prefer 'adapter->registrypriv.dev_network.MacAddress'
> +						 adapter->registrypriv.
> +							dev_network.MacAddress;
> 
> WARNING: Avoid multiple line dereference - prefer 'pnetwork->network.Configuration.FHConfig.DwellTime'
> +		 le32_to_cpu(pnetwork->network.Configuration.FHConfig.
> +			     DwellTime);
> 
> WARNING: Avoid multiple line dereference - prefer 'pnetwork->network.Configuration.FHConfig.HopPattern'
> +		 le32_to_cpu(pnetwork->network.Configuration.
> +			     FHConfig.HopPattern);
> 
> WARNING: Avoid multiple line dereference - prefer 'pmlmepriv->scanned_queue'
> +					    r8712_find_network(&pmlmepriv->
> +					    scanned_queue,
> 
> WARNING: Avoid multiple line dereference - prefer 'pmlmepriv->scanned_queue'
> +					     r8712_find_network(&pmlmepriv->
> +					     scanned_queue,
> 
> WARNING: Avoid multiple line dereference - prefer 'pstapriv->sta_hash_lock'
> +					spin_lock_irqsave(&pstapriv->
> +						sta_hash_lock, irqL2);
> 
> WARNING: Avoid multiple line dereference - prefer 'pstapriv->sta_hash_lock'
> +					spin_unlock_irqrestore(&(pstapriv->
> +						sta_hash_lock), irqL2);
> 
> WARNING: Avoid multiple line dereference - prefer 'pmlmepriv->scanned_queue'
> +						 r8712_find_network(&pmlmepriv->
> +						 scanned_queue,
> 
> WARNING: Avoid multiple line dereference - prefer 'pnetwork->network.MacAddress'
> +						 pnetwork->network.
> +						 MacAddress);
> 
> WARNING: Avoid multiple line dereference - prefer 'pmlmepriv->scanned_queue'
> +				ptarget_wlan = r8712_find_network(&pmlmepriv->
> +						scanned_queue,
> 
> WARNING: Avoid multiple line dereference - prefer 'adapter->securitypriv.AuthAlgrthm'
> +					if (adapter->securitypriv.
> +					    AuthAlgrthm == 2) {
> 
> WARNING: Avoid multiple line dereference - prefer 'adapter->securitypriv.binstallGrpkey'
> +						adapter->securitypriv.
> +							binstallGrpkey =
> 
> WARNING: Avoid multiple line dereference - prefer 'adapter->securitypriv.busetkipkey'
> +						adapter->securitypriv.
> +							busetkipkey =
> 
> WARNING: Avoid multiple line dereference - prefer 'adapter->securitypriv.bgrpkey_handshake'
> +						adapter->securitypriv.
> +							bgrpkey_handshake =
> 
> WARNING: Avoid multiple line dereference - prefer 'adapter->securitypriv.PrivacyAlgrthm'
> +							 adapter->securitypriv.
> +							 PrivacyAlgrthm;
> 
> WARNING: Avoid multiple line dereference - prefer 'ptarget_sta->x_UncstKey'
> +						memset((u8 *)&ptarget_sta->
> +							 x_UncstKey,
> 
> WARNING: Avoid multiple line dereference - prefer 'ptarget_sta->tkiprxmickey'
> +						memset((u8 *)&ptarget_sta->
> +							 tkiprxmickey,
> 
> WARNING: Avoid multiple line dereference - prefer 'ptarget_sta->tkiptxmickey'
> +						memset((u8 *)&ptarget_sta->
> +							 tkiptxmickey,
> 
> WARNING: Avoid multiple line dereference - prefer 'ptarget_sta->txpn'
> +						memset((u8 *)&ptarget_sta->
> +							 txpn, 0,
> 
> WARNING: Avoid multiple line dereference - prefer 'ptarget_sta->rxpn'
> +						memset((u8 *)&ptarget_sta->
> +							 rxpn, 0,
> 
> WARNING: Avoid multiple line dereference - prefer 'tgt_network->network'
> +				r8712_get_wlan_bssid_ex_sz(&tgt_network->
> +							network));
> 
> WARNING: Avoid multiple line dereference - prefer 'pmlmepriv->cur_network.network'
> +					if (is_same_network(&pmlmepriv->
> +					    cur_network.network,
> 

That's a lot of information we don't need in a changelog text, please
summarize when possible :)

>  					ptarget_wlan =
> -						 r8712_find_network(&pmlmepriv->
> -						 scanned_queue,
> -						 pnetwork->network.
> -						 MacAddress);
> +						 r8712_find_network(&pmlmepriv->scanned_queue,
> +						 pnetwork->network.MacAddress);

As bad as the original line here is, this isn't all that much better at
all, right?  How about working to fix the huge indentation levels in
this function instead, which will resolve all of this mess properly?
That would be a much better way to solve this.

thanks,

greg k-h




[Index of Archives]     [Linux Driver Development]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux