Thread (91 messages) 91 messages, 9 authors, 2023-10-14

Re: [PATCH net-next v3 3/3] net: phy: add Rust Asix PHY driver

From: Andrew Lunn <andrew@lunn.ch>
Date: 2023-10-09 13:15:32
Also in: rust-for-linux

quoted
+        if ret as u32 & uapi::BMCR_SPEED100 != 0 {
+            dev.set_speed(uapi::SPEED_100);
+        } else {
+            dev.set_speed(uapi::SPEED_10);
+        }
Maybe refactor to only have one `dev.set_speed` call?
This is a common pattern in the C code. This is basically a
re-implementation of

https://elixir.bootlin.com/linux/latest/source/drivers/net/phy/phy_device.c#L2432

because this PHY is broken. Being one of the maintainers of the PHY
subsystem, it helps me review this code if it happens to look like the
existing code it is adding a workaround to.

Is there a Rust reason to only have one call?

   Andrew
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help