[RFC PATCH 02/11] dma: amba-pl08x: Refactor pl08x_getbytes_chan() to lower indentation

Linus Walleij linus.walleij at linaro.org
Mon Jun 17 09:29:40 EDT 2013


On Sun, Jun 16, 2013 at 10:54 PM, Tomasz Figa <tomasz.figa at gmail.com> wrote:

> Further patch will introduce support for PL080S, which requires some
> things to be done conditionally, thus increasing indentation level of
> some functions even more.
>
> This patch reduces indentation level of pl08x_getbytes_chan() function
> by inverting several conditions and returning from function wherever
> possible.
>
> Signed-off-by: Tomasz Figa <tomasz.figa at gmail.com>

Nice refactoring and a patch that should be applied immediately
no matter what happens with the rest.
Reviewed-by: Linus Walleij <linus.walleij at linaro.org>

PS:

> +       if (!ch || !txd)
> +               return bytes;

Just return 0; is even clearer in this case but who cares.

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list