Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3946489ybv; Tue, 25 Feb 2020 10:10:00 -0800 (PST) X-Google-Smtp-Source: APXvYqz0W6kOfNDzRsq//EDU8Qzyz8sIBjHwRMR5GHUZFplfuwJKqjdatWnY1TPytAHR9KKpUMSQ X-Received: by 2002:a9d:6647:: with SMTP id q7mr47617427otm.35.1582654199887; Tue, 25 Feb 2020 10:09:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582654199; cv=none; d=google.com; s=arc-20160816; b=Lj9Jvp0NixuGnIASRWshdu8x6pISPpqye9OOLe7By0MYrQA5xa6l+iW6BUOOTf3Abl rJI9xWjD9MzykEVnbx7agyA2flVFnmZ59zGir36i8fpkpyqqPvBGx4Ky3oqkBxcyWkfF Z2+EAi6TtPPbIlVeekcZ16eiopz47GBDzL/QKOceeYLlpV54ThHBHIKoMVR9FpxrqKiA r3KFGJAlzpeoFM2rCAD60jOaP2ES4+jQ81xnmZls7krGxoxSqmMECTibiATJmq7WBr9h 5g1Q5aYz4q08tFXQn3BOqlqcp4Qyq+abKrvKrna5lJJiuCGoqd1v1YhjRnzz2y8vYJzX jkmQ== 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=8aVWSsqj2FGcJzRzWxhmGKtQji0dFhHLLZp3qNCOgsY=; b=ApIRogVh4RvVP71zyG09M4/YmiskVjapnqTqCBR0SvQ7fEDflTyqv2pVsnxz+hhGMB OlMpjhK+2GkcCdSxnpaJ9rUNdOb1tGH8/xuwFeL0P01E0BngqG5G0LpBlEzodwneeCNF 6Sc4fjLaJ03tJt4NhbPtHGdeDk08hwRkWQU0BBqGS0B69lhT8MArxU8JkP5nfeRwHdqT yMh5qNYSa0k/ytU2K7StX0O+3ZUofr/TCG5RVd9moFMvxvC/ghQt3LfAGhIDY6KSZdUY z9bEv6btdsy/gIsX2HF/dc49gA3qxA6dCf8zkResnpAB1wxpFZuceQ95yTZSRY5rnBgP oMaA== 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 o7si8769139otk.185.2020.02.25.10.09.48; Tue, 25 Feb 2020 10:09: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 S1731219AbgBYSI3 (ORCPT + 99 others); Tue, 25 Feb 2020 13:08:29 -0500 Received: from wtarreau.pck.nerim.net ([62.212.114.60]:31545 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727983AbgBYSI2 (ORCPT ); Tue, 25 Feb 2020 13:08:28 -0500 Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id 01PI8KvV001137; Tue, 25 Feb 2020 19:08:20 +0100 Date: Tue, 25 Feb 2020 19:08:20 +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: <20200225180820.GA1133@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> <20200225180219.GA395@1wt.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200225180219.GA395@1wt.eu> 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 07:02:19PM +0100, Willy Tarreau wrote: > 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 And in the ARM case, fdc is used to index a two-entries array with exactly identical values, with N_FDC set to 1 so even there it's pointless... Maybe I'll get rid of this first. Willy