mmc: card: do away with indirection pointer
authorLinus Walleij <linus.walleij@linaro.org>
Tue, 20 Sep 2016 09:34:38 +0000 (11:34 +0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 26 Sep 2016 19:31:31 +0000 (21:31 +0200)
commit29eb7bd01e80df316ab9d1da1a4ee580fae89188
treee665ba24917d0e009babbd5fe03fa25066f79513
parentc80f275fa1766cfdbc24c7a5d3d870df1fe730db
mmc: card: do away with indirection pointer

We have enough vtables in the kernel as it is, we don't need
this one to create even more artificial separation of concerns.

As is proved by the Makefile:

obj-$(CONFIG_MMC_BLOCK)         += mmc_block.o
mmc_block-objs                  := block.o queue.o

block.c and queue.c are baked into the same mmc_block.o object.
So why would one of these objects access a function in the
other object by dereferencing a pointer?

Create a new block.h header file for the single shared function
from block to queue and remove the function pointer and just
call the queue request function.

Apart from making the code more readable, this also makes link
optimizations possible and probably speeds up the call as well.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/card/block.c
drivers/mmc/card/block.h [new file with mode: 0644]
drivers/mmc/card/queue.c
drivers/mmc/card/queue.h