Received: by 2002:a17:90a:1609:0:0:0:0 with SMTP id n9csp3646542pja; Tue, 31 Mar 2020 02:44:02 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtyzz7KBJQa8Bj3+/UM5TKAwKLngw+UU+Vs7sFJQAKG3rdIBZHepCmHU7EUNDW3vlEcukZ/ X-Received: by 2002:aca:5317:: with SMTP id h23mr1501171oib.33.1585647842798; Tue, 31 Mar 2020 02:44:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585647842; cv=none; d=google.com; s=arc-20160816; b=0+YZzrQJ3JXOTJeDD3hdAzlNjKLuLQUqZmMzwTVYi1KR3X3aQxpCFqxx5r0j6RqzaP DSYew4awY2gRl/GYpwDpHhyBX1P2KWg8EKCvhDL0ffMm1oquf+hy5dN53PJbowNHcw0m GIw1y0Hx9ufJjJ5l4ZobuJ+1GGBQ5FaIPrxbvYVzx4iYDbrWTpZCR5eIjNewDTQy92er Pol0ZtU6owrJ7v4gltbnQwZPEgfvHw2ngMx29O7EkVFnX3im4GiTAqNv8ZvSX4ovan6C 6aPK/2mrvG/v3SowcIZF617RzuIT4d/gQ0i+tKvQWCDpwMmz+jIIjWmo/5pnCGzdI2wr 56lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=Q7r5A07trGRKRLMNHxltRIKkwdYsu+VRK1ePuL46A9I=; b=gNiJGnqmPSLR3vYUXYvWWtCzO8E+ugnl+RrJS0zrxS0ZSGZOJS46+2/ulFjEClJBPO q16voKxY7AJkpt3/EuPw895JqILI73wA3BSwjXFUBbmeCrfk8eng2NjhqfhNqOXQdvvX 3R7DV2PppjLCkSd7ch/20v24MAYViFOBTd85CzrRypjyjo/yLSH6XrMMgz/WGxRbu0HU MXH3k83LrRqqSONyQ3Cam4nIO4QCJ3PMK8oPxRRq42rpUDjSMkaPwiYVMoIGebpJYssG wHk2hn+rk4AR9QXQlnwl+cVRmJPx2lqdz4kAf0Nr5GSFANKQcVonFJotvCnnpf1QzJGk auKw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s31si7365605otb.30.2020.03.31.02.43.50; Tue, 31 Mar 2020 02:44:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730436AbgCaJnD (ORCPT + 99 others); Tue, 31 Mar 2020 05:43:03 -0400 Received: from wtarreau.pck.nerim.net ([62.212.114.60]:34174 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730273AbgCaJnD (ORCPT ); Tue, 31 Mar 2020 05:43:03 -0400 Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id 02V9f576024519; Tue, 31 Mar 2020 11:41:05 +0200 From: Willy Tarreau To: Denis Efremov Cc: Jens Axboe , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Willy Tarreau Subject: [PATCH 12/23] floppy: cleanup: make wait_til_ready() not rely on current_fdc anymore Date: Tue, 31 Mar 2020 11:40:43 +0200 Message-Id: <20200331094054.24441-13-w@1wt.eu> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20200331094054.24441-1-w@1wt.eu> References: <20200331094054.24441-1-w@1wt.eu> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now the fdc is passed in argument so that the function does not use current_fdc anymore. Signed-off-by: Willy Tarreau --- drivers/block/floppy.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index dd739594fce7..5dfddd4726fb 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c @@ -1107,30 +1107,30 @@ static void setup_DMA(void) static void show_floppy(int fdc); /* waits until the fdc becomes ready */ -static int wait_til_ready(void) +static int wait_til_ready(int fdc) { int status; int counter; - if (fdc_state[current_fdc].reset) + if (fdc_state[fdc].reset) return -1; for (counter = 0; counter < 10000; counter++) { - status = fdc_inb(current_fdc, FD_STATUS); + status = fdc_inb(fdc, FD_STATUS); if (status & STATUS_READY) return status; } if (initialized) { - DPRINT("Getstatus times out (%x) on fdc %d\n", status, current_fdc); - show_floppy(current_fdc); + DPRINT("Getstatus times out (%x) on fdc %d\n", status, fdc); + show_floppy(fdc); } - fdc_state[current_fdc].reset = 1; + fdc_state[fdc].reset = 1; return -1; } /* sends a command byte to the fdc */ static int output_byte(char byte) { - int status = wait_til_ready(); + int status = wait_til_ready(current_fdc); if (status < 0) return -1; @@ -1159,7 +1159,7 @@ static int result(void) int status = 0; for (i = 0; i < MAX_REPLIES; i++) { - status = wait_til_ready(); + status = wait_til_ready(current_fdc); if (status < 0) break; status &= STATUS_DIR | STATUS_READY | STATUS_BUSY | STATUS_DMA; @@ -1186,7 +1186,7 @@ static int result(void) /* does the fdc need more output? */ static int need_more_output(void) { - int status = wait_til_ready(); + int status = wait_til_ready(current_fdc); if (status < 0) return -1; -- 2.20.1