From patchwork Tue Nov 26 19:12:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 3240711 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B6FA9C045B for ; Tue, 26 Nov 2013 19:12:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9884420453 for ; Tue, 26 Nov 2013 19:12:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C27382037B for ; Tue, 26 Nov 2013 19:12:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757969Ab3KZTMp (ORCPT ); Tue, 26 Nov 2013 14:12:45 -0500 Received: from mail-ea0-f181.google.com ([209.85.215.181]:54633 "EHLO mail-ea0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757895Ab3KZTMp (ORCPT ); Tue, 26 Nov 2013 14:12:45 -0500 Received: by mail-ea0-f181.google.com with SMTP id m10so3928992eaj.40 for ; Tue, 26 Nov 2013 11:12:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:to:cc:date:content-type:mime-version :content-transfer-encoding; bh=FFTGkqzyrZAzO15PWCIJoWQxBYWqVnEHW+nauDroEVA=; b=T3HsBZTUbws9DkRDz1a1BALw+efD2DYWqIMzJILJQOKR+9V9834oI7xLaDKklLlaEc uV0qGdZ3hooTkaxUFQVpQ21qT3QYE1p8OFommxGrOFqMGncwyY15CN+g4ehWwp8mkiHn 91BpbXITlFd6+xTApOivdWlem0R8Sw2GaCvwdbq73c3qy7rAosJwi9oYY25ITIvAd7dd nTM2Qp6lPLCKR5isFj7wrA0DAdmO/8pkz370F4PvtjtMxKDgFrMB1qHt7x0akxvfenm9 L6lwLMQWfBXy0Mpa36y1mzSk4XC+TsXHGVUqPbB0C2EyytZDy25FdMLgYpuLb0AOQfXA kDNA== X-Received: by 10.14.215.70 with SMTP id d46mr236012eep.147.1385493163852; Tue, 26 Nov 2013 11:12:43 -0800 (PST) Received: from [192.168.1.100] (92.41.96.220.threembb.co.uk. [92.41.96.220]) by mx.google.com with ESMTPSA id n1sm11820677eep.20.2013.11.26.11.12.42 for (version=SSLv3 cipher=RC4-SHA bits=128/128); Tue, 26 Nov 2013 11:12:43 -0800 (PST) Message-ID: <1385493158.6446.7.camel@canaries32-MCP7A> Subject: [PATCH 2/3] staging: vt6656: s_vGetFreeContext remove pReturnContext From: Malcolm Priestley To: gregkh@linuxfoundation.org Cc: linux-wireless@vger.kernel.org Date: Tue, 26 Nov 2013 19:12:38 +0000 X-Mailer: Evolution 3.8.5-2ubuntu1 Mime-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Just return the context from for loop. Return NULL if end reached. Signed-off-by: Malcolm Priestley --- drivers/staging/vt6656/rxtx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c index 0e4b6fb..6534f75 100644 --- a/drivers/staging/vt6656/rxtx.c +++ b/drivers/staging/vt6656/rxtx.c @@ -141,7 +141,6 @@ static struct vnt_usb_send_context *s_vGetFreeContext(struct vnt_private *pDevice) { struct vnt_usb_send_context *pContext = NULL; - struct vnt_usb_send_context *pReturnContext = NULL; int ii; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"GetFreeContext()\n"); @@ -153,15 +152,14 @@ static struct vnt_usb_send_context if (pContext->bBoolInUse == false) { pContext->bBoolInUse = true; memset(pContext->Data, 0, MAX_TOTAL_SIZE_WITH_ALL_HEADERS); - pReturnContext = pContext; - break; + return pContext; } } if ( ii == pDevice->cbTD ) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"No Free Tx Context\n"); } - return pReturnContext; + return NULL; } static void s_vSaveTxPktInfo(struct vnt_private *pDevice, u8 byPktNum,