From patchwork Sat Feb 4 10:16:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Straube X-Patchwork-Id: 52758 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1290326wrn; Sat, 4 Feb 2023 02:17:51 -0800 (PST) X-Google-Smtp-Source: AK7set+WG0dJJoUUFG+ZzeHTNKwGsd/rl012InTW4nX03zcFmdsTFFOHTgZbbzKNIamQKwdhHDNY X-Received: by 2002:a17:903:1cc:b0:192:5282:6833 with SMTP id e12-20020a17090301cc00b0019252826833mr16463607plh.29.1675505871371; Sat, 04 Feb 2023 02:17:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675505871; cv=none; d=google.com; s=arc-20160816; b=h8vxBg3kvu2OFbJ6tJJRHJzXfxJPy1EepTNf7dHK1qtlfGubjV7MedSjC0u0bomBos bygLj81dIV5+VkP31nfUbAtEvNz/0vyrHTswvUB23oKgMpW/ekbvVkdxvZo/ycW3i20T EqbWHvmhslzbIc6UioDLP3g/ZiRqmyvcFLmq22m0eNBrFzWGxZjTxu2Bo3jCfnmq+cwV VpsPZ2ZYWHCyahBOn9LRK1s2ejLLlQ2bmW4SOtxzoTyTCfFdV3/sxrob61jhyhFLxTnD avpyjthrl+OfxJ5GRMfTRMMore3lIVDtj4kfVsS/ubea48+jGPr6wwqbCCC4SQcmvDJ/ PMBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=7RXm6Lsoznyg1+l0w/MAUy9nfuZ+z0HNP/nxhYlCK60=; b=A/gDEyvdT092SoyYNFcqp6egiHPaA8/i7I5zRZpmdBu+WqjwV0TwrdyyNCKVL2cpve PIoJqjMcgQ+MJDJsrouEqHJ87BLTECcuPKOa247c8XeiVerbTdJqaU5DQ0f/Xa6rvQCd 2Erx1NYN2NagVClRIrUQdnmDQY5ZW4fwCO9H5VtOeUoXYNfSKKR+8/KrBLhoQ8VaIXfN 8193ahuTXatAfoSfo08oA5KLyTh+1eFVEzhYs7aSoLX6L7uKbQZtMlH0FuvhDBIINSO9 wkmm8jmFgEWwTIaCzEaBNNWBuiZVZMLYytztmZIZXJFjRifnzpd7LFL5//90rO+lBO+n 1GzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=jDQR2YXB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f4-20020a17090274c400b00192721d6a97si5105577plt.499.2023.02.04.02.17.38; Sat, 04 Feb 2023 02:17:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=jDQR2YXB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232478AbjBDKRH (ORCPT + 99 others); Sat, 4 Feb 2023 05:17:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232098AbjBDKRD (ORCPT ); Sat, 4 Feb 2023 05:17:03 -0500 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B33D28234 for ; Sat, 4 Feb 2023 02:17:02 -0800 (PST) Received: by mail-ej1-x632.google.com with SMTP id ud5so21749865ejc.4 for ; Sat, 04 Feb 2023 02:17:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7RXm6Lsoznyg1+l0w/MAUy9nfuZ+z0HNP/nxhYlCK60=; b=jDQR2YXBY0vow0iYqDSlsL/5aCNCEeXev2H38cUYTDwmI7nDy+HUF69bToCKQgrmlb 5T74kOp5VvKhzuTapNB6oj6uC00CFOlYcw8R5pzeY/9wi/PoOo3yjrjzYp3CORNTxzhS pomlTYRsMYj5cZJZwGJEukf4uf8IJ/7dohuANCAqrilAVXWYA5twsbLM9rERkezq3oIU GeJvoh3cneNmBQ+xTqR7i0g2F1+j7G0+exwBGyKHJFg2lRZHIbU9RtelYaTuIF7zwSNW +hs0ox6l7D4JgzQa3B9D3+qITF0p+tRkgrMO2pdqHqN+h1ONkwE5TaNoBl9YZyhsle1U PnKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7RXm6Lsoznyg1+l0w/MAUy9nfuZ+z0HNP/nxhYlCK60=; b=0sGPkVb4tJ23fXdZgvPTSqnri/G+BO8EeNDIqud91JTemQda5Vw7r2M9rKmwDa4DCp eI0KgLltq+2fZR5sauxHhgOQwMx1oNMl6UuoTLDxRxzeqWR0vz0bn4jKd6/19xSDMAG9 ms0YrOMJGTyfj9Zq+DUbjHiWLsQDqzmuGKDK6RK+3gxKfxUNEXnv8WzSi84UzXA05Vdg Samk0oIKQK5LI0MK78azfas4X/pdwlXAf8BDtXFw3vyHjinDWJmKuo3naaVFEjBZ4FeU iXTY4fDmDMqQoe6yBdQEdSIqV6b7yYZRyyKgsQ5CA+quv9l02+x7NxWumKbnLyb6iMqB M/VQ== X-Gm-Message-State: AO0yUKVXtFFhb/BRGkZy9ektd6vo2tXHeqB/WlajFsBMJwp2pOEL5+I6 XX/D5cwRpEiSIbsyOOyNVi25Q/1BaguPYA== X-Received: by 2002:a17:906:4993:b0:88a:b6ca:7d3d with SMTP id p19-20020a170906499300b0088ab6ca7d3dmr13003608eju.8.1675505820728; Sat, 04 Feb 2023 02:17:00 -0800 (PST) Received: from localhost.localdomain (ip5f5abbf9.dynamic.kabel-deutschland.de. [95.90.187.249]) by smtp.gmail.com with ESMTPSA id m19-20020a1709061ed300b0088ed7de4821sm2632378ejj.158.2023.02.04.02.17.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Feb 2023 02:17:00 -0800 (PST) From: Michael Straube To: gregkh@linuxfoundation.org Cc: Larry.Finger@lwfinger.net, phil@philpotter.co.uk, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Michael Straube Subject: [PATCH 1/2] staging: r8188eu: correct error logic of rtl8188eu_init_recv_priv() Date: Sat, 4 Feb 2023 11:16:53 +0100 Message-Id: <20230204101654.10232-2-straube.linux@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230204101654.10232-1-straube.linux@gmail.com> References: <20230204101654.10232-1-straube.linux@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756895244198300817?= X-GMAIL-MSGID: =?utf-8?q?1756895244198300817?= Convert the function rtl8188eu_init_recv_priv() away from returning _FAIL and _SUCCESS, which uses inverted error logic. Return 0 for success and negative values for failure instead. Signed-off-by: Michael Straube --- drivers/staging/r8188eu/core/rtw_recv.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_recv.c b/drivers/staging/r8188eu/core/rtw_recv.c index 631c500dda42..70d43c10e53d 100644 --- a/drivers/staging/r8188eu/core/rtw_recv.c +++ b/drivers/staging/r8188eu/core/rtw_recv.c @@ -38,7 +38,7 @@ void _rtw_init_sta_recv_priv(struct sta_recv_priv *psta_recvpriv) static int rtl8188eu_init_recv_priv(struct adapter *padapter) { struct recv_priv *precvpriv = &padapter->recvpriv; - int i, res = _SUCCESS; + int i, err = 0; struct recv_buf *precvbuf; tasklet_init(&precvpriv->recv_tasklet, @@ -50,10 +50,8 @@ static int rtl8188eu_init_recv_priv(struct adapter *padapter) precvpriv->pallocated_recv_buf = kzalloc(NR_RECVBUFF * sizeof(struct recv_buf) + 4, GFP_KERNEL); - if (!precvpriv->pallocated_recv_buf) { - res = _FAIL; - goto exit; - } + if (!precvpriv->pallocated_recv_buf) + return -ENOMEM; precvpriv->precv_buf = (u8 *)ALIGN((size_t)(precvpriv->pallocated_recv_buf), 4); @@ -64,7 +62,7 @@ static int rtl8188eu_init_recv_priv(struct adapter *padapter) precvbuf->reuse = false; precvbuf->purb = usb_alloc_urb(0, GFP_KERNEL); if (!precvbuf->purb) { - res = _FAIL; + err = -ENOMEM; break; } precvbuf->adapter = padapter; @@ -94,8 +92,8 @@ static int rtl8188eu_init_recv_priv(struct adapter *padapter) pskb = NULL; } } -exit: - return res; + + return err; } int _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter) @@ -141,7 +139,8 @@ int _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter) } precvpriv->rx_pending_cnt = 1; - res = rtl8188eu_init_recv_priv(padapter); + if (rtl8188eu_init_recv_priv(padapter)) + res = _FAIL; timer_setup(&precvpriv->signal_stat_timer, rtw_signal_stat_timer_hdl, 0); precvpriv->signal_stat_sampling_interval = 1000; /* ms */ From patchwork Sat Feb 4 10:16:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Straube X-Patchwork-Id: 52759 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1291241wrn; Sat, 4 Feb 2023 02:21:01 -0800 (PST) X-Google-Smtp-Source: AK7set/8q0oeHIJkXxUjkEJBJpaR0T/ekiOurioUbSr860oHohyhlg/y7+911ssffHl3XD2S+YIt X-Received: by 2002:a05:6a20:42a8:b0:bc:cede:fb98 with SMTP id o40-20020a056a2042a800b000bccedefb98mr17012805pzj.36.1675506061380; Sat, 04 Feb 2023 02:21:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675506061; cv=none; d=google.com; s=arc-20160816; b=xGLNOVX0hZDTju7JLjVlL08NJkmoFOt8uNaoglHloU8GCKacmKItvKueBEFD7XHzBC h5B3Sqjh9PfQ33NuLuPCrf5vCnqHMkgREyjrmjyQjYYJs4YHKRXPrvCIqUlsF5COOu3q mZIKkDhXWwwg+yMwRhrzVQLtBlcykH6lffemT7+FPxvl1NtGWB2XC3izExVz1nURF6UB j5YReOqwmKQ5Zq1AD7TPFfLRe9b+t0BFliwLMXGgYsF/BNIDibvG5WUin467gd38fisN CoTgzdeGDXeURpyyjSutBl8B3+r/5xSmJJRfNEKJ9OEXJkml/D0ur7u2TkiF/KOSfRpd lHBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=vvcz/YyCGtXoD5oGFLtUkYy0diaSuTeqxFRDCLmhIXc=; b=herk4QokxAidyj2+M6JLYUysXNDRdBu56/6SZnoHkSV/AkFcAiBDtasgaUxjIkpV5A kvG+FoPWdKtB2hxKw1XXpx5d2zRgHRXeX1TlXwFojAzjn3W/mLW0oOudTigz1EMHZhM1 yhM6fe8bT+fHL1pwYPFlpH/CFQX41P1rnqMSCxhbTRFWVcxbLbYxxU9Ny3IujRwiBUW3 vGIjpuIGn5wMFThDVpSynmXaLKbtcs+dFfudLTUMWIOTJzPXOdDKItQdv4U6d+9Xqo5b sPkfMEeDJmgxoaORmI/v3DdHEUSTji1nt9t5ODRBkMaesNyEOpY5S15l+f4lk9RC+Pni CigQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=pXvfIB0C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i6-20020a639d06000000b004e12a68827asi5878934pgd.621.2023.02.04.02.20.48; Sat, 04 Feb 2023 02:21:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=pXvfIB0C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232640AbjBDKRK (ORCPT + 99 others); Sat, 4 Feb 2023 05:17:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232228AbjBDKRD (ORCPT ); Sat, 4 Feb 2023 05:17:03 -0500 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A432828D06 for ; Sat, 4 Feb 2023 02:17:02 -0800 (PST) Received: by mail-ej1-x62a.google.com with SMTP id p26so21614941ejx.13 for ; Sat, 04 Feb 2023 02:17:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vvcz/YyCGtXoD5oGFLtUkYy0diaSuTeqxFRDCLmhIXc=; b=pXvfIB0Cbl+zg+3jyWscDCAcdybMl4jllRa1XNHVpVaICIe036QuFut6fX/my11LzX A29v2nBimcRhtWLjUq5fw79RqgtyHABYKzKmE0KalCMHnN5c1CjMnJgx+F2lxucQ8UTf KqKS8AndMwq3wphzn4/3QFajNcqwIFp4enopvQ0SLJv60TaOj+U1Ov1iVIjsXOQXI0zP 4ZveSSV3Ts4PrpZypEWqHRuIiCYwWD/MRROHOG3gRAzVXWdRuhnU8t3WmelmBiF5zA3z Vs1ZgMrlT+89J5lHR13FyOLzn6F0Ch9vkZILAqUXZQS7vvHx3mZZ69nBErzW7x7PJLzJ j2fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vvcz/YyCGtXoD5oGFLtUkYy0diaSuTeqxFRDCLmhIXc=; b=6Ch3IK7GVsedvfUrC67aavFvEwT6UujYtD6j0MfGJA6tBjQJTOq2T55QUDgUe14D1F pBV3svdM47pWqcnJnyV3esLV6kmPwuYVOYZ8RnERwVpk8fCJQgYRwQ8jWXest+DFa57/ ZgHs8OsnLKD+ggC19ism4wShaSz1GDPL4Wfl+24hsuFBhKaaJMHFV8F0sygJ0eAcpYvL xbmkI576fV6ndJ58RRSRBN6a8XQIYXTz/u/moyDGWWPu5kEISdv4ZnHoEVVGrLWeAPa0 P6R357Zornrrn2guWemS1N61ZoQkcr1GK6/nKs7ffQSdkPzdjzg14dAxw83rVSazmTCS /5pw== X-Gm-Message-State: AO0yUKWLGVRh26KtT6RiCyQSOSNdPxW4Aw29OnMoGIQbdtekpVh81t0t Bshfl+W/ZEGtGqmpbQ0cuoOvq4iHhpeqdg== X-Received: by 2002:a17:907:1308:b0:88a:bb13:7329 with SMTP id vj8-20020a170907130800b0088abb137329mr12274825ejb.53.1675505821296; Sat, 04 Feb 2023 02:17:01 -0800 (PST) Received: from localhost.localdomain (ip5f5abbf9.dynamic.kabel-deutschland.de. [95.90.187.249]) by smtp.gmail.com with ESMTPSA id m19-20020a1709061ed300b0088ed7de4821sm2632378ejj.158.2023.02.04.02.17.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Feb 2023 02:17:01 -0800 (PST) From: Michael Straube To: gregkh@linuxfoundation.org Cc: Larry.Finger@lwfinger.net, phil@philpotter.co.uk, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Michael Straube Subject: [PATCH 2/2] staging: r8188eu: correct error logic of _rtw_init_recv_priv() Date: Sat, 4 Feb 2023 11:16:54 +0100 Message-Id: <20230204101654.10232-3-straube.linux@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230204101654.10232-1-straube.linux@gmail.com> References: <20230204101654.10232-1-straube.linux@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756895444118424154?= X-GMAIL-MSGID: =?utf-8?q?1756895444118424154?= Convert the function _rtw_init_recv_priv() away from returning _FAIL and _SUCCESS, which uses inverted error logic. Return 0 for success and negative values for failure instead. Signed-off-by: Michael Straube --- drivers/staging/r8188eu/core/rtw_recv.c | 17 +++++------------ drivers/staging/r8188eu/os_dep/os_intfs.c | 2 +- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_recv.c b/drivers/staging/r8188eu/core/rtw_recv.c index 70d43c10e53d..4c823bbcc22b 100644 --- a/drivers/staging/r8188eu/core/rtw_recv.c +++ b/drivers/staging/r8188eu/core/rtw_recv.c @@ -99,10 +99,8 @@ static int rtl8188eu_init_recv_priv(struct adapter *padapter) int _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter) { int i; - struct recv_frame *precvframe; - - int res = _SUCCESS; + int err = 0; spin_lock_init(&precvpriv->lock); @@ -115,11 +113,8 @@ int _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter) precvpriv->free_recvframe_cnt = NR_RECVFRAME; precvpriv->pallocated_frame_buf = vzalloc(NR_RECVFRAME * sizeof(struct recv_frame) + RXFRAME_ALIGN_SZ); - - if (!precvpriv->pallocated_frame_buf) { - res = _FAIL; - goto exit; - } + if (!precvpriv->pallocated_frame_buf) + return -ENOMEM; precvpriv->precv_frame_buf = (u8 *)ALIGN((size_t)(precvpriv->pallocated_frame_buf), RXFRAME_ALIGN_SZ); @@ -139,16 +134,14 @@ int _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter) } precvpriv->rx_pending_cnt = 1; - if (rtl8188eu_init_recv_priv(padapter)) - res = _FAIL; + err = rtl8188eu_init_recv_priv(padapter); timer_setup(&precvpriv->signal_stat_timer, rtw_signal_stat_timer_hdl, 0); precvpriv->signal_stat_sampling_interval = 1000; /* ms */ rtw_set_signal_stat_timer(precvpriv); -exit: - return res; + return err; } static void rtl8188eu_free_recv_priv(struct adapter *padapter) diff --git a/drivers/staging/r8188eu/os_dep/os_intfs.c b/drivers/staging/r8188eu/os_dep/os_intfs.c index cfc24420e70c..4130e8fe2952 100644 --- a/drivers/staging/r8188eu/os_dep/os_intfs.c +++ b/drivers/staging/r8188eu/os_dep/os_intfs.c @@ -482,7 +482,7 @@ u8 rtw_init_drv_sw(struct adapter *padapter) goto free_mlme_ext; } - if (_rtw_init_recv_priv(&padapter->recvpriv, padapter) == _FAIL) { + if (_rtw_init_recv_priv(&padapter->recvpriv, padapter)) { dev_err(dvobj_to_dev(padapter->dvobj), "_rtw_init_recv_priv failed\n"); goto free_xmit_priv; }