public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Felix Schlepper <f3sch.git@outlook.com>
Cc: gregkh@linuxfoundation.org, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org, wjsota@gmail.com
Subject: Re: [PATCH 3/7] Staging: rtl8192e: Avoid multiple assignments
Date: Wed, 29 Jun 2022 19:13:06 +0300	[thread overview]
Message-ID: <20220629071241.GW16517@kadam> (raw)
In-Reply-To: <046bce9ab52db0c5a37430fbb138870c05a48f61.1656402464.git.f3sch.git@outlook.com>

On Tue, Jun 28, 2022 at 10:30:52AM +0200, Felix Schlepper wrote:
> This addresses an issue raised by checkpatch.pl:
> 
>      $ ./scripts/checkpatch.pl --terse -f drivers/staging/rtl8192e/rtllib_wx.c
>      CHECK: multiple assignments should be avoided
> 
> This patch does not change the logical of the assignments.
> 
> Signed-off-by: Felix Schlepper <f3sch.git@outlook.com>
> ---
>  drivers/staging/rtl8192e/rtllib_wx.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/rtl8192e/rtllib_wx.c b/drivers/staging/rtl8192e/rtllib_wx.c
> index 7bd1e829ff7e..c8fc66113b41 100644
> --- a/drivers/staging/rtl8192e/rtllib_wx.c
> +++ b/drivers/staging/rtl8192e/rtllib_wx.c
> @@ -160,7 +160,8 @@ static inline char *rtl819x_translate_scan(struct rtllib_device *ieee,
>  			max_rate = rate;
>  	}
>  	iwe.cmd = SIOCGIWRATE;
> -	iwe.u.bitrate.fixed = iwe.u.bitrate.disabled = 0;
> +	iwe.u.bitrate.disabled = 0;
> +	iwe.u.bitrate.fixed = iwe.u.bitrate.disabled;
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This assignment makes no sense.  Why are we setting fixed = disabled?
If you're going to split it apart do:

	iwe.u.bitrate.disabled = 0;
	iwe.u.bitrate.fixed = 0;

regards,
dan carpenter

  reply	other threads:[~2022-06-29 16:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-28  8:30 [PATCH 0/7] Staging: rtl8192e: rtllib_wx.c coding style Felix Schlepper
2022-06-28  8:30 ` [PATCH 1/7] Staging: rtl8192e: Added blank lines before/after struct Felix Schlepper
2022-06-28 17:58   ` Joe Perches
2022-06-29 12:11     ` Felix Schlepper
2022-06-29 18:09       ` Joe Perches
2022-06-28  8:30 ` [PATCH 2/7] Staging: rtl8192e: Added spaces around binary operators Felix Schlepper
2022-06-28  8:30 ` [PATCH 3/7] Staging: rtl8192e: Avoid multiple assignments Felix Schlepper
2022-06-29 16:13   ` Dan Carpenter [this message]
2022-06-28  8:30 ` [PATCH 4/7] Staging: rtl8192e: Remove unnecessary parentheses Felix Schlepper
2022-06-28  8:30 ` [PATCH 5/7] Staging: rtl8192e: Added braces around else Felix Schlepper
2022-06-28  8:30 ` [PATCH 6/7] Staging: rtl8192e: Remove unnecessary blank line Felix Schlepper
2022-06-28  8:30 ` [PATCH 7/7] Staging: rtl8192e: Added spaces around '+' Felix Schlepper

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=20220629071241.GW16517@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=f3sch.git@outlook.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=wjsota@gmail.com \
    /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