Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3945480ybv; Tue, 25 Feb 2020 10:08:59 -0800 (PST) X-Google-Smtp-Source: APXvYqweWH16Lr9czJcrSe6yeuCpwLsARg2P9YeUWTfUjURKLTd/pZrZzljB9Ij8W+2xVdcC7LJu X-Received: by 2002:aca:1206:: with SMTP id 6mr160805ois.176.1582654139290; Tue, 25 Feb 2020 10:08:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582654139; cv=none; d=google.com; s=arc-20160816; b=NiQ0c5u28fzRB5PZluwsyueCf1RZBnD95O4LLZFECclgazSvlg9uY7oFRRb1x4QK1r H+TIMw3uwSUepcE1vKPEwIByF/09JupRuB2f/odOsRF9Ggb7aLXTSNcNHsa/Fne+4he5 +utAsNYgIzgl+zK/XP3XjdWuBVMZn7ZawqrhqWr5x2Sd1vk1GbMwU0QcWAobUTPuDP9w evIN6IOWMMgpFHGijf2+3+WvBnyvxBWNp7/puL08ty3SQqlYrvRD7Z70Vhv9Qgefcx+0 +SnUUcanbE7WJGJHa2Uhgmf9hp/JYkF/zXz8Hc3KAGnrXPkxN44UPmiPeZuKo5ilAz6Q 2EPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=PKBeiBJ4VoYk7x22Zm82gCD/XZgaVr1lGcxPsMWXmE0=; b=kxZr8mq0fjZFT4KwWL5eHemXN9+yivsRS2w1/4ZmYOGx8kOhMjwh45Ul96BAuC43oc bWnN5PngSqdRfbC5oVP3CCrdjxtN3+1twKFA9XNU4oVa9LBaWlla0CFi41la4bhgcQFy nvmzxMvjRtsdESV6l9UA150BHjDkgpRqNxnu7mhNQry1HWgy+4FK9W9b9q422sPcHKT0 OdzRDp0/LdUyZcmHmhuoEjxVfzhfSt+jPqeABA5i74NmLAv+fD7FHocOZfWh+RmBUbwD hYNFY1hk3S+BdySNUMBMxJEbCEzr2yA8CfKwrBRm/BIU/PeNI9uslDqwxdn3dsVfGG9O RjGw== 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 g4si7189026oib.152.2020.02.25.10.08.47; Tue, 25 Feb 2020 10:08:59 -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 S1729894AbgBYSC3 (ORCPT + 99 others); Tue, 25 Feb 2020 13:02:29 -0500 Received: from wtarreau.pck.nerim.net ([62.212.114.60]:31541 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726953AbgBYSC3 (ORCPT ); Tue, 25 Feb 2020 13:02:29 -0500 Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id 01PI2Jho001120; Tue, 25 Feb 2020 19:02:19 +0100 Date: Tue, 25 Feb 2020 19:02:19 +0100 From: Willy Tarreau To: Denis Efremov Cc: Jens Axboe , Linux Kernel Mailing List , linux-block , Linus Torvalds Subject: Re: [PATCH 01/10] floppy: cleanup: expand macro FDCS Message-ID: <20200225180219.GA395@1wt.eu> References: <20200224212352.8640-1-w@1wt.eu> <20200224212352.8640-2-w@1wt.eu> <28e72058-021d-6de0-477e-6038a10d96da@linux.com> <20200225034529.GA8908@1wt.eu> <20200225140207.GA31782@1wt.eu> <10bc7df1-7a80-a05a-3434-ed0d668d0c6c@linux.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <10bc7df1-7a80-a05a-3434-ed0d668d0c6c@linux.com> User-Agent: Mutt/1.6.1 (2016-04-27) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 25, 2020 at 06:22:47PM +0300, Denis Efremov wrote: > I think that for the first attempt changing will be enough: > -static int fdc; /* current fdc */ > +static int current_fdc; /* current fdc */ > and > -#define FD_IOPORT fdc_state[fdc].address > +#define FD_IOPORT fdc_state[current_fdc].address > and for fd_setdor in ./arch/arm/include/asm/floppy.h So after a bit more digging, that should not be correct because: - disk_change() uses a local "fdc" variable with expectations that it will be used by fd_inb(FD_DIR) - set_dor() uses a local fdc argument that's used by fd_outb(newdor, FD_DOR) Here we have "fdc" hidden in: - FD_DOR/FD_DIR (referencing FD_IOPORT) on x86 - fd_outb(), relying on fd_setdor() on ARM I'm now looking how to change fd_outb() to pass the fdc in argument, after all it's not that many places and that's exactly what we need. Maybe afterwards we'll figure that some of them are still wrong :-) Willy