From patchwork Mon Feb 6 20:17:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 53493 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2448536wrn; Mon, 6 Feb 2023 12:36:31 -0800 (PST) X-Google-Smtp-Source: AK7set+PJ1Z9a/JV+BlaXzB67xph0mgf2HMlw7+4I0hUTB/aU/4D4RUNs0FpRC04ANZD1RLNX/1K X-Received: by 2002:a50:d79e:0:b0:4aa:a4ff:ab89 with SMTP id w30-20020a50d79e000000b004aaa4ffab89mr1088819edi.10.1675715791049; Mon, 06 Feb 2023 12:36:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675715791; cv=none; d=google.com; s=arc-20160816; b=HnljH7uPjLQJjKJ9nqI9o24CoFrpIe5CfXMrkVeDY0XLN8qkR++1kVlcq8FmGqDJk7 +PmFVD7Mke4I4PIcAT63Bz365jX182iKS4nrjriFANh070FzZNgDfZ4NlPnv8hUwbAdY rVh03O/k/M8F6Gitk4477WsSMfxh6rtwHYaNLR8bE3ov1WdKqVRYik72eF7qVqCE+PwD isslTRma12hQPQFFyMiBaWWbREw1kdU8ykB7LvGmB96TY776ODe8D2kqW+jVO3LHXibW oJ1iNCSutrf1mZIBPfQJgWXN8yurYb5jkdn0BqUgLw4gRVHUEqHyreL47o7+NltnfDXz PlmQ== 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=1q/XTckdm0GYIUp/EF1qW1VITWNL+pvdtNwLM1Y/4dY=; b=qSK/Io2+/j+3SihgKE26pmRUAClHtCfyUnP8GPhkg+nqS1KleEOxSx1O5b6C6U7NHS ryZ5nqQUKX0Xft6FXK8g4QJf+x4zAGIIs8hC/wOrRG4lQ5px+AvbiCulMgz+sAT3k2dg hX/0Sxv6THT9NaB3LpX88rKremAMowPp8Viy9GZjFP5qo/ubhccuvVpa8JNFqT0d3Y/R uytr+nP9t/Nls7l2hE5cP9DeczvABIckvJivkzknOYIKFJdcP3Hi/sq4FjfNguY/CnWC 3xSYhGcfTy1QKUgwQJKr3J/7T7vlRkhgrRBUD6CZ2Pwedwsm+0fn/vUGrrxFPx/A0TLl btaw== 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 r4-20020aa7da04000000b004aab36a29aesi4249776eds.552.2023.02.06.12.36.06; Mon, 06 Feb 2023 12:36:31 -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 S230094AbjBFUSh (ORCPT + 99 others); Mon, 6 Feb 2023 15:18:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229823AbjBFUSd (ORCPT ); Mon, 6 Feb 2023 15:18:33 -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 3C29A26858 for ; Mon, 6 Feb 2023 12:18:15 -0800 (PST) Received: from ipservice-092-217-084-033.092.217.pools.vodafone-ip.de ([92.217.84.33] 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 1pP7wH-0007ps-N2; Mon, 06 Feb 2023 21:18:09 +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 3/6] staging: r8188eu: use standard error codes in rtl8188eu_inirp_init Date: Mon, 6 Feb 2023 21:17:57 +0100 Message-Id: <20230206201800.139195-4-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230206201800.139195-1-martin@kaiser.cx> References: <20230206201800.139195-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?1757115361540792491?= X-GMAIL-MSGID: =?utf-8?q?1757115361540792491?= Replace the driver-specific _SUCCESS and _FAIL error codes in rtl8188eu_inirp_init. Return 0 for success or a negative error code as we do elsewhere in the kernel. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/hal/usb_halinit.c | 16 ++++++---------- drivers/staging/r8188eu/include/hal_intf.h | 2 +- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/drivers/staging/r8188eu/hal/usb_halinit.c b/drivers/staging/r8188eu/hal/usb_halinit.c index 25fd6f8d814c..a1051ac1cac4 100644 --- a/drivers/staging/r8188eu/hal/usb_halinit.c +++ b/drivers/staging/r8188eu/hal/usb_halinit.c @@ -848,29 +848,25 @@ u32 rtl8188eu_hal_deinit(struct adapter *Adapter) return _SUCCESS; } -unsigned int rtl8188eu_inirp_init(struct adapter *Adapter) +int rtl8188eu_inirp_init(struct adapter *Adapter) { u8 i; struct recv_buf *precvbuf; - uint status; struct recv_priv *precvpriv = &Adapter->recvpriv; - - status = _SUCCESS; + int ret; /* issue Rx irp to receive data */ precvbuf = (struct recv_buf *)precvpriv->precv_buf; for (i = 0; i < NR_RECVBUFF; i++) { - if (!rtw_read_port(Adapter, precvbuf)) { - status = _FAIL; - goto exit; - } + ret = rtw_read_port(Adapter, precvbuf); + if (ret) + return ret; precvbuf++; precvpriv->free_recv_buf_queue_cnt--; } -exit: - return status; + return 0; } /* */ diff --git a/drivers/staging/r8188eu/include/hal_intf.h b/drivers/staging/r8188eu/include/hal_intf.h index ac6e3f95c5b7..296aa5b8268d 100644 --- a/drivers/staging/r8188eu/include/hal_intf.h +++ b/drivers/staging/r8188eu/include/hal_intf.h @@ -26,7 +26,7 @@ void UpdateHalRAMask8188EUsb(struct adapter *adapt, u32 mac_id, u8 rssi_level); int rtl8188e_IOL_exec_cmds_sync(struct adapter *adapter, struct xmit_frame *xmit_frame, u32 max_wating_ms, u32 bndy_cnt); -unsigned int rtl8188eu_inirp_init(struct adapter *Adapter); +int rtl8188eu_inirp_init(struct adapter *Adapter); uint rtw_hal_init(struct adapter *padapter); uint rtw_hal_deinit(struct adapter *padapter);