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

From: Martin Homuth
Date: Tue Dec 19 2017 - 15:02:09 EST


On 12/19/2017 05:41 PM, Joe Perches wrote:
> 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.
>

Of course! For some reason I figured further changes within that
function would break the original reason for the change (as the other
changes wouldn't fix checkpatch errors) but it totally makes sense.
Sorry for the noise, v4 will contain the final fixes regarding this matter.