LKML Archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Slark Xiao <slark_xiao@163.com>
Cc: loic.poulain@linaro.org, ryazanov.s.a@gmail.com,
	johannes@sipsolutions.net, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: Re: [PATCH net] net: wwan: Add net device name for error message print
Date: Sat, 27 Apr 2024 15:22:25 +0200	[thread overview]
Message-ID: <56b839fb-6a69-4dff-b412-1960e98fcbf2@lunn.ch> (raw)
In-Reply-To: <c5a7151.250c.18f1e4425f4.Coremail.slark_xiao@163.com>

> At 2024-04-27 06:21:03, "Andrew Lunn" <andrew@lunn.ch> wrote:
> >>  	if (skb->len < sizeof(struct usb_cdc_ncm_nth16) +
> >>  			sizeof(struct usb_cdc_ncm_ndp16)) {
> >> -		net_err_ratelimited("frame too short\n");
> >> +		net_err_ratelimited("mbim: frame too short\n");
> >
> >I don't know this code at all, but i think you can do
> >
> >dev_err_ratelimited(&mbim->mdev->dev, "frame too short\n");
> >
> >That way, it tells you which of the 42 mhi devices has received too
> >short a frame.
> >
> >      Andrew
> I tried in my case, and it will print:
> mhi_wwan_mbim mhio_IP_HW0_MBIM: frame too short
> 
> I think it's much more complicated, isn't it?

As i said, this is about making it clear which device has problems.
mhio_IP_HW0_MBI is not a particularly good name, but it should be
unique. The question is, is this built into the silicon, and can there
only be one? The name is them pointless.

It is also not too unusual to see drivers define macros

mbim_err_ratelimited(mbin, "frame too short")

	Andrew


      reply	other threads:[~2024-04-27 13:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-26  8:07 [PATCH net] net: wwan: Add net device name for error message print Slark Xiao
2024-04-26  8:39 ` Hariprasad Kelam
2024-04-26 22:21 ` Andrew Lunn
2024-04-27  6:35   ` Slark Xiao
2024-04-27 13:22     ` Andrew Lunn [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56b839fb-6a69-4dff-b412-1960e98fcbf2@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=johannes@sipsolutions.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=loic.poulain@linaro.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=ryazanov.s.a@gmail.com \
    --cc=slark_xiao@163.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).