lkml.org 
[lkml]   [2018]   [Mar]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[PATCH v2 0/4] tty/nozomi: general module cleanup
Date
Sorry, totally screwed up git send-email CC's there; resending
the patchset.

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

\
 
 \ /
  Last update: 2018-03-24 12:28    [W:0.068 / U:0.464 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site