Kumar Gala wrote:

> Can you post a driver that uses this.  I'm interested in seeing what the 
> readability is really like using these macros.

I do not yet have any drivers ready, but I can give you an example:

        setmaskedbits_be32(&uccp->gumr_l,
                UCC_SLOW_GUMR_L_MODE_QMC | UCC_SLOW_GUMR_L_TDCR_1 |
                UCC_SLOW_GUMR_L_RDCR_16,
                 UCC_SLOW_GUMR_L_MODE_MASK | UCC_SLOW_GUMR_L_TDCR_MASK |
                UCC_SLOW_GUMR_L_RDCR_MASK);

        setmaskedbits_be32(&uccp->gumr_h,
                UCC_SLOW_GUMR_H_SUART | UCC_SLOW_GUMR_H_TRX |
                UCC_SLOW_GUMR_H_TTX, UCC_SLOW_GUMR_H_RFW);

The alternative to using a macro like this is to do this:

        reg = in_be32(p);
        reg &= ~some-mask-bits;
        reg |= some-other-bits;
        out_be32(p, reg);

-- 
Timur Tabi
Linux Kernel Developer @ Freescale
_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Reply via email to