Thread (13 messages) 13 messages, 6 authors, 2019-07-17

Re: [PATCH 2/2] net: macb: Add support for SiFive FU540-C000

From: Yash Shah <hidden>
Date: 2019-05-24 04:53:25
Also in: linux-devicetree, linux-riscv, lkml

On Thu, May 23, 2019 at 8:24 PM Andrew Lunn [off-list ref] wrote:
quoted
+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@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help