All of lore.kernel.org
 help / color / mirror / Atom feed
* GPMI nand driver cleanup
@ 2017-12-06  9:19 Sascha Hauer
  2017-12-06  9:19 ` [PATCH 01/10] mtd: nand: gpmi: Fix failure when a erased page has a bitflip at BBM Sascha Hauer
                   ` (9 more replies)
  0 siblings, 10 replies; 18+ messages in thread
From: Sascha Hauer @ 2017-12-06  9:19 UTC (permalink / raw)
  To: linux-mtd; +Cc: Richard Weinberger, kernel, Han Xu, Boris Brezillon

This series contains several cleanup patches for the GPMI nand driver.
The code is unnecessarily complicated in several places. For example
the private driver data struct contains variables which should better
be passed around between functions to make the lifetime of these
variables clear. Also there are functions which take up to eight
arguements and are so trivial that they are shorter and easier to
read if open coded in the caller.

The series also contains the bugfix in 1/10 which I previously sent
separately.

The driver has more room for cleanups. The splitting up into gpmi-lib
and gpmi-nand seems rather unnecessary. The gpmi-lib functions call
back into gpmi-nand which contradicts the principle of a lib. Also
the functions in gpmi-lib all have a proper gpmi_ prefix, but the
functions exported from gpmi-nand.c do not have a prefix at all. In
several cases gpmi-nand.c only contains a wrapper around functions
in gpmi-lib.c. I tend to merge gpmi-nand.c and gpmi-lib.c into a
single file (which would be around 3.7k lines then). I think this
would make the driver a lot more readable, but of course also produces
some churn. Before doing this I want to ask for other opinions to avoid
putting the work to /dev/null later.

Sascha

----------------------------------------------------------------
Sascha Hauer (10):
      mtd: nand: gpmi: Fix failure when a erased page has a bitflip at BBM
      mtd: nand: gpmi: Utilize hardware to detect bitflips in erased blocks
      mtd: nand: gpmi: drop dma_ops_type
      mtd: nand: gpmi: pass buffer and len around
      mtd: nand: gpmi: put only once used functions inline
      mtd: nand: gpmi: remove direct_dma_map_ok from driver data struct
      mtd: nand: gpmi: return valid value from bch_set_geometry()
      mtd: nand: gpmi: remove unnecessary variables
      mtd: nand: gpmi: rework gpmi_ecc_write_page
      mtd: nand: gpmi: return error code from gpmi_ecc_write_page

 drivers/mtd/nand/gpmi-nand/gpmi-lib.c  |  55 +++--
 drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 383 ++++++++-------------------------
 drivers/mtd/nand/gpmi-nand/gpmi-nand.h |  24 +--
 3 files changed, 128 insertions(+), 334 deletions(-)

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

end of thread, other threads:[~2017-12-08 10:57 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-06  9:19 GPMI nand driver cleanup Sascha Hauer
2017-12-06  9:19 ` [PATCH 01/10] mtd: nand: gpmi: Fix failure when a erased page has a bitflip at BBM Sascha Hauer
2017-12-06  9:19 ` [PATCH 02/10] mtd: nand: gpmi: Utilize hardware to detect bitflips in erased blocks Sascha Hauer
2017-12-06  9:27   ` Boris Brezillon
2017-12-06 15:28     ` Sascha Hauer
2017-12-06 15:34       ` Boris Brezillon
2017-12-08 10:21         ` Sascha Hauer
2017-12-08 10:35           ` Boris Brezillon
2017-12-08 10:57             ` Sascha Hauer
2017-12-06  9:19 ` [PATCH 03/10] mtd: nand: gpmi: drop dma_ops_type Sascha Hauer
2017-12-06  9:19 ` [PATCH 04/10] mtd: nand: gpmi: pass buffer and len around Sascha Hauer
2017-12-06  9:19 ` [PATCH 05/10] mtd: nand: gpmi: put only once used functions inline Sascha Hauer
2017-12-06  9:19 ` [PATCH 06/10] mtd: nand: gpmi: remove direct_dma_map_ok from driver data struct Sascha Hauer
2017-12-06  9:19 ` [PATCH 07/10] mtd: nand: gpmi: return valid value from bch_set_geometry() Sascha Hauer
2017-12-06  9:19 ` [PATCH 08/10] mtd: nand: gpmi: remove unnecessary variables Sascha Hauer
2017-12-06  9:19 ` [PATCH 09/10] mtd: nand: gpmi: rework gpmi_ecc_write_page Sascha Hauer
2017-12-06 14:57   ` Sascha Hauer
2017-12-06  9:19 ` [PATCH 10/10] mtd: nand: gpmi: return error code from gpmi_ecc_write_page Sascha Hauer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.