From patchwork Sun Nov 6 12:48:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 16130 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1477163wru; Sun, 6 Nov 2022 04:51:47 -0800 (PST) X-Google-Smtp-Source: AMsMyM7NIQ5L33zLbxb1acSTYnHKLGHbf3PaUYVy57RGDGtnkqcTgSsadSMtONmgBFA4D3m2TYJm X-Received: by 2002:a17:907:1b1c:b0:72f:9aac:ee41 with SMTP id mp28-20020a1709071b1c00b0072f9aacee41mr15788648ejc.56.1667739107614; Sun, 06 Nov 2022 04:51:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667739107; cv=none; d=google.com; s=arc-20160816; b=lBSUgLMfwrMTChJ1jg00zUGwZxkbodDzjM/UvzTjtarvXsc9pQWl6fBJN2C5ZUsF0w SWby14tiEiC6Ls6aDKwAHRvzJ1sNEKXBasjhbkNpQXErfJ2O4NiYasdOTupCZo6T+dEQ zpVssrheKs62gJBVTUon+B9AnYuHL/DbGkZyl3jiDkOBHTrxFIqyPDqkecbA2BAWezig SXRej7mRrIbIdLhOIiPHKYoWPD+C6nuQw+Jb9/ECx9bHOjCKPOTBBCGXtLLwgFEPHW2L bpz7euspAFbObthAWix0S69v05eUuPbqlGH89b1PLICukDuHaUFScN9UZjxblBpJtCn0 kJCA== 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; bh=5kT7xi9VnVNOQWDRX48pX3OZXVrsoa9uVvmIjZHu9XM=; b=JgvmWdPx2u7+GLpmgD61y4/5sJtvs6EKQBvIDrfy3T+0SWX2ZXCEMGKj5e7P17XUS5 vpyDze/F4q28VG5rJNs9pZ1IEESC22YNM1JcbiKx4UVNxbdGHHPUAHJJNMK8RNOKZvYT YL6jeYFaJdfiHea3pbskNU4ysggNVircV3mWDGxQ9udLkaogQqcItqhb1bbsoXSKW5MB KhlXDb5G+rqzO+gcycL/99BvqIj88LULQWJ+ot3lfm0gUwvztuACt1n+4WCVlf9zt4Hw 4rzPjSianMxxrUmRCELMxtztTwYdbaD4UhZlbKGhc4dCbiysAMnJA1XALsM4yB0xUnDK UzVQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a26-20020aa7d75a000000b0045bccc84cebsi5441396eds.71.2022.11.06.04.51.24; Sun, 06 Nov 2022 04:51:47 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230013AbiKFMt1 (ORCPT + 99 others); Sun, 6 Nov 2022 07:49:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229967AbiKFMtR (ORCPT ); Sun, 6 Nov 2022 07:49:17 -0500 Received: from viti.kaiser.cx (viti.kaiser.cx [IPv6:2a01:238:43fe:e600:cd0c:bd4a:7a3:8e9f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9E0464E0 for ; Sun, 6 Nov 2022 04:49:16 -0800 (PST) Received: from ipservice-092-217-068-220.092.217.pools.vodafone-ip.de ([92.217.68.220] helo=martin-debian-2.paytec.ch) by viti.kaiser.cx with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1orf5M-0008Dj-PQ; Sun, 06 Nov 2022 13:49:12 +0100 From: Martin Kaiser To: Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Michael Straube , Pavel Skripkin , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 6/9] staging: r8188eu: clean up rtw_hal_init Date: Sun, 6 Nov 2022 13:48:58 +0100 Message-Id: <20221106124901.720785-7-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221106124901.720785-1-martin@kaiser.cx> References: <20221106124901.720785-1-martin@kaiser.cx> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE 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?1748751202730609851?= X-GMAIL-MSGID: =?utf-8?q?1748751202730609851?= Clean up the rtw_hal_init function. Remove the status variable. Exit immediately for errors. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/hal/hal_intf.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/drivers/staging/r8188eu/hal/hal_intf.c b/drivers/staging/r8188eu/hal/hal_intf.c index 37935aef71ea..13790e32f11c 100644 --- a/drivers/staging/r8188eu/hal/hal_intf.c +++ b/drivers/staging/r8188eu/hal/hal_intf.c @@ -6,24 +6,19 @@ #include "../include/drv_types.h" #include "../include/hal_intf.h" -uint rtw_hal_init(struct adapter *adapt) +uint rtw_hal_init(struct adapter *adapt) { - uint status = _SUCCESS; - adapt->hw_init_completed = false; - status = rtl8188eu_hal_init(adapt); + if (rtl8188eu_hal_init(adapt) != _SUCCESS) + return _FAIL; - if (status == _SUCCESS) { - adapt->hw_init_completed = true; + adapt->hw_init_completed = true; - if (adapt->registrypriv.notch_filter == 1) - hal_notch_filter_8188e(adapt, 1); - } else { - adapt->hw_init_completed = false; - } + if (adapt->registrypriv.notch_filter == 1) + hal_notch_filter_8188e(adapt, 1); - return status; + return _SUCCESS; } uint rtw_hal_deinit(struct adapter *adapt)