[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YG1F0UoHuuGXctim@kroah.com>
Date: Wed, 7 Apr 2021 07:40:33 +0200
From: Greg KH <gregkh@...uxfoundation.org>
To: Sergei Krainov <sergei.krainov.lkd@...il.com>
Cc: Larry.Finger@...inger.net, florian.c.schilhabel@...glemail.com,
linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] staging: rtl8712: avoid multiple line dereference
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
Powered by blists - more mailing lists