Re: [PATCH net v3] net: usb: asix: reject a truncated Data header in rx_fixup

From: Andy Shevchenko

Date: Wed Sep 16 2026 - 05:54:56 EST


On Wed, Sep 16, 2026 at 09:19:13AM +0100, Aamir Ahmed wrote:
> On Wed, Sep 16, 2026 at 09:50:21AM +0300, Andy Shevchenko wrote:

...

> > I don't know the rules about __func__ in the error messages in net, but above
> > may be simplified as
> >
> > netdev_err(dev->net, "%s(): Short Data header, offset %d, len %d\n",
> > __func__, offset, skb->len);
>
> I've based the error messages on others I found in this function, here
> are some examples:
>
> netdev_err(dev->net, "asix_rx_fixup() Data Header synchronisation was lost, remaining %d\n", ...);
> netdev_err(dev->net, "asix_rx_fixup() Bad Header Length 0x%x, offset %d\n", ...);
> netdev_dbg(dev->net, "asix_rx_fixup() Bad RX Length %d\n", ...);
> netdev_err(dev->net, "asix_rx_fixup() Bad SKB Length %d, %d\n", ...);
>
> __func__ here expands to asix_rx_fixup_internal, the internal helper
> rather than the asix_rx_fixup() the others name.

Yes, and current state of affairs is confusing. If this is _internal() helper,
it should either take a name as a parameter, or use __func__, or ideally drop
it altogether and make error messages to be unique enough that one may easily
guess where the problem came from.

But okay, since it's a common style this discussion and possible amendment is
for another patch.

--
With Best Regards,
Andy Shevchenko