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

From: Joe Perches
Date: Mon Dec 18 2017 - 21:50:25 EST


On Tue, 2017-12-19 at 00:18 +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,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++] =
> - pattrib->signal_qual;
> + padapter->recvpriv.signal_qual_data.elements[sqd->index++] =
> + pattrib->signal_qual;

This should now become

sqd->elements[sqd->index++] = pattrib->signal_qual;