[PATCH 7/8] powerpc/5200: Refactor mpc5200 interrupt controller driver

Wolfgang Denk wd at denx.de
Mon Jan 26 17:26:36 EST 2009


Dear Grant Likely,

In message <fa686aa40901251622j542b6029u83c510f5b4e2f92 at mail.gmail.com> you wrote:
>
> >> -     case IRQF_TRIGGER_HIGH:
> >> -             type = 0;
> >> -             break;
> >> -     case IRQF_TRIGGER_RISING:
> >> -             type = 1;
> >> -             break;
> >> -     case IRQF_TRIGGER_FALLING:
> >> -             type = 2;
> >> -             break;
> >> -     case IRQF_TRIGGER_LOW:
> >> -             type = 3;
> >> -             break;
> >> +     case IRQF_TRIGGER_HIGH: type = 0; break;
> >> +     case IRQF_TRIGGER_RISING: type = 1; handler = handle_edge_irq; break;
> >> +     case IRQF_TRIGGER_FALLING: type = 2; handler = handle_edge_irq; break;
> >> +     case IRQF_TRIGGER_LOW: type = 3; break;
> >
> > The Linux coding style tells us not to do that:
...
> In principle I agree and follow that rule most of the time, but I have
> good reason for not choosing to do so here.
> 
> The whole point of coding style is to promote
> readability/manageability.  ie. the 80 column rule is a very strong
> guideline, but there are places where breaking that rule makes for
> more readable code than breaking things up and it is left to the
> discretion of the coder and the maintainer.

It's not so much the line length, IMO.

It's "Don't put multiple statements on a single line", plus
readability.

I think the new version is more difficult to read. It's plain ugly,
and inconsistent.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
It is common sense to take a method and try it. If it fails, admit it
frankly and try another. But above all, try something.
                                              - Franklin D. Roosevelt



More information about the Linuxppc-dev mailing list