Skip to content

Floppy driver cleanups

Willy Tarreau linux-block lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest23 patches 18 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/23floppy: split the base port from the register in I/O accessesarch/alpha/include/asm/floppy.h arch/arm/include/asm/floppy.h arch/m68k/include/asm/floppy.h +8 more+36 -360 replies
2/23floppy: add references to 82077's extra registersinclude/uapi/linux/fdreg.h+13 -30 replies
3/23floppy: use symbolic register names in the m68k portarch/m68k/include/asm/floppy.h+8 -70 replies
4/23floppy: use symbolic register names in the parisc portarch/parisc/include/asm/floppy.h+8 -70 replies
5/23floppy: use symbolic register names in the powerpc portarch/powerpc/include/asm/floppy.h+8 -70 replies
6/23floppy: use symbolic register names in the sparc32 portarch/sparc/include/asm/floppy_32.h+23 -230 replies
7/23floppy: use symbolic register names in the sparc64 portarch/sparc/include/asm/floppy_64.h+32 -271 reply
8/23floppy: use symbolic register names in the x86 portarch/x86/include/asm/floppy.h+8 -70 replies
9/23floppy: cleanup: make twaddle() not rely on current_{fdc,drive} anymoredrivers/block/floppy.c+9 -90 replies
10/23floppy: cleanup: make reset_fdc_info() not rely on current_fdc anymoredrivers/block/floppy.c+10 -100 replies
11/23floppy: cleanup: make show_floppy() not rely on current_fdc anymoredrivers/block/floppy.c+7 -70 replies
12/23floppy: cleanup: make wait_til_ready() not rely on current_fdc anymoredrivers/block/floppy.c+9 -90 replies
13/23floppy: cleanup: make output_byte() not rely on current_fdc anymoredrivers/block/floppy.c+32 -320 replies
14/23floppy: cleanup: make result() not rely on current_fdc anymoredrivers/block/floppy.c+15 -150 replies
15/23floppy: cleanup: make need_more_output() not rely on current_fdc anymoredrivers/block/floppy.c+6 -60 replies
16/23floppy: cleanup: make perpendicular_mode() not rely on current_fdc anymoredrivers/block/floppy.c+8 -80 replies
17/23floppy: cleanup: make fdc_configure() not rely on current_fdc anymoredrivers/block/floppy.c+8 -90 replies
18/23floppy: cleanup: make fdc_specify() not rely on current_{fdc,drive} anymoredrivers/block/floppy.c+21 -210 replies
19/23floppy: cleanup: make check_wp() not rely on current_{fdc,drive} anymoredrivers/block/floppy.c+13 -130 replies
20/23floppy: cleanup: make next_valid_format() not rely on current_drive anymoredrivers/block/floppy.c+8 -80 replies
21/23floppy: cleanup: make get_fdc_version() not rely on current_fdc anymoredrivers/block/floppy.c+26 -260 replies
22/23floppy: cleanup: do not iterate on current_fdc in DMA grab/release functionsdrivers/block/floppy.c+20 -198 replies
23/23floppy: cleanup: add a few comments about expectations in certain functionsdrivers/block/floppy.c+13 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/23] Floppy driver cleanups

This series applies a second batch of cleanups to the floppy driver and its multiple arch-specific parts. Here the focus was on getting rid of hard-coded registers and flags values to switch to their symbolic definitions instead, and on making use of the global current_fdc variable much more explicit throughout the code to reduce the risk of accidental misuse as was the case with the most recently fixed bug.

Note that this code base is very old and the purpose is not to rewrite nor reorganize the driver at all, but instead to make certain things more obvious while keeping changes reviewable. It does not even address style issues that make checkpatch continue to complain a little bit (15 total warnings which were already there and don't seem worth addressing without more careful testing). Some comments were added to document a few non-obvious assumptions though.

This series was rediffed against today's master (458ef2a25e0c) which contains the first series. The changes were tested on x86 with real hardware, and was build-tested on ARM.

Willy Tarreau (23):
floppy: split the base port from the register in I/O accesses
floppy: add references to 82077's extra registers
floppy: use symbolic register names in the m68k port
floppy: use symbolic register names in the parisc port
floppy: use symbolic register names in the powerpc port
floppy: use symbolic register names in the sparc32 port
floppy: use symbolic register names in the sparc64 port
floppy: use symbolic register names in the x86 port
floppy: cleanup: make twaddle() not rely on current_{fdc,drive}
anymore
floppy: cleanup: make reset_fdc_info() not rely on current_fdc anymore
floppy: cleanup: make show_floppy() not rely on current_fdc anymore
floppy: cleanup: make wait_til_ready() not rely on current_fdc anymore
floppy: cleanup: make output_byte() not rely on current_fdc anymore
floppy: cleanup: make result() not rely on current_fdc anymore
floppy: cleanup: make need_more_output() not rely on current_fdc
anymore
floppy: cleanup: make perpendicular_mode() not rely on current_fdc
anymore
floppy: cleanup: make fdc_configure() not rely on current_fdc anymore
floppy: cleanup: make fdc_specify() not rely on current_{fdc,drive}
anymore
floppy: cleanup: make check_wp() not rely on current_{fdc,drive}
anymore
floppy: cleanup: make next_valid_format() not rely on current_drive
anymore
floppy: cleanup: make get_fdc_version() not rely on current_fdc
anymore
floppy: cleanup: do not iterate on current_fdc in DMA grab/release
functions
floppy: cleanup: add a few comments about expectations in certain
functions

 arch/alpha/include/asm/floppy.h             |   4 +-
 arch/arm/include/asm/floppy.h               |   8 +-
 arch/m68k/include/asm/floppy.h              |  27 +-
 arch/mips/include/asm/mach-generic/floppy.h |   8 +-
 arch/mips/include/asm/mach-jazz/floppy.h    |   8 +-
 arch/parisc/include/asm/floppy.h            |  19 +-
 arch/powerpc/include/asm/floppy.h           |  19 +-
 arch/sparc/include/asm/floppy_32.h          |  50 +--
 arch/sparc/include/asm/floppy_64.h          |  59 ++--
 arch/x86/include/asm/floppy.h               |  19 +-
 drivers/block/floppy.c                      | 330 ++++++++++----------
 include/uapi/linux/fdreg.h                  |  16 +-
 12 files changed, 299 insertions(+), 268 deletions(-)
Cc "David S. Miller" <[email protected]>
Cc Benjamin Herrenschmidt <[email protected]>
Cc Geert Uytterhoeven <[email protected]>
Cc Helge Deller <[email protected]>
Cc Ian Molton <[email protected]>
Cc Ivan Kokshaysky <[email protected]>
Cc Matt Turner <[email protected]>
Cc Richard Henderson <[email protected]>
Cc Russell King <[email protected]>
Cc Thomas Bogendoerfer <[email protected]>
Signature · 1 line
2.20.1