Re: [PATCH] net: usb: mcs7830: skip zero-length register dump reads

From: Andrew Lunn

Date: Wed Nov 25 2026 - 08:54:50 EST


On Wed, Nov 25, 2026 at 03:16:49PM +0800, YuanZhe Liu wrote:
> mcs7830_get_regs() passes the user-supplied regs->len straight to
> mcs7830_get_reg(), which submits a vendor control-IN request for that
> many bytes. ETHTOOL_GREGS accepts a zero length, and ethtool_get_regs()
> still invokes the driver's get_regs() callback in that case, so a
> zero-byte dump request reaches the driver.

Take a step back. Think about the kAPI. Why pass 0?

I think you are solving the problem in the wrong place. And you are
playing whack-a-mole when there is no need.

Andrew

---
pw-bot: cr