Sekhar Nori <[email protected]> writes:

> In the edma driver some if statememnts are broken up such that
> the condition code is at the same indentation level as the
> statement block. This makes reading it particularly difficult.
>
> This patch fixes that issue.
>
> Signed-off-by: Sekhar Nori <[email protected]>

Hmm, I'm with Sergei on this one...

> ---
>  arch/arm/mach-davinci/dma.c |   26 +++++++++++++-------------
>  1 files changed, 13 insertions(+), 13 deletions(-)
>
> diff --git a/arch/arm/mach-davinci/dma.c b/arch/arm/mach-davinci/dma.c
> index cc5fcda..2734de9 100644
> --- a/arch/arm/mach-davinci/dma.c
> +++ b/arch/arm/mach-davinci/dma.c
> @@ -330,7 +330,7 @@ static int irq2ctlr(int irq)
>       if (irq >= edma_cc[0]->irq_res_start && irq <= edma_cc[0]->irq_res_end)
>               return 0;
>       else if (irq >= edma_cc[1]->irq_res_start &&
> -             irq <= edma_cc[1]->irq_res_end)
> +                             irq <= edma_cc[1]->irq_res_end)

I much prefer the former style.  IMO, all that's needed here is adding
one space on the 2nd line so both 'irq's align.

In Emacs with (c-set-style "linux"), just hitting TAB to get
indentation will get you this style, without having to worry about
tabs/spaces etc.

>               return 1;
>  
>       return -1;
> @@ -352,7 +352,7 @@ static irqreturn_t dma_irq_handler(int irq, void *data)
>       dev_dbg(data, "dma_irq_handler\n");
>  
>       if ((edma_shadow0_read_array(ctlr, SH_IPR, 0) == 0)
> -         && (edma_shadow0_read_array(ctlr, SH_IPR, 1) == 0))
> +                     && (edma_shadow0_read_array(ctlr, SH_IPR, 1) == 0))

and here, the '&&' should be moved up and the second line aligned with
the first (e.g. the 'edma_shaadow0_read_array' calls aligned.


>               return IRQ_NONE;
>  
>       while (1) {
> @@ -406,9 +406,9 @@ static irqreturn_t dma_ccerr_handler(int irq, void *data)
>       dev_dbg(data, "dma_ccerr_handler\n");
>  
>       if ((edma_read_array(ctlr, EDMA_EMR, 0) == 0) &&
> -         (edma_read_array(ctlr, EDMA_EMR, 1) == 0) &&
> -         (edma_read(ctlr, EDMA_QEMR) == 0) &&
> -         (edma_read(ctlr, EDMA_CCERR) == 0))
> +                     (edma_read_array(ctlr, EDMA_EMR, 1) == 0) &&
> +                     (edma_read(ctlr, EDMA_QEMR) == 0) &&
> +                     (edma_read(ctlr, EDMA_CCERR) == 0))

I prefer the former: TAB + some extra spaces to handle readable
alignment.

>               return IRQ_NONE;
>  
>       while (1) {
> @@ -469,9 +469,9 @@ static irqreturn_t dma_ccerr_handler(int irq, void *data)
>                       }
>               }
>               if ((edma_read_array(ctlr, EDMA_EMR, 0) == 0)
> -                 && (edma_read_array(ctlr, EDMA_EMR, 1) == 0)
> -                 && (edma_read(ctlr, EDMA_QEMR) == 0)
> -                 && (edma_read(ctlr, EDMA_CCERR) == 0))
> +                             && (edma_read_array(ctlr, EDMA_EMR, 1) == 0)
> +                             && (edma_read(ctlr, EDMA_QEMR) == 0)
> +                             && (edma_read(ctlr, EDMA_CCERR) == 0))

and here, I would just make it look like the hunk above.

>                       break;
>               cnt++;
>               if (cnt > 10)
> @@ -773,7 +773,7 @@ void edma_free_slot(unsigned slot)
>       slot = EDMA_CHAN_SLOT(slot);
>  
>       if (slot < edma_cc[ctlr]->num_channels ||
> -             slot >= edma_cc[ctlr]->num_slots)
> +                     slot >= edma_cc[ctlr]->num_slots)

again the 'slot' should align using a TAB plus extra spaces.

[...]

I think you get the point, so I wont keep going.

But really, just use Emacs, set add (c-set-style "linux") to your
~/.emacs, then just hit 'TAB' and you'll get (at least I think is)
proper indentation.

Kevin

_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to