From: "Alexey Klimov" <klimov.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: "Oliver Neukum" <oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org>
Cc: "David Brownell"
<david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>,
davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org,
"Greg KH" <greg-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [patch v2] net/usb: remove err() messages in few drivers
Date: Wed, 14 Jan 2009 03:22:26 +0300 [thread overview]
Message-ID: <208cbae30901131622heccfee6uf312022ba1d4fb28@mail.gmail.com> (raw)
In-Reply-To: <200901131207.03724.oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org>
Hello, all
On Tue, Jan 13, 2009 at 2:07 PM, Oliver Neukum <oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org> wrote:
> Am Tuesday 13 January 2009 11:08:27 schrieb Alexey Klimov:
>> On Tue, Jan 13, 2009 at 12:44 PM, David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org> wrote:
>> > On Tuesday 13 January 2009, Oliver Neukum wrote:
>> >> > Ok, i'll reformat patch. Is it okay if i use kaweth->dev->dev,
>> >> > kaweth->net->dev and intf->dev ? Or switch to kaweth->net->dev
>> >> > (instead of dev->dev)?
>> >>
>> >> kaweth in kaweth_disconnect() frees the network device. Therefore
>> >> you cannot use it. You'd access freed memory. Pick one of the others
>> >> and stay with it.
>> >
>> > intf->dev is going to be "obviously correct", the others aren't.
>> >
>>
>> Is this patch touch kaweth_disconnect() ? I see dev_warn and dev_info
>> there. No dev_err.
>
> No, it does not. But you need to make sure that the devices you refer to
> in debug messages are always valid. Functions that you do touch may
> run after disconnect() has run. A debug message that oopses does no good.
> If you cannot make sure you pass a valid device to dev_err/info don't use
> them. It is as simple as that.
Yes, that's obviously right. I'll review and check patch again.
Thank you for your advices.
On Tue, Jan 13, 2009 at 12:46 PM, David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org> wrote:
> On Monday 12 January 2009, Alexey Klimov wrote:
>> - err("submit(rx_urb) status %d", res);
>> + dev_err(&catc->usbdev->dev, "submit(rx_urb) status %d\n", res);
>
>
> That's the same as urb->dev though.
>
> Use the interface passed into probe(): dev_err(&intf->dev, ...) etc
Well, in few v4l-dvb drivers successfully used &radio->usbdev->dev in
debug messages and that doesn't look wrong.
Hmm, i see that struct usb_interface passed to probe function for
example, and here in catc_irq_done struct urb passed, and then we have
struct catc. So, messages based on catc->usbdev->dev. I can switch to
&catc->netdev->dev when it's safe to do, right?
I didn't see way we can use &intv->dev in such functions. Am i wrong ?
In probe functions &intf->dev is right.
Btw, in patch "USB: remove info() macro from usb network drivers"
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=880c9c66a60c0aa4fb4dac2da9679da5f8f41903
few messages based on &urb->dev->dev.
--
Best regards, Klimov Alexey
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2009-01-14 0:22 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-13 0:08 [patch v2] net/usb: remove err() messages in few drivers Alexey Klimov
[not found] ` <1231805322.12962.4.camel-XMdqyYT0w3Zyw3qLyVIJKA@public.gmane.org>
2009-01-13 8:40 ` Oliver Neukum
2009-01-13 8:57 ` Alexey Klimov
2009-01-13 9:25 ` Oliver Neukum
[not found] ` <200901131025.40285.oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org>
2009-01-13 9:44 ` David Brownell
2009-01-13 10:08 ` Alexey Klimov
2009-01-13 11:07 ` Oliver Neukum
[not found] ` <200901131207.03724.oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org>
2009-01-14 0:22 ` Alexey Klimov [this message]
[not found] ` <208cbae30901131622heccfee6uf312022ba1d4fb28-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-01-14 1:05 ` David Brownell
2009-01-14 8:09 ` Oliver Neukum
2009-01-13 9:46 ` David Brownell
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=208cbae30901131622heccfee6uf312022ba1d4fb28@mail.gmail.com \
--to=klimov.linux-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
--cc=david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org \
--cc=greg-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org \
--cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org \
/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 NNTP newsgroup(s).