Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp958267pxb; Wed, 6 Apr 2022 05:19:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxy7WdfMpP/SXPaYBHOsNe4HkpERputaNRF0qbUjm7YYO0ahvpaWQEUkHgnWBBzhigdNO8 X-Received: by 2002:a63:8c5a:0:b0:387:6367:c08a with SMTP id q26-20020a638c5a000000b003876367c08amr6897864pgn.155.1649247545506; Wed, 06 Apr 2022 05:19:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649247545; cv=none; d=google.com; s=arc-20160816; b=D4rFQDafdeMVqgyvmyXgG+QtDMlKJXj9RO2A0ADkXPHgBa+K4/MTmiCe3FDQlFF3fh sZVk0gfp0kSmzsGhag8twHXEfDpaVtwgWiYESjeJZXVFhdSH0YxUmLSXg7vwlh0ReEdU oJX7zmcJFSJfUyP/c8TOqkOsTHgpT/w5WXVcfHa9WkY1nZIZ74T7JMmesLiwcFW5beVo ze5LztEBsPY0wylUf+6sypUrnZ4Qp2Prjfq4CTc6WeiOTKtuyA3FnabHuKCPc1DgcsPU iQmlb6K1nlY0oGiJr9UUJ5OZZWL4ggay2H6a5j184etJhTpzpy5solkt9rQXx2CP0fgm 7/PA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=6n5ir8g0ZdgzwHNJCSaJBt/bdae2XLGPPaGK6+u+j4A=; b=MX9t0EqHwqRp/W8veP/9MrIouInxPj90jJwf26zivCnRTd6zfyglG8CHhRfA1akbcV bkO2L0kXthYJYw99abwshF2Y3Yu9vOBxVjXEN5hOOsxdCTgQ2rJB+Hmu5UN7dyWwVQBt fBdUA8z+x0TZ3jbiN+om8lFZKeRDwUlu/cOPSKY7xfnyOn28aPVxJfaCCuLavoW/i26z fLLP35QIgyD8M1fDu23ZjjsbBV9T9BF3TX+uDt97SBuDMdxY2sELs2Y5gFJY1T7gnLl8 ylJT94c6ic9Aq4EXRxNPdvhtoJ7+iHc40jnWdQArrRP0Hjo/xxx+1zEhgY/NBZ57GDio iXAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nWdxN7Yr; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id h5-20020a170902f54500b00156c0b0a42asi6257132plf.113.2022.04.06.05.19.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 05:19:05 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nWdxN7Yr; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5149852C3CB; Wed, 6 Apr 2022 04:04:10 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1387160AbiDEVu6 (ORCPT + 99 others); Tue, 5 Apr 2022 17:50:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1446335AbiDEPo3 (ORCPT ); Tue, 5 Apr 2022 11:44:29 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B584F1E8B for ; Tue, 5 Apr 2022 07:14:20 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1712D60AF7 for ; Tue, 5 Apr 2022 14:14:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 212A4C385A0; Tue, 5 Apr 2022 14:14:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649168059; bh=iZiKzlaCdiL7IWBslwNKbqVzttLxVImUfOeQx9NnVUM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nWdxN7YrHrzMCDGsHyy5S7maXW02cB88esApZehmKD+BXdSwk65Vf4qZgFfIQ4P2W GQ4f+kRiSv7gW3qCDgVBPXZX5ucvJfKwAEo1y1TavKiF7jqM0h6LEzIu2aI4HJGFaK wHjRjFBgVEHdorkBq7gpQXQFgQGOWabfpzM/3aRU= Date: Tue, 5 Apr 2022 16:14:17 +0200 From: Greg Kroah-Hartman To: Vihas Makwana Cc: Larry Finger , Phillip Potter , Michael Straube , Dan Carpenter , Pavel Skripkin , 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 Message-ID: References: <20220405124239.3372-1-makvihas@gmail.com> <20220405124239.3372-4-makvihas@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220405124239.3372-4-makvihas@gmail.com> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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