Re: [PATCH] staging: binder: fix coding style issues

From: Joe Perches
Date: Mon Sep 08 2014 - 09:58:14 EST


On Mon, 2014-09-08 at 17:37 +0400, Dmitry Voytik wrote:
> Fix coding style issues:
> * put braces in all if-else branches;
> * limit the length of changed lines to 80 columns.
> checkpatch.pl warning count reduces by 3.
[]
> diff --git a/drivers/staging/android/binder.c b/drivers/staging/android/binder.c
[]
> @@ -2198,12 +2198,16 @@ retry:
> struct binder_work *w;
> struct binder_transaction *t = NULL;
>
> - if (!list_empty(&thread->todo))
> - w = list_first_entry(&thread->todo, struct binder_work, entry);
> - else if (!list_empty(&proc->todo) && wait_for_proc_work)
> - w = list_first_entry(&proc->todo, struct binder_work, entry);
> - else {
> - if (ptr - buffer == 4 && !(thread->looper & BINDER_LOOPER_STATE_NEED_RETURN)) /* no data added */
> + if (!list_empty(&thread->todo)) {
> + w = list_first_entry(&thread->todo, struct binder_work,
> + entry);
> + } else if (!list_empty(&proc->todo) && wait_for_proc_work) {
> + w = list_first_entry(&proc->todo, struct binder_work,
> + entry);

Please indent multi line statements to the
appropriate open parenthesis using maximal
initial tabs and few spaces as required.

Here it would use 5 tabs, then 6 spaces.

w = list_first_entry(&proc->todo, struct binder_work,
entry);
> + } else {
> + /* no data added */
> + if (ptr - buffer == 4 && !(thread->looper &
> + BINDER_LOOPER_STATE_NEED_RETURN))

better as
if (ptr - buffer == 4 &&
!(thread->looper & BINDER_LOOPER_STATE_NEED_RETURN))


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/