[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJ2_jOE0-zK1csRNeiAmag9kEbvOGhbvRa-5ESYif7e15gpRcQ@mail.gmail.com>
Date: Fri, 24 May 2019 10:22:06 +0530
From: Yash Shah <yash.shah@...ive.com>
To: Andrew Lunn <andrew@...n.ch>
Cc: mark.rutland@....com, devicetree@...r.kernel.org,
aou@...s.berkeley.edu, netdev@...r.kernel.org,
Palmer Dabbelt <palmer@...ive.com>,
linux-kernel@...r.kernel.org, nicolas.ferre@...rochip.com,
Sachin Ghadi <sachin.ghadi@...ive.com>, robh+dt@...nel.org,
Paul Walmsley <paul.walmsley@...ive.com>, ynezz@...e.cz,
linux-riscv@...ts.infradead.org, davem@...emloft.net
Subject: Re: [PATCH 2/2] net: macb: Add support for SiFive FU540-C000
On Thu, May 23, 2019 at 8:24 PM Andrew Lunn <andrew@...n.ch> wrote:
>
> > +static int fu540_macb_tx_set_rate(struct clk_hw *hw, unsigned long rate,
> > + unsigned long parent_rate)
> > +{
> > + rate = fu540_macb_tx_round_rate(hw, rate, &parent_rate);
> > + iowrite32(rate != 125000000, mgmt->reg);
>
> That looks odd. Writing the result of a comparison to a register?
The idea was to write "1" to the register if the value of rate is
anything else than 125000000.
To make it easier to read, I will change this to below:
- iowrite32(rate != 125000000, mgmt->reg);
+ if (rate != 125000000)
+ iowrite32(1, mgmt->reg);
+ else
+ iowrite32(0, mgmt->reg);
Hope that's fine. Thanks for your comment
- Yash
>
> Andrew
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@...ts.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv
Powered by blists - more mailing lists