linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* question about arch/powerpc/platforms/cell/celleb_scc_uhc.c
@ 2010-09-01 15:51 Julia Lawall
  2010-09-01 16:02 ` Joe Perches
  0 siblings, 1 reply; 3+ messages in thread
From: Julia Lawall @ 2010-09-01 15:51 UTC (permalink / raw)
  To: Arnd Bergmann, Benjamin Herrenschmidt
  Cc: cbe-oss-dev, linuxppc-dev, Paul Mackerras, joe

The file arch/powerpc/platforms/cell/celleb_scc_uhc.c contains the 
following function:

static inline int uhc_clkctrl_ready(u32 val)
{
        const u32 mask = SCC_UHC_USBCEN | SCC_UHC_USBCEN;
        return((val & mask) == mask);
}

The variable mask is a bit or of two identical constants.  Later in the 
same file in the function enable_scc_uhc, I see the code:

val |= (SCC_UHC_USBCEN | SCC_UHC_USBEN);

Should the code in uhc_clkctrl_ready also be SCC_UHC_USBCEN | SCC_UHC_USBEN?
Or something else?

thanks,
julia

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: question about arch/powerpc/platforms/cell/celleb_scc_uhc.c
  2010-09-01 15:51 question about arch/powerpc/platforms/cell/celleb_scc_uhc.c Julia Lawall
@ 2010-09-01 16:02 ` Joe Perches
  2010-09-01 16:05   ` Julia Lawall
  0 siblings, 1 reply; 3+ messages in thread
From: Joe Perches @ 2010-09-01 16:02 UTC (permalink / raw)
  To: Julia Lawall; +Cc: cbe-oss-dev, Paul Mackerras, linuxppc-dev, Arnd Bergmann

On Wed, 2010-09-01 at 17:51 +0200, Julia Lawall wrote:
> The file arch/powerpc/platforms/cell/celleb_scc_uhc.c contains the 
> following function:
> static inline int uhc_clkctrl_ready(u32 val)
> {
>         const u32 mask = SCC_UHC_USBCEN | SCC_UHC_USBCEN;
>         return((val & mask) == mask);
> }
> The variable mask is a bit or of two identical constants.  Later in the 
> same file in the function enable_scc_uhc, I see the code:
> val |= (SCC_UHC_USBCEN | SCC_UHC_USBEN);
> Should the code in uhc_clkctrl_ready also be SCC_UHC_USBCEN | SCC_UHC_USBEN?
> Or something else?

Thanks Julia.

This was also noticed a couple of years ago and not applied
http://lkml.indiana.edu/hypermail/linux/kernel/0808.2/1428.html

One day...

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: question about arch/powerpc/platforms/cell/celleb_scc_uhc.c
  2010-09-01 16:02 ` Joe Perches
@ 2010-09-01 16:05   ` Julia Lawall
  0 siblings, 0 replies; 3+ messages in thread
From: Julia Lawall @ 2010-09-01 16:05 UTC (permalink / raw)
  To: Joe Perches; +Cc: cbe-oss-dev, Paul Mackerras, linuxppc-dev, Arnd Bergmann

On Wed, 1 Sep 2010, Joe Perches wrote:

> On Wed, 2010-09-01 at 17:51 +0200, Julia Lawall wrote:
> > The file arch/powerpc/platforms/cell/celleb_scc_uhc.c contains the 
> > following function:
> > static inline int uhc_clkctrl_ready(u32 val)
> > {
> >         const u32 mask = SCC_UHC_USBCEN | SCC_UHC_USBCEN;
> >         return((val & mask) == mask);
> > }
> > The variable mask is a bit or of two identical constants.  Later in the 
> > same file in the function enable_scc_uhc, I see the code:
> > val |= (SCC_UHC_USBCEN | SCC_UHC_USBEN);
> > Should the code in uhc_clkctrl_ready also be SCC_UHC_USBCEN | SCC_UHC_USBEN?
> > Or something else?
> 
> Thanks Julia.
> 
> This was also noticed a couple of years ago and not applied
> http://lkml.indiana.edu/hypermail/linux/kernel/0808.2/1428.html
> 
> One day...

OK, thanks, I will send a patch shortly.

julia

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-09-01 16:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-01 15:51 question about arch/powerpc/platforms/cell/celleb_scc_uhc.c Julia Lawall
2010-09-01 16:02 ` Joe Perches
2010-09-01 16:05   ` Julia Lawall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).