Re: [PATCH 01/10] floppy: cleanup: expand macro FDCS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux