[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200225180820.GA1133@1wt.eu>
Date: Tue, 25 Feb 2020 19:08:20 +0100
From: Willy Tarreau <w@....eu>
To: Denis Efremov <efremov@...ux.com>
Cc: Jens Axboe <axboe@...nel.dk>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-block <linux-block@...r.kernel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [PATCH 01/10] floppy: cleanup: expand macro FDCS
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
Powered by blists - more mailing lists