Re: [PATCH V2 06/15] genirq: Generic chip: Optimize for fixed-endian systems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Wednesday 29 October 2014 21:16:58 Brian Norris wrote:
> >  static int is_big_endian(struct irq_chip_generic *gc)
> >  {
> > -     return !!(gc->domain->gc->gc_flags & IRQ_GC_BE_IO);
> > +     if (IS_ENABLED(CONFIG_GENERIC_IRQ_CHIP) &&
> > +         !IS_ENABLED(CONFIG_GENERIC_IRQ_CHIP_BE))
> > +             return 0;
> > +     else if (IS_ENABLED(CONFIG_GENERIC_IRQ_CHIP_BE) &&
> > +              !IS_ENABLED(CONFIG_GENERIC_IRQ_CHIP))
> > +             return 1;
> 
> Would XOR make this any easier to read? e.g.:
> 
>         if (IS_ENABLED(CONFIG_GENERIC_IRQ_CHIP) ^
>             IS_ENABLED(CONFIG_GENERIC_IRQ_CHIP_BE))
>                 return IS_ENABLED(CONFIG_GENERIC_IRQ_CHIP_BE);
>         else
>                 ...
> 

I think that would only be easier to read for the compiler, not for
for a human. ;-)

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux