Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp1541891ybf; Sun, 1 Mar 2020 11:57:28 -0800 (PST) X-Google-Smtp-Source: APXvYqxxyB8O05K8vyJKMKdO7DPWvtwDPwlSolLBpgGfxEu0AG+HMkEJLX3z6Q19q25E7EL3w2Hn X-Received: by 2002:a05:6830:16d0:: with SMTP id l16mr10974731otr.83.1583092648002; Sun, 01 Mar 2020 11:57:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583092647; cv=none; d=google.com; s=arc-20160816; b=wSdfAZ4woTLKU5CgRWqyEPsFjD1kZX3COTBUBp08I5Ex/PBS8S1CwCx3AyOaNrlym5 B5dwpL+1HgqARNLeVxdAfF+3GLXwNWzE/9MSYgDORLMJqKw92VruH0C6mjakqinXKiBa zKM/Tx3VukVnflso6KsYr0nPs7t2C6IGd4J8yyKIYvC7NjQ70OfLj9YUfrQ3CDp/5+7L fCSDFrrMHE2SeFjUfSHzB/KXS/8KyVpl8sCWq8HwBI4Pz/c+IbiYOWlD245/yUHrlxDF 6jH4SmwoPkfUV2yfwiUK4KKSOi7EIZDGuIsnW1SW4iEvY7nInRSdLDXgKso2hGXiMn/E sq2w== 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=aa2QkdtbiiN48V+GVI47JOHbckh2muBSDM/kBid7Agc=; b=M+G2bSrMQeEs2xISYOCwW1JC5MfZnjDF/zzk+hcJH4RZrlBjao7ESo1+Lrz18clF9s 63cyOC72D47qHvE73hAHrCEaf3Kq9GvfRDr7JDHsnaQsiPeEzULjygUlYeHE9N4Ov+U+ UhnfjENBdfKlkfWNL+3/6a9F4RMNHktoiZf94g0pGwjV0wpHbwO14W1mx1KqbnvP7L6f SnEX0FIixkWJQHBO3NOeb9BSgatIFcl6Pv1q8WcBkoYLGpmwakvNkmsG8y/BWOn4rZoq G7JA6VFXqD8fBf8DpTd+N9elC8/XefTXg8hL727nGNeqtlm+JE3HB8NP11/4FwbLCs2p dwTg== 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 j8si5247266otr.161.2020.03.01.11.57.16; Sun, 01 Mar 2020 11:57:27 -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 S1726050AbgCAT5C (ORCPT + 99 others); Sun, 1 Mar 2020 14:57:02 -0500 Received: from wtarreau.pck.nerim.net ([62.212.114.60]:32080 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726845AbgCAT5B (ORCPT ); Sun, 1 Mar 2020 14:57:01 -0500 Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id 021Ju5Yj011203; 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 3/6] floppy: prepare ARM code to simplify base address separation Date: Sun, 1 Mar 2020 20:55:52 +0100 Message-Id: <20200301195555.11154-4-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 fd_outb() macro on ARM relies on a special fd_setdor() macro when the register is FD_DOR and both will need to be changed to accept a separate base address. Let's just remerge them to simplify the change and make this code more easily reviewable. Cc: Ian Molton Cc: Russell King Cc: Linus Torvalds Signed-off-by: Willy Tarreau --- arch/arm/include/asm/floppy.h | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/arch/arm/include/asm/floppy.h b/arch/arm/include/asm/floppy.h index 7e58979..34ebd86 100644 --- a/arch/arm/include/asm/floppy.h +++ b/arch/arm/include/asm/floppy.h @@ -9,12 +9,17 @@ #ifndef __ASM_ARM_FLOPPY_H #define __ASM_ARM_FLOPPY_H -#define fd_outb(val,port) \ - do { \ - if ((port) == (u32)FD_DOR) \ - fd_setdor((val)); \ - else \ - outb((val),(port)); \ +#define fd_outb(val,port) \ + do { \ + int new_val = (val); \ + if ((port) == (u32)FD_DOR) { \ + if (new_val & 0xf0) \ + new_val = (new_val & 0x0c) | \ + floppy_selects[new_val & 3]; \ + else \ + new_val &= 0x0c; \ + } \ + outb(new_val, (port)); \ } while(0) #define fd_inb(port) inb((port)) @@ -52,16 +57,6 @@ static inline int fd_dma_setup(void *data, unsigned int length, */ 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[new_dor & 3]; \ - else \ - new_dor &= 0x0c; \ - outb(new_dor, FD_DOR); \ -} while (0) - #define FDC1 (0x3f0) #define FLOPPY0_TYPE 4 -- 2.9.0