Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp1541795ybf; Sun, 1 Mar 2020 11:57:25 -0800 (PST) X-Google-Smtp-Source: APXvYqzralGSwWtO+gHgePpiMsQrzWwbBo3Caxoe+6qX/M6FRCcNFkVnSFQInXto8HutlFi2+onz X-Received: by 2002:a05:6830:150:: with SMTP id j16mr10579812otp.301.1583092644887; Sun, 01 Mar 2020 11:57:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583092644; cv=none; d=google.com; s=arc-20160816; b=jo/JQTc5FOfDDzhOSKIz3zCRdniNrHWsQMD6xkJZskg8ouSRQcOfP+4Onolh4OQBwt RvD8oajdyW5yzkCkfU9e4KOxC8g193VxFWkLQo7tXXiHRT2a26IhfQxbhNKgxDkegv1v EdVPN+qOqJrolU9Ev3+Szvu+s1o6u6i3AGMq7iXGf8WjU756r09CQjA5qGo21eB32afc MariRtYGfZ8uD1MbncVJK25/gRYTVoIIikJZEwhCEaGx0AhXblozZ55pC47CVXainrXr dV35QH6QofWbx7CTYU0nVq8LPTr8j16sR6sw/SKMnj7waar68Fv2a70adEhzqybMl78u xqDA== 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=fSFSqrX9EZCZqGtSjZ4YiznooYdVMnFpa/bMf/yvC7Y=; b=eO8L0LBYiL2+o1li4mGWVCaE0Hm6k41sKhXvBG4yrx4QzWOF0Aq1ohPZJjPlcZDYkG LaH6BgF97ZTavBtCa07PYRGQbNMNuVstO2yPIz5XlwifQe1NBgn9k3YV+k7b6YYBe+WO SGKVtmIgd69Bx4ZqFuUh527zjEXFm04Uhw08ipyPM4596Ei2HwJ9Jxqa5N7Oj2btduBJ KDwC41X8T40V8hbK1j4ptZ7B3Tx7SEaSMnKCZ7/Gs5uWZXHt9XXxNXV39pxlKXf/xXgg GhUUw0cqtXBoOjQif/BNUZxVYG3q2mq6cvwgM9RI27zzS6CMUUOqf0uxjlFa0Fw6htUs KyFQ== 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 v24si5042810otn.125.2020.03.01.11.57.13; Sun, 01 Mar 2020 11:57:24 -0800 (PST) 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 S1726874AbgCAT5A (ORCPT + 99 others); Sun, 1 Mar 2020 14:57:00 -0500 Received: from wtarreau.pck.nerim.net ([62.212.114.60]:32076 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725895AbgCAT47 (ORCPT ); Sun, 1 Mar 2020 14:56:59 -0500 Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id 021Ju5wk011202; Sun, 1 Mar 2020 20:56:05 +0100 From: Willy Tarreau To: Denis Efremov Cc: Jens Axboe , linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, Willy Tarreau , Ian Molton , Russell King , Linus Torvalds Subject: [PATCH v2 2/6] floppy: remove incomplete support for second FDC from ARM code Date: Sun, 1 Mar 2020 20:55:51 +0100 Message-Id: <20200301195555.11154-3-w@1wt.eu> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20200301195555.11154-1-w@1wt.eu> References: <20200301195555.11154-1-w@1wt.eu> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The ARM code was written with the apparent hope to one day support a second FDC except that the code was incomplete and only touches the first one, which is also reflected by N_FDC==1. However this made its fd_outb() macro artificially depend on the global or local "fdc" variable. Let's get rid of this and make it explicit it doesn't rely on this variable anymore. Cc: Ian Molton Cc: Russell King Cc: Linus Torvalds Signed-off-by: Willy Tarreau --- arch/arm/include/asm/floppy.h | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/arch/arm/include/asm/floppy.h b/arch/arm/include/asm/floppy.h index 4655652..7e58979 100644 --- a/arch/arm/include/asm/floppy.h +++ b/arch/arm/include/asm/floppy.h @@ -50,17 +50,13 @@ static inline int fd_dma_setup(void *data, unsigned int length, * to a non-zero track, and then restoring it to track 0. If an error occurs, * then there is no floppy drive present. [to be put back in again] */ -static unsigned char floppy_selects[2][4] = -{ - { 0x10, 0x21, 0x23, 0x33 }, - { 0x10, 0x21, 0x23, 0x33 } -}; +static unsigned char floppy_selects[4] = { 0x10, 0x21, 0x23, 0x33 }; #define fd_setdor(dor) \ do { \ int new_dor = (dor); \ if (new_dor & 0xf0) \ - new_dor = (new_dor & 0x0c) | floppy_selects[fdc][new_dor & 3]; \ + new_dor = (new_dor & 0x0c) | floppy_selects[new_dor & 3]; \ else \ new_dor &= 0x0c; \ outb(new_dor, FD_DOR); \ @@ -84,9 +80,7 @@ do { \ */ static void driveswap(int *ints, int dummy, int dummy2) { - floppy_selects[0][0] ^= floppy_selects[0][1]; - floppy_selects[0][1] ^= floppy_selects[0][0]; - floppy_selects[0][0] ^= floppy_selects[0][1]; + swap(floppy_selects[0], floppy_selects[1]); } #define EXTRA_FLOPPY_PARAMS ,{ "driveswap", &driveswap, NULL, 0, 0 } -- 2.9.0