Re: [PATCH v3 2/5] staging: rtl8712: style fix multiple line dereferences

From: Joe Perches
Date: Tue Dec 19 2017 - 11:42:09 EST


On Tue, 2017-12-19 at 17:32 +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.
[]
> diff --git a/drivers/staging/rtl8712/rtl8712_recv.c b/drivers/staging/rtl8712/rtl8712_recv.c
[]
> @@ -899,6 +899,7 @@ static void process_link_qual(struct _adapter *padapter,
> {
> u32 last_evm = 0, tmpVal;
> struct rx_pkt_attrib *pattrib;
> + struct smooth_rssi_data *sqd = &padapter->recvpriv.signal_qual_data;
>
> if (prframe == NULL || padapter == NULL)
> return;
> @@ -918,9 +919,7 @@ static void process_link_qual(struct _adapter *padapter,
> }
> padapter->recvpriv.signal_qual_data.total_val +=
> pattrib->signal_qual;

You missed more than one substitution.

sqd->total_val += pattrib->signal_qual;

> - padapter->recvpriv.signal_qual_data.elements[padapter->
> - recvpriv.signal_qual_data.index++] =
> - pattrib->signal_qual;
> + sqd->elements[sqd->index++] = pattrib->signal_qual;
> if (padapter->recvpriv.signal_qual_data.index >=
> PHY_LINKQUALITY_SLID_WIN_MAX)
> padapter->recvpriv.signal_qual_data.index = 0;

And here too

sqd->index = 0;

Dunno if there are more, but if you are
modifying the function, you should do the
appropriate function local sed.