Re: [PATCH 2/5] staging: rtl8712: style fix multiple line dereferences
From: Joe Perches
Date: Mon Dec 18 2017 - 16:39:09 EST
On Mon, 2017-12-18 at 21:36 +0100, Martin Homuth wrote:
> This patch fixes various coding style issues in the rtl8712 module as
> noted by checkpatch.pl related to dereferencing over multiple lines.
>
> It fixes the following checkpatch.pl warning:
>
> WARNING: Avoid multiple line dereference - prefer %s
>
> Signed-off-by: Martin Homuth <martin@xxxxxxxxxxxxxxx>
> ---
> drivers/staging/rtl8712/rtl8712_recv.c | 8 ++--
> drivers/staging/rtl8712/rtl871x_cmd.c | 36 ++++++++---------
> drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 58
> ++++++++++++++-------------
> drivers/staging/rtl8712/rtl871x_mlme.c | 6 +--
> drivers/staging/rtl8712/rtl871x_security.c | 25 ++++++------
> 5 files changed, 69 insertions(+), 64 deletions(-)
>
> diff --git a/drivers/staging/rtl8712/rtl8712_recv.c
> b/drivers/staging/rtl8712/rtl8712_recv.c
> index 8f555e6e1b3f..8395b90d60b6 100644
> --- a/drivers/staging/rtl8712/rtl8712_recv.c
> +++ b/drivers/staging/rtl8712/rtl8712_recv.c
> @@ -918,8 +918,8 @@ static void process_link_qual(struct _adapter *padapter,
> }
> padapter->recvpriv.signal_qual_data.total_val +=
> pattrib->signal_qual;
> - padapter->recvpriv.signal_qual_data.elements[padapter->
> - recvpriv.signal_qual_data.index++] =
probably better to use a temporary pointer for
padapter->recvpriv.signal_qual_data
and replace the occurrences with the temporary.
s/padapter->recvpriv.signal_qual_data./sqd->/
> + padapter->recvpriv.signal_qual_data.elements
> + [padapter->recvpriv.signal_qual_data.index++] =
> pattrib->signal_qual;
> if (padapter->recvpriv.signal_qual_data.index >=
> PHY_LINKQUALITY_SLID_WIN_MAX)
> @@ -947,8 +947,8 @@ static void process_rssi(struct _adapter *padapter,
> union recv_frame *prframe)
> }
> padapter->recvpriv.signal_strength_data.total_val +=
> pattrib->signal_strength;
> - padapter->recvpriv.signal_strength_data.elements[padapter->recvpriv.
> - signal_strength_data.index++] =
> + padapter->recvpriv.signal_strength_data.elements
> + [padapter->recvpriv.signal_strength_data.index++] =
> pattrib->signal_strength;
> if (padapter->recvpriv.signal_strength_data.index >=
> PHY_RSSI_SLID_WIN_MAX)
and here use ssd
etc.