linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] tty/nozomi: general module cleanup
@ 2018-03-24  0:31 Joey Pabalinas
  2018-03-24  0:31 ` [PATCH 1/4] tty/nozomi: cleanup DUMP() macro Joey Pabalinas
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Joey Pabalinas @ 2018-03-24  0:31 UTC (permalink / raw)
  To: linux-kernel
  Cc: Joey Pabalinas, Greg Kroah-Hartman, Arnd Bergmann, Jiri Slaby,
	Tomasz Kramkowsk

The nozomi module code has a fair amount of sections which could
use a bit of improvement; both style and clarity could be improved
while maintaining equivalent semantics.

Cleanup messy portions of the module code while preserving existing
behavior by:

 - Replacing constructs like `len__ > TMP_BUF_MAX ? TMP_BUF_MAX : len__`
   with `min_t(u32, len__, TMP_BUF_MAX)` and function calls like
   snprintf(tbuf, ..., "%s", ...). with strscpy(tbuf, ..., ...).
 - Rename identifiers more descriptively (where appropriate).
 - Simplify deeply nested conditionals by replacing them with shallower
   (but semantically equivalent) logic.
 - Coalesce return paths / loop conditionals.
 - Remove pointless initializations and redundant parentheses/break
   statements.
 - Correct inconsistently indented lines and extraneous whitespace.

CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
CC: Arnd Bergmann <arnd@arndb.de>
CC: Jiri Slaby <jslaby@suse.cz>
CC: Tomasz Kramkowsk <tk@the-tk.com>

Joey Pabalinas (4):
  tty/nozomi: cleanup DUMP() macro
  tty/nozomi: fix inconsistent indentation
  tty/nozomi: improve code readability and style
  tty/nozomi: refactor conditional statements

 drivers/tty/nozomi.c | 362 +++++++++++++++++++++++++--------------------------
 1 file changed, 181 insertions(+), 181 deletions(-)

-- 
2.16.3

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

end of thread, other threads:[~2018-03-24  0:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-24  0:31 [PATCH 0/4] tty/nozomi: general module cleanup Joey Pabalinas
2018-03-24  0:31 ` [PATCH 1/4] tty/nozomi: cleanup DUMP() macro Joey Pabalinas
2018-03-24  0:31 ` [PATCH 2/4] tty/nozomi: fix inconsistent indentation Joey Pabalinas
2018-03-24  0:31 ` [PATCH 3/4] tty/nozomi: improve code readability and style Joey Pabalinas
2018-03-24  0:31 ` [PATCH 4/4] tty/nozomi: refactor conditional statements Joey Pabalinas

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