mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Martin Homuth <martin@martinhomuth.de>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/5] staging: rtl8712: style fix multiple line dereferences
Date: Mon, 18 Dec 2017 13:38:59 -0800	[thread overview]
Message-ID: <1513633139.1234.8.camel@perches.com> (raw)
In-Reply-To: <cf7900c8-c528-a342-0260-73d2ab1735f1@martinhomuth.de>

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@martinhomuth.de>
> ---
>  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.

      reply	other threads:[~2017-12-18 21:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3cce97a4-1aeb-b663-5143-d36b3a7272fa@martinhomuth.de>
2017-12-18 20:36 ` Martin Homuth
2017-12-18 21:38   ` Joe Perches [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1513633139.1234.8.camel@perches.com \
    --to=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin@martinhomuth.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome