From patchwork Wed Mar 4 19:41:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 11420643 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 878F392A for ; Wed, 4 Mar 2020 19:42:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6402C217F4 for ; Wed, 4 Mar 2020 19:42:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ktEiW56x" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728665AbgCDTmA (ORCPT ); Wed, 4 Mar 2020 14:42:00 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:34739 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727835AbgCDTmA (ORCPT ); Wed, 4 Mar 2020 14:42:00 -0500 Received: by mail-wr1-f68.google.com with SMTP id z15so3985054wrl.1 for ; Wed, 04 Mar 2020 11:41:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:cc:from:subject:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=6qRC4ZEtbivWf7pTzAk5IxR4VdJwhvQpCG+0bFg+YM8=; b=ktEiW56xdeKdtuxV6JycjdIeSOuDU+DLJkql6lFehEQ6ipsd3gxfTfN13k6vkyk/oU fiTD1gkRHSacfSo2cd/Kty+URVgl5nPRgjI8+VN/P0tzw7O/UJvkxcPBhdpBkaWa+/G+ HiSXqdGoL86b2rRYjTz1MYQudJhVEcEGLHaqLKwssKSOfbF4R1M4780YsmpC8MNKVDe7 rY+XC8byCFDx7pbmI3BkcRX+oCcKzo+5NLlcRFMgJsHhweVUkcgjR3IEWSybIjH71XYQ kgT+BdHAzF/dcq7bfPNO5KfxFQ9E14uqleMZNy7rSJNqzUm8r2phryqjSQxIsFVAqb19 1OHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:from:subject:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=6qRC4ZEtbivWf7pTzAk5IxR4VdJwhvQpCG+0bFg+YM8=; b=Pl9JRlV8k89pT15Bzq2Uoglv4CIiHmtDsVGLeZ2u79A6sxQsks7eUjZhgFOv8d4Y1/ p65mKQvDteJAY7CbIzc13lAQEhffAuJM8undW93a93bSBi0iwW+ugXSQEMP30NrCaqke e9VbMNcT7gx38LXN7JJecMEqJEc4iWShR2iT9XMGcqIaR4mQIL826k3Kv0ttVW2th4Do ZksdQv72chI95jAoc5afX9+E0IaYcEd5ZzHF7PkHHseEmmO8deXdxhXXNA90ozcfut8X PsuWlhEcH7RQ8T17JVlmo8R2smPffXSyuR6i0JGjHl4sGzERKDHgDSFgrDMsNF7ufOQG oAzg== X-Gm-Message-State: ANhLgQ3jkxvKasD9JWEwQ/CDqogddBwMd8IL4xBJdMXyqgqA0d+iOhjq nLHxIbirqrV7LPOp6crWBGOXy5UL X-Google-Smtp-Source: ADFU+vs59BIina8af35nFwom2zL+4XxJ4Hy5d3D0d+YfcTrWe3Bnxi9Vker7DxPtPdFCIT95KLagbw== X-Received: by 2002:adf:8b1b:: with SMTP id n27mr5670686wra.324.1583350918287; Wed, 04 Mar 2020 11:41:58 -0800 (PST) Received: from [192.168.43.18] (92.40.168.8.threembb.co.uk. [92.40.168.8]) by smtp.gmail.com with ESMTPSA id i12sm26546110wrw.64.2020.03.04.11.41.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 04 Mar 2020 11:41:57 -0800 (PST) To: Greg Kroah-Hartman Cc: "devel@driverdev.osuosl.org" , linux-wireless@vger.kernel.org From: Malcolm Priestley Subject: [PATCH 1/2] staging: vt6656: Remove vnt_interrupt_buffer in_use flag. Message-ID: <69585034-4318-4bec-7d9b-f64a167df237@gmail.com> Date: Wed, 4 Mar 2020 19:41:55 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 Content-Language: en-US Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org mac80211 is the only user of in_use to start it and should not be true when so. So internal toggling of this variable is not relevant. Signed-off-by: Malcolm Priestley --- drivers/staging/vt6656/device.h | 1 - drivers/staging/vt6656/usbpipe.c | 28 +++------------------------- 2 files changed, 3 insertions(+), 26 deletions(-) diff --git a/drivers/staging/vt6656/device.h b/drivers/staging/vt6656/device.h index 5c9991415432..e94df4685b25 100644 --- a/drivers/staging/vt6656/device.h +++ b/drivers/staging/vt6656/device.h @@ -253,7 +253,6 @@ struct vnt_usb_send_context { */ struct vnt_interrupt_buffer { u8 *data_buf; - bool in_use; }; /* flags for options */ diff --git a/drivers/staging/vt6656/usbpipe.c b/drivers/staging/vt6656/usbpipe.c index b9e79755e7fa..fd2c9d9d6eb4 100644 --- a/drivers/staging/vt6656/usbpipe.c +++ b/drivers/staging/vt6656/usbpipe.c @@ -221,8 +221,6 @@ static void vnt_int_process_data(struct vnt_private *priv) low_stats->dot11ACKFailureCount += int_data->ack_fail; low_stats->dot11FCSErrorCount += int_data->fcs_err; } - - priv->int_buf.in_use = false; } static void vnt_start_interrupt_urb_complete(struct urb *urb) @@ -237,25 +235,19 @@ static void vnt_start_interrupt_urb_complete(struct urb *urb) case -ECONNRESET: case -ENOENT: case -ESHUTDOWN: - priv->int_buf.in_use = false; return; default: break; } - if (status) { - priv->int_buf.in_use = false; - + if (status) dev_dbg(&priv->usb->dev, "%s status = %d\n", __func__, status); - } else { + else vnt_int_process_data(priv); - } status = usb_submit_urb(priv->interrupt_urb, GFP_ATOMIC); if (status) dev_dbg(&priv->usb->dev, "Submit int URB failed %d\n", status); - else - priv->int_buf.in_use = true; } int vnt_start_interrupt_urb(struct vnt_private *priv) @@ -264,13 +256,6 @@ int vnt_start_interrupt_urb(struct vnt_private *priv) dev_dbg(&priv->usb->dev, "---->Interrupt Polling Thread\n"); - if (priv->int_buf.in_use) { - ret = -EBUSY; - goto err; - } - - priv->int_buf.in_use = true; - usb_fill_int_urb(priv->interrupt_urb, priv->usb, usb_rcvintpipe(priv->usb, 1), @@ -281,16 +266,9 @@ int vnt_start_interrupt_urb(struct vnt_private *priv) priv->int_interval); ret = usb_submit_urb(priv->interrupt_urb, GFP_ATOMIC); - if (ret) { + if (ret) dev_dbg(&priv->usb->dev, "Submit int URB failed %d\n", ret); - goto err_submit; - } - - return 0; -err_submit: - priv->int_buf.in_use = false; -err: return ret; } From patchwork Wed Mar 4 19:46:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 11420645 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8815B92A for ; Wed, 4 Mar 2020 19:46:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5F1A0217F4 for ; Wed, 4 Mar 2020 19:46:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="oQkubaaC" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387874AbgCDTqG (ORCPT ); Wed, 4 Mar 2020 14:46:06 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:38315 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387861AbgCDTqG (ORCPT ); Wed, 4 Mar 2020 14:46:06 -0500 Received: by mail-wr1-f68.google.com with SMTP id t11so3973386wrw.5 for ; Wed, 04 Mar 2020 11:46:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:cc:from:subject:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=yQqOnaNgqo9/pU61x9cE5W84q/MMvrOFd9j49w+kVT8=; b=oQkubaaCUXECeIMHdsEZ5kDdHWZI1vfkAkbD/bGVQTtzD0hECYz3g1mfG7NgAVOwA+ RM7FzQUhX0MrzpDR6AyAnF99AyvbX0QA9m4gTgrc3+kzwdvb7waG7C5AmWdo5dABvW9E swObt4kml8Buz8sldjwIIb9unhu17/SFqTxoMjGwhXsByqinrrnfQE/IR4GHWADmSR/9 YyqBoCYiVplGBt4mMRK2z1WfynEk1ynh+DTNgL0ynzP2p0rp21ZGzfMCLezpfaKfKRAG ECmOxv7ZcigrF4h+JN6eJGKpVRhNhgVcLMB95zkNeXEbmYDB/Hfl5HFQGLUa2r9btTUI d7Qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:from:subject:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=yQqOnaNgqo9/pU61x9cE5W84q/MMvrOFd9j49w+kVT8=; b=ZyZROnu0CAgkUm4USnWu4AEhmP7E9BnEO1Y/GSYh+xofof6he3lOs2VAV4txSqOV3X 8uxrcBUrOEJ8ySTGfk+ED09kjeBCjpUNx+ls9kwCi8UO8KcSnt59FHslP1+CeT0J8E+P /Qb780F8HXPzdvxyE7G2PQj6yzNA88PXRkXloeKVTf3EiEeLRehWe6Ds5YYQE81aCNw5 rCdF1Ltojyx0P0ZJdpHWVe8mg34h48Vkfo/IDMhA23uy2YeTCEF2EXo1WB15PYfdmsob 5Fc8v8a1Zt5n+fsKkpP4s/hVhnL2K8t3EEanXTwklQfW3tBYlY6Zf6bTYF9Rfxejipbi Lo+Q== X-Gm-Message-State: ANhLgQ1H/MznOav0hHqJxj5roRdXfNkYrc3dx4vQATxo8FhQJQLf2gF3 kx0GWvFSR+2o5IzNas+XCOrh0cBS X-Google-Smtp-Source: ADFU+vunlK+a37LieRWJlBzMTqmN8oDYgcLLYkHvqowrVp7siNYRP3fKIYbkjJy2iuf6t3M5Zba3sQ== X-Received: by 2002:a5d:4e8b:: with SMTP id e11mr2502804wru.136.1583351164403; Wed, 04 Mar 2020 11:46:04 -0800 (PST) Received: from [192.168.43.18] (92.40.168.8.threembb.co.uk. [92.40.168.8]) by smtp.gmail.com with ESMTPSA id a7sm5327252wmj.12.2020.03.04.11.46.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 04 Mar 2020 11:46:04 -0800 (PST) To: Greg Kroah-Hartman Cc: "devel@driverdev.osuosl.org" , linux-wireless@vger.kernel.org From: Malcolm Priestley Subject: [PATCH 2/2] staging: vt6656: struct vnt_rcb remove unused in_use. Message-ID: <130a4078-2502-a381-46c4-b473815e153b@gmail.com> Date: Wed, 4 Mar 2020 19:46:02 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 Content-Language: en-US Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org The variable merely toggles true to false and is unused. Signed-off-by: Malcolm Priestley --- drivers/staging/vt6656/device.h | 1 - drivers/staging/vt6656/main_usb.c | 3 --- drivers/staging/vt6656/usbpipe.c | 16 +++------------- 3 files changed, 3 insertions(+), 17 deletions(-) diff --git a/drivers/staging/vt6656/device.h b/drivers/staging/vt6656/device.h index e94df4685b25..98793e15e80f 100644 --- a/drivers/staging/vt6656/device.h +++ b/drivers/staging/vt6656/device.h @@ -227,7 +227,6 @@ struct vnt_rcb { void *priv; struct urb *urb; struct sk_buff *skb; - int in_use; }; /* used to track bulk out irps */ diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c index 41edadc74389..56f81785a118 100644 --- a/drivers/staging/vt6656/main_usb.c +++ b/drivers/staging/vt6656/main_usb.c @@ -478,9 +478,6 @@ static int vnt_alloc_bufs(struct vnt_private *priv) ret = -ENOMEM; goto free_rx_tx; } - - rcb->in_use = false; - /* submit rx urb */ ret = vnt_submit_rx_urb(priv, rcb); if (ret) diff --git a/drivers/staging/vt6656/usbpipe.c b/drivers/staging/vt6656/usbpipe.c index fd2c9d9d6eb4..eae211e5860f 100644 --- a/drivers/staging/vt6656/usbpipe.c +++ b/drivers/staging/vt6656/usbpipe.c @@ -393,10 +393,8 @@ static void vnt_submit_rx_urb_complete(struct urb *urb) if (urb->actual_length) { if (vnt_rx_data(priv, rcb, urb->actual_length)) { rcb->skb = dev_alloc_skb(priv->rx_buf_sz); - if (!rcb->skb) { - rcb->in_use = false; + if (!rcb->skb) return; - } } else { skb_push(rcb->skb, skb_headroom(rcb->skb)); skb_trim(rcb->skb, 0); @@ -406,11 +404,8 @@ static void vnt_submit_rx_urb_complete(struct urb *urb) skb_tailroom(rcb->skb)); } - if (usb_submit_urb(urb, GFP_ATOMIC)) { + if (usb_submit_urb(urb, GFP_ATOMIC)) dev_dbg(&priv->usb->dev, "Failed to re submit rx skb\n"); - - rcb->in_use = false; - } } int vnt_submit_rx_urb(struct vnt_private *priv, struct vnt_rcb *rcb) @@ -433,13 +428,8 @@ int vnt_submit_rx_urb(struct vnt_private *priv, struct vnt_rcb *rcb) rcb); ret = usb_submit_urb(urb, GFP_ATOMIC); - if (ret) { + if (ret) dev_dbg(&priv->usb->dev, "Submit Rx URB failed %d\n", ret); - goto end; - } - - rcb->in_use = true; - end: return ret; }