From patchwork Thu Apr 3 14:12:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Genoud X-Patchwork-Id: 3932661 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 B1AEDBF540 for ; Thu, 3 Apr 2014 14:12:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A95332021A for ; Thu, 3 Apr 2014 14:12:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CA28A201F5 for ; Thu, 3 Apr 2014 14:12:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752180AbaDCOMc (ORCPT ); Thu, 3 Apr 2014 10:12:32 -0400 Received: from mail-we0-f169.google.com ([74.125.82.169]:52587 "EHLO mail-we0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752154AbaDCOMb (ORCPT ); Thu, 3 Apr 2014 10:12:31 -0400 Received: by mail-we0-f169.google.com with SMTP id w62so1942798wes.0 for ; Thu, 03 Apr 2014 07:12:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=v1Tg/JUiqXzn8YZv/oZs6GTZfWzXnRriCZpxIfVYeeM=; b=w6NO0tQ7zTUy4PlQSMbJR+L49n1tD+okwe3M4MBM7eeS7hEnXYsfR39ASw0aze77Pr E07J4u03qwofC9glHo7QxqjINxCx2AaYD6peCZEBKvBxwjYcUvB0VgwRsoz8ukG5vVEA ox1cIb0EdBvjDv+o+psKHATlZvTt7rCE2tTzjQpZCINk6GusBj7VETRqK8nNod7e0+H2 0uudEyxoEV/d/Ma4fCXHD1J6Vo/VSX4u00RzSunRBNPc7RFD0taueofoFZnst8wpxRLY BdYrpiRRrvEQxAkSk7+uKMhCmxEopaNWXNjLFlmUZzkBQcUS+j6Or70sLCIqVYi4c5nr y3Gg== X-Received: by 10.180.85.134 with SMTP id h6mr35774236wiz.44.1396534350018; Thu, 03 Apr 2014 07:12:30 -0700 (PDT) Received: from localhost (lyon.paratronic.fr. [213.41.177.106]) by mx.google.com with ESMTPSA id wl6sm7895300wjb.3.2014.04.03.07.12.28 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 03 Apr 2014 07:12:29 -0700 (PDT) From: Richard Genoud To: Ivo van Doorn Cc: Gertjan van Wingerde , Helmut Schaa , "John W. Linville" , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Richard Genoud Subject: [PATCH] rt2x00: BUG: remove double loop on REGISTER_BUSY_COUNT Date: Thu, 3 Apr 2014 16:12:07 +0200 Message-Id: <1396534327-12971-1-git-send-email-richard.genoud@gmail.com> X-Mailer: git-send-email 1.8.5.5 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.3 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 rt2x00usb_register_read_lock() calls rt2x00usb_vendor_req_buff_lock() that calls rt2x00usb_vendor_request() which is already looping up to REGISTER_BUSY_COUNT times. So this loop is not needed. Signed-off-by: Richard Genoud --- drivers/net/wireless/rt2x00/rt2x00usb.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c index 10572452cc21..14142b099019 100644 --- a/drivers/net/wireless/rt2x00/rt2x00usb.c +++ b/drivers/net/wireless/rt2x00/rt2x00usb.c @@ -148,12 +148,9 @@ int rt2x00usb_regbusy_read(struct rt2x00_dev *rt2x00dev, if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags)) return -ENODEV; - for (i = 0; i < REGISTER_BUSY_COUNT; i++) { - rt2x00usb_register_read_lock(rt2x00dev, offset, reg); - if (!rt2x00_get_field32(*reg, field)) - return 1; - udelay(REGISTER_BUSY_DELAY); - } + rt2x00usb_register_read_lock(rt2x00dev, offset, reg); + if (!rt2x00_get_field32(*reg, field)) + return 1; rt2x00_err(rt2x00dev, "Indirect register access failed: offset=0x%.08x, value=0x%.08x\n", offset, *reg);