linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/10] floppy driver cleanups (deobfuscation)
@ 2020-02-24 21:23 Willy Tarreau
  2020-02-24 21:23 ` [PATCH 01/10] floppy: cleanup: expand macro FDCS Willy Tarreau
                   ` (11 more replies)
  0 siblings, 12 replies; 45+ messages in thread
From: Willy Tarreau @ 2020-02-24 21:23 UTC (permalink / raw)
  To: Denis Efremov
  Cc: Jens Axboe, linux-kernel, linux-block, Linus Torvalds, Willy Tarreau

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(-)

-- 
2.9.0


^ permalink raw reply	[flat|nested] 45+ messages in thread

end of thread, other threads:[~2020-03-01 17:01 UTC | newest]

Thread overview: 45+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-24 21:23 [PATCH 00/10] floppy driver cleanups (deobfuscation) Willy Tarreau
2020-02-24 21:23 ` [PATCH 01/10] floppy: cleanup: expand macro FDCS Willy Tarreau
2020-02-24 21:53   ` Linus Torvalds
2020-02-24 23:13     ` Denis Efremov
2020-02-25  3:45       ` Willy Tarreau
2020-02-25  7:14         ` Denis Efremov
2020-02-25 14:02           ` Willy Tarreau
2020-02-25 15:22             ` Denis Efremov
2020-02-25 15:39               ` Denis Efremov
2020-02-25 16:12                 ` Willy Tarreau
2020-02-25 18:02               ` Willy Tarreau
2020-02-25 18:08                 ` Willy Tarreau
2020-02-25 18:08               ` Linus Torvalds
2020-02-25 18:15                 ` Willy Tarreau
2020-02-25 18:27                   ` Linus Torvalds
2020-02-26  8:18                 ` Willy Tarreau
2020-02-25 11:37   ` Denis Efremov
2020-02-24 21:23 ` [PATCH 02/10] floppy: cleanup: expand macro UFDCS Willy Tarreau
2020-02-24 21:23 ` [PATCH 03/10] floppy: cleanup: expand macro UDP Willy Tarreau
2020-02-24 21:23 ` [PATCH 04/10] floppy: cleanup: expand macro UDRS Willy Tarreau
2020-02-24 21:23 ` [PATCH 05/10] floppy: cleanup: expand macro UDRWE Willy Tarreau
2020-02-24 21:23 ` [PATCH 06/10] floppy: cleanup: expand macro DP Willy Tarreau
2020-02-24 21:23 ` [PATCH 07/10] floppy: cleanup: expand macro DRS Willy Tarreau
2020-02-24 21:23 ` [PATCH 08/10] floppy: cleanup: expand macro DRWE Willy Tarreau
2020-02-24 21:23 ` [PATCH 09/10] floppy: cleanup: expand the R/W / format command macros Willy Tarreau
2020-02-24 21:23 ` [PATCH 10/10] floppy: cleanup: expand the reply_buffer macros Willy Tarreau
2020-02-26  8:07 ` [PATCH 11/16] floppy: remove dead code for drives scanning on ARM Willy Tarreau
2020-02-26  8:07   ` [PATCH 12/16] floppy: remove incomplete support for second FDC from ARM code Willy Tarreau
2020-02-29 16:38     ` Denis Efremov
2020-02-26  8:07   ` [PATCH 13/16] floppy: prepare ARM code to simplify base address separation Willy Tarreau
2020-02-26  8:07   ` [PATCH 14/16] floppy: introduce new functions fdc_inb() and fdc_outb() Willy Tarreau
2020-02-26  8:07   ` [PATCH 15/16] floppy: separate the FDC's base address from its registers Willy Tarreau
2020-02-26 15:36     ` Denis Efremov
2020-02-26 15:46       ` Willy Tarreau
2020-02-26  8:07   ` [PATCH 16/16] floppy: rename the global "fdc" variable to "current_fdc" Willy Tarreau
2020-03-01  8:21   ` [PATCH 11/16] floppy: remove dead code for drives scanning on ARM Denis Efremov
2020-03-01  8:59     ` Willy Tarreau
2020-02-26 14:57 ` [PATCH 00/10] floppy driver cleanups (deobfuscation) Denis Efremov
2020-02-26 17:49   ` Linus Torvalds
2020-02-26 18:41     ` Willy Tarreau
2020-02-29 14:13     ` Willy Tarreau
2020-02-29 15:58       ` Linus Torvalds
2020-02-29 23:19         ` Ondrej Zary
2020-03-01  6:46           ` Willy Tarreau
2020-03-01 17:01             ` Ondrej Zary

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).