Re: [PATCH] remoteproc: fix a.vs ~ typo

Dan Carpenter
2018-12-20T10:14:02Z

On Thu, Dec 20, 2018 at 10:05:55AM +0000, Patrice CHOTARD wrote:
> > - writel(!SLIM_EN_RUN, slim_rproc->slimcore + SLIM_EN_OFST);
> > + writel((unsigned int)~SLIM_EN_RUN, slim_rproc->slimcore + SLIM_EN_OFST);
> >
> > val = readl(slim_rproc->slimcore + SLIM_EN_OFST);
> > if (val & SLIM_EN_RUN)
> >
>
> Writing !SLIM_CLK_GATE_DIS or (unsigned int)~SLIM_CLK_GATE_DIS don't
> give the same result:
>
> !SLIM_CLK_GATE_DIS = 0
>
> (unsigned int)~SLIM_CLK_GATE_DIS = 0xfffffffe

Right. !BIT(0) is zero. I'm pretty sure we meant to do a bitwise
negate and not a logical negate from looking at the code, but I don't
know the real world impact and can't test it. It's kind of a crap
patch, but I think it's correct.

regards,
dan carpenter