Skip to content

floppy driver cleanups (deobfuscation)

Willy Tarreau linux-block lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest10 patches 23 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10floppy: cleanup: expand macro FDCSdrivers/block/floppy.c+91 -9215 replies
2/10floppy: cleanup: expand macro UFDCSdrivers/block/floppy.c+4 -50 replies
3/10floppy: cleanup: expand macro UDPdrivers/block/floppy.c+77 -750 replies
4/10floppy: cleanup: expand macro UDRSdrivers/block/floppy.c+83 -790 replies
5/10floppy: cleanup: expand macro UDRWEdrivers/block/floppy.c+4 -60 replies
6/10floppy: cleanup: expand macro DPdrivers/block/floppy.c+47 -370 replies
7/10floppy: cleanup: expand macro DRSdrivers/block/floppy.c+61 -540 replies
8/10floppy: cleanup: expand macro DRWEdrivers/block/floppy.c+7 -90 replies
9/10floppy: cleanup: expand the R/W / format command macrosdrivers/block/floppy.c+98 -960 replies
10/10floppy: cleanup: expand the reply_buffer macrosdrivers/block/floppy.c+47 -390 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/10] floppy driver cleanups (deobfuscation)

As indicated in commit 2e90ca6 ("floppy: check FDC index for errors before assigning it") there are some surprising effects in the floppy driver due to some macros referencing global or local variables while at first glance being inoffensive.

This patchset aims at removing these macros and replacing all of their occurrences by the equivalent code. Most of the work was done under Coccinelle's assistance, and it was verified that the resulting binary code is exactly the same as the original one.

The aim is not to make the driver prettier, as Linus mentioned it's already not pretty. It only aims at making potential bugs more visible, given almost all latest changes to this driver were fixes for out-of- bounds and similar bugs.

As a side effect, some lines got longer, causing checkpatch to complain a bit, but I preferred to let it complain as I didn't want to break them apart as I'm already seeing the trap of going too far here.

The patches are broken by macro (or sets of macros when relevant) so that each of them remains reviewable.

I can possibly go a bit further in the cleanup but I haven't used floppies for a few years now and am not interested in doing too much on this driver by lack of use cases.

Willy Tarreau (10):
floppy: cleanup: expand macro FDCS
floppy: cleanup: expand macro UFDCS
floppy: cleanup: expand macro UDP
floppy: cleanup: expand macro UDRS
floppy: cleanup: expand macro UDRWE
floppy: cleanup: expand macro DP
floppy: cleanup: expand macro DRS
floppy: cleanup: expand macro DRWE
floppy: cleanup: expand the R/W / format command macros
floppy: cleanup: expand the reply_buffer macros

 drivers/block/floppy.c | 971 +++++++++++++++++++++++++------------------------
 1 file changed, 499 insertions(+), 472 deletions(-)
Signature · 1 line
2.9.0