Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4626249ybv; Wed, 26 Feb 2020 00:09:39 -0800 (PST) X-Google-Smtp-Source: APXvYqzdsF6YbdLkhvUVi0c6vANJAC4VySsBUL7jc22QgrF025o6biKribXo2N/wZz5fhKawobiD X-Received: by 2002:aca:dc45:: with SMTP id t66mr2206010oig.39.1582704579062; Wed, 26 Feb 2020 00:09:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582704579; cv=none; d=google.com; s=arc-20160816; b=ciI0NxxP9IWYObbjRFknWhFSO0J1PaxfPh22WUK3BNwLnaq3cgPgksp6WKQPeUvGKm Q/Fi7A9Ym5VKwqqhMJwIPfLt9nqjWpLIHnP1MoBMyd/G6fNY4Abm5x9gSXbS8EzMT/rP KgQTRqtP1S5rpa3jJGWYBY9IIPvEspFgcamDcYWZuyUitZ9TXsROKBh/AIdULVCwg/fY NmzHoSQftVmajzpS+UjoDxnoFhR99GDWqwnnRHW2DejK3OCRea+jNC0roU7wKyoNlvoV D1Shsh8tCCVn8H45xF+mN5Vu29Go9rdAA+QIRcZcpSg2KrSJZmojjqCyBTtvw9bc7DXr o0mg== 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=6qSB9/oRhscJIuvCO+cNSuW+nOULG2Qug4x1DyvNCgc=; b=gbwtJw/N3WXPHi1CfWTaWK55YJrypyvKcGfLKeYd5sdGf5YqWuqHKd4hER/M2T7oXe r6i6Q2m6328ZrMQssZ06oK3EgpMhFExZRgnWkdI42pkyRw/GUw1Kh/OnUlmJtZcxjA5i BApxeutpo6LVNCBT5cTZpk1fZvSybkgYOXJIvM2GEKtQZCL21lqV+WNwIoigCPrP2NKy tn3ZBMJzK82orirs9dPYATsjuibOn7WljvMPl6BNtnMmA0x25i+L6tt2Tb2AuiV8F9IL xRfJo9Pqlwnqx7PeluBMl9h5TnhAeqIkFet4Ct2bwwYyLAVkeF9SsvUxhz0i0gtV7oot n+Ag== 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 t22si1051010oth.211.2020.02.26.00.09.27; Wed, 26 Feb 2020 00:09:39 -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 S1727502AbgBZIII (ORCPT + 99 others); Wed, 26 Feb 2020 03:08:08 -0500 Received: from wtarreau.pck.nerim.net ([62.212.114.60]:31568 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727389AbgBZIIH (ORCPT ); Wed, 26 Feb 2020 03:08:07 -0500 Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id 01Q87i8Y001961; Wed, 26 Feb 2020 09:07:44 +0100 From: Willy Tarreau To: Denis Efremov , Linus Torvalds Cc: Jens Axboe , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Willy Tarreau Subject: [PATCH 13/16] floppy: prepare ARM code to simplify base address separation Date: Wed, 26 Feb 2020 09:07:29 +0100 Message-Id: <20200226080732.1913-3-w@1wt.eu> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20200226080732.1913-1-w@1wt.eu> References: <20200224212352.8640-1-w@1wt.eu> <20200226080732.1913-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. 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 f683953..c665136 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)) @@ -55,16 +60,6 @@ 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