linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Vihas Makwana <makvihas@gmail.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>,
	Phillip Potter <phil@philpotter.co.uk>,
	Michael Straube <straube.linux@gmail.com>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	Pavel Skripkin <paskripkin@gmail.com>,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] staging: r8188eu: simplify rtw_inc_and_chk_continual_urb_error
Date: Tue, 5 Apr 2022 16:14:17 +0200	[thread overview]
Message-ID: <YkxOueWoitw83chA@kroah.com> (raw)
In-Reply-To: <20220405124239.3372-4-makvihas@gmail.com>

On Tue, Apr 05, 2022 at 06:12:40PM +0530, Vihas Makwana wrote:
> The if check and variable "value" is redundant. Drop it and simplify
> the funciton.
> 
> Signed-off-by: Vihas Makwana <makvihas@gmail.com>
> ---
>  drivers/staging/r8188eu/include/usb_ops.h | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/drivers/staging/r8188eu/include/usb_ops.h b/drivers/staging/r8188eu/include/usb_ops.h
> index ddc46cb44..c5982704c 100644
> --- a/drivers/staging/r8188eu/include/usb_ops.h
> +++ b/drivers/staging/r8188eu/include/usb_ops.h
> @@ -27,12 +27,7 @@
>   */
>  static inline bool rtw_inc_and_chk_continual_urb_error(struct dvobj_priv *dvobj)
>  {
> -	int value = atomic_inc_return(&dvobj->continual_urb_error);
> -
> -	if (value > MAX_CONTINUAL_URB_ERR)
> -		return true;
> -
> -	return false;
> +	return atomic_inc_return(&dvobj->continual_urb_error) > MAX_CONTINUAL_URB_ERR;
>  }

Let's leave this as-is because it's a mess and should be fixed up
anyway.  No need to count urb errors as atomic values, this is crazy.

thanks,

greg k-h

      reply	other threads:[~2022-04-05 21:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-05 12:42 [PATCH 0/3] staging: r8188eu: some refactoring and cleanup Vihas Makwana
2022-04-05 12:42 ` [PATCH 1/3] staging: r8188eu: drop redundant if check in IS_MCAST Vihas Makwana
2022-04-05 12:42 ` [PATCH 2/3] staging: r8188eu: drop redundant if check in check_fwstate Vihas Makwana
2022-04-05 14:13   ` Greg Kroah-Hartman
2022-04-05 12:42 ` [PATCH 3/3] staging: r8188eu: simplify rtw_inc_and_chk_continual_urb_error Vihas Makwana
2022-04-05 14:14   ` Greg Kroah-Hartman [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=YkxOueWoitw83chA@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=Larry.Finger@lwfinger.net \
    --cc=dan.carpenter@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=makvihas@gmail.com \
    --cc=paskripkin@gmail.com \
    --cc=phil@philpotter.co.uk \
    --cc=straube.linux@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;
as well as URLs for NNTP newsgroup(s).