On Tue, 7 May 2024 at 12:16, Bjørn Mork <bj...@mork.no> wrote: > > Stijn Tintel <st...@linux-ipv6.be> writes: > > > On 27/04/2024 11:16, Bjørn Mork wrote: > >> st...@linux-ipv6.be writes: > >> > >>> phy_write_paged(phydev, 31, 27, 0x0002); > >>> val = phy_read_paged(phydev, 31, 28); > >> .. > >>> phy_write_paged(phydev, 0x1f, 0x1b, 0x0002); > >>> val = phy_read_paged(phydev, 0x1f, 0x1c); > >> > >> While you're doing spring cleaning.... That piece of cut-n-paste code > >> looks very funny. > >> > > I'd gladly do some more spring cleaning, but what's your actual > > suggestion here? Use hex everywhere instead of mixed hex/base 10? > > I would have used hex since that 0x1f looks like a mask.
We can find out if we look at the function signature: int phy_read_paged(struct phy_device *phydev, int page, u32 regnum); so that's a page, not a mask. Upstream usage is mostly hex, with the icplus phy driver being the sole exception. And unsurprisingly, realtek drivers always use magic numbers, never defines. Can't have other people understand how the hardware works. Best Regards, Jonas _______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel