Skip to content

block: avoid module usage in non-modular code

Paul Gortmaker lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3block: make genhd.c slightly more explicitly non-modularblock/genhd.c+1 -10 replies
2/3block: make blk-throttle.c explicitly non-modularblock/blk-throttle.c+2 -31 reply
3/3block: make noop-iosched.c explicitly non-modularblock/noop-iosched.c+4 -150 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 0/3] block: avoid module usage in non-modular code

This series of commits is a part of a larger project to ensure people don't reference modular support functions in non-modular code. Overall there was roughly 5k lines of dead code in the kernel due to this. So far we've fixed several areas, like tty, x86, net, ... and we continue to work on other areas.

There are several reasons to not use module support for code that can never be built as a module, but the big ones are:

(1) it is easy to accidentally code up unused module_exit and remove code
(2) it can be misleading when reading the source, thinking it can be modular when the Makefile and/or Kconfig prohibit it
(3) it requires the include of the module.h header file which in turn includes nearly everything else.

The block layer is an easy one as far as this cleanup goes. Only three files touched, and two of the three don't even change the compiled objects -- only the noop-iosched had an unused exit function removed.

Cc Jens Axboe <[email protected]>
Cc Vivek Goyal <[email protected]>

Paul Gortmaker (3):
block: make genhd.c slightly more explicitly non-modular
block: make blk-throttle.c explicitly non-modular
block: make noop-iosched.c explicitly non-modular

 block/blk-throttle.c |  5 ++---
 block/genhd.c        |  2 +-
 block/noop-iosched.c | 19 ++++---------------
 3 files changed, 7 insertions(+), 19 deletions(-)
Signature · 1 line
2.6.1