All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joey Pabalinas <joeypabalinas@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Joey Pabalinas <joeypabalinas@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Arnd Bergmann <arnd@arndb.de>, Jiri Slaby <jslaby@suse.cz>,
	Tomasz Kramkowsk <tk@the-tk.com>
Subject: [PATCH v2 0/4] tty/nozomi: general module cleanup
Date: Sat, 24 Mar 2018 01:27:28 -1000	[thread overview]
Message-ID: <20180324112732.29424-1-joeypabalinas@gmail.com> (raw)

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

             reply	other threads:[~2018-03-24 11:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-24 11:27 Joey Pabalinas [this message]
2018-03-24 11:27 ` [PATCH v2 1/4] tty/nozomi: cleanup DUMP() macro Joey Pabalinas
2018-04-23  8:51   ` Greg Kroah-Hartman
2018-04-23 10:40     ` Joey Pabalinas
2018-03-24 11:27 ` [PATCH v2 2/4] tty/nozomi: fix inconsistent indentation Joey Pabalinas
2018-03-24 11:27 ` [PATCH v2 3/4] tty/nozomi: improve code readability and style Joey Pabalinas
2018-03-24 11:27 ` [PATCH v2 4/4] tty/nozomi: refactor conditional statements Joey Pabalinas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180324112732.29424-1-joeypabalinas@gmail.com \
    --to=joeypabalinas@gmail.com \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tk@the-tk.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.