From patchwork Wed Jan 11 19:56:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 42177 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3510828wrt; Wed, 11 Jan 2023 12:01:36 -0800 (PST) X-Google-Smtp-Source: AMrXdXuzCicksapS4LvoD2cELOME2KDr1EeeQ8wrGiZi0BlfU8QZH4AAaKEJIq3pGYdRE5a3AyVE X-Received: by 2002:a17:907:88cd:b0:85c:dc1b:dfb0 with SMTP id rq13-20020a17090788cd00b0085cdc1bdfb0mr5713012ejc.47.1673467295977; Wed, 11 Jan 2023 12:01:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673467295; cv=none; d=google.com; s=arc-20160816; b=AdEePercAogg7ONo+Ed12h2UIBrhGnIVSNweSjcmb1nAntFSa0Uqv/rva1IQtMf1ZB 0g9vpb3byaWhospKBjxti4djASWLKQr79jiHSbc3SJsEL9SPuT+E/lp1xx3xQ9XE97p+ cJJwQ9MDzzvPjl9nVRkykkl1F/955vAiVp6OztIQT3E7o0gzFq9ghM3ErRiZbCEWXzun 6EiDa8jhPy/MzCflgpKIj+6DJut2v/dhZueUdXHSfC7CAbcSRVKlimHtq7Ul7RxYxVJc beexcCxwTiSUHUHrB2aBCLu7G+5wMRNVInC1x9lBAtHtn71TiVWW8in9pxreSlZ6YHhc gDdg== 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=HLkjcudH/91XkL9zcT3mqldIZ+sbTZiSAnDQdRAsSTM=; b=qD6u2AKDpUaGfzRH/DTqtfYItEq8lrYIF8U+xorgnX7ZzEmFwhXopc6CGbJWCmOjbI H7UxDc/CMLy/c4nm5QxbAxttRXx61pfdfcQ4FciW/dyxYz1xj4MNXFQ6bE0IVwmoRNfA ZpDiaWP4Kl8TpxQ7QWFhHFO8+cG/0SLyyZ3Si042As6YGxJQRL17sg16FIKcyMTqnMfj WVO7nyaFMqLi2sVlbwriqqbfkDg3Wpq7BWfist0asQBdmArn+4cUqOsMZkY6RTAVVRwf P4blONRL1ediwCt2S0H5+w0oJA4rzWJN8krTQ9utNQV2KvkvgqVbacb2IVgK/5SkW3jI 4Yhg== 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 gn28-20020a1709070d1c00b00860a59e0eecsi2086573ejc.80.2023.01.11.12.01.11; Wed, 11 Jan 2023 12:01:35 -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 S239785AbjAKT7O (ORCPT + 99 others); Wed, 11 Jan 2023 14:59:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235793AbjAKT5Q (ORCPT ); Wed, 11 Jan 2023 14:57:16 -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 08B4DB73 for ; Wed, 11 Jan 2023 11:57:15 -0800 (PST) Received: from dslb-188-096-145-172.188.096.pools.vodafone-ip.de ([188.96.145.172] 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 1pFhDe-0005F2-IF; Wed, 11 Jan 2023 20:57:06 +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 17/20] staging: r8188eu: pass struct adapter to usb_read Date: Wed, 11 Jan 2023 20:56:37 +0100 Message-Id: <20230111195640.306748-18-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230111195640.306748-1-martin@kaiser.cx> References: <20230111195640.306748-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?1754757643242796284?= X-GMAIL-MSGID: =?utf-8?q?1754757643242796284?= The usb_read function takes a struct intf_hdl only to extract the struct adapter from it. We can pass struct adapter directly. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/hal/usb_ops_linux.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/staging/r8188eu/hal/usb_ops_linux.c b/drivers/staging/r8188eu/hal/usb_ops_linux.c index 0deaa5c24ab2..f8900b51d750 100644 --- a/drivers/staging/r8188eu/hal/usb_ops_linux.c +++ b/drivers/staging/r8188eu/hal/usb_ops_linux.c @@ -7,9 +7,8 @@ #include "../include/usb_ops.h" #include "../include/rtl8188e_hal.h" -static int usb_read(struct intf_hdl *intf, u16 value, void *data, u8 size) +static int usb_read(struct adapter *adapt, u16 value, void *data, u8 size) { - struct adapter *adapt = intf->padapter; struct dvobj_priv *dvobjpriv = adapter_to_dvobj(adapt); struct usb_device *udev = dvobjpriv->pusbdev; int status; @@ -95,20 +94,18 @@ static int usb_write(struct intf_hdl *intf, u16 value, void *data, u8 size) int __must_check rtw_read8(struct adapter *adapter, u32 addr, u8 *data) { - struct intf_hdl *intf = &adapter->intf; u16 value = addr & 0xffff; - return usb_read(intf, value, data, 1); + return usb_read(adapter, value, data, 1); } int __must_check rtw_read16(struct adapter *adapter, u32 addr, u16 *data) { - struct intf_hdl *intf = &adapter->intf; u16 value = addr & 0xffff; __le16 le_data; int res; - res = usb_read(intf, value, &le_data, 2); + res = usb_read(adapter, value, &le_data, 2); if (res) return res; @@ -119,12 +116,11 @@ int __must_check rtw_read16(struct adapter *adapter, u32 addr, u16 *data) int __must_check rtw_read32(struct adapter *adapter, u32 addr, u32 *data) { - struct intf_hdl *intf = &adapter->intf; u16 value = addr & 0xffff; __le32 le_data; int res; - res = usb_read(intf, value, &le_data, 4); + res = usb_read(adapter, value, &le_data, 4); if (res) return res;