public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Duncan Sands <baldrick@free.fr>
To: Oliver Neukum <oliver@neukum.org>, Greg KH <greg@kroah.com>
Cc: linux-usb-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org, Frederic Detienne <fd@cisco.com>
Subject: Re: [linux-usb-devel] [PATCH 7/9] USB usbfs: destroy submitted urbs only on the disconnected interface
Date: Thu, 15 Apr 2004 11:21:31 +0200	[thread overview]
Message-ID: <200404151121.31227.baldrick@free.fr> (raw)
In-Reply-To: <200404151108.52351.oliver@neukum.org>

> > The "if" cannot be optimized away for the case in point, because it
> > does something (clears the bit) if it passes the test.  If I used WARN_ON
> > then it would have to be WARN_ON(1) in the else branch of the if.
>
> True. You should use BUG_ON().
>
> If this ever happens the device tree is screwed. There's no use going on.

I'm not sure - isn't it more likely that someone stuffed up in usbfs?  BUG_ON
seems kind of harsh, since it will kill the hub thread.  If it wasn't for that I
wouldn't hesitate to use BUG_ON here.

> > > But there is another point. The embedded people deserve a single switch
> > > to remove assertion checks. The purpose of macros like WARN_ON() is
> > > easy and _central_ choice of debugging output vs. kernel size.
> >
> > This is not an argument against using USB's warn, it is an argument for
> > building warn on top of a centralized macro like WARN_ON or a friend.
>
> It is an argument against USB making its own constructs. There's nothing
> terribly specific about USB that would justify it. If the usual debug
> statements are inadequate, improve them.

I don't see that there is anything wrong with USB using it's own constructs even
if they were just defined to be equal to some centralized macro (as they probably
should be).  In fact there is an advantage: they can be modified for debugging
purposes (to add a backtrace for example) without disturbing the rest of the
kernel.

All the best,

Duncan.

  reply	other threads:[~2004-04-15  9:21 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-14 10:45 [PATCH 7/9] USB usbfs: destroy submitted urbs only on the disconnected interface Duncan Sands
2004-04-14 13:30 ` [linux-usb-devel] " Oliver Neukum
2004-04-14 13:38   ` Duncan Sands
2004-04-14 15:00   ` Duncan Sands
2004-04-14 15:33     ` Oliver Neukum
2004-04-14 15:39       ` Duncan Sands
2004-04-14 20:39         ` Oliver Neukum
2004-04-15  8:05           ` Duncan Sands
2004-04-15  8:31             ` Oliver Neukum
2004-04-15  8:47               ` Duncan Sands
2004-04-15  9:08                 ` Oliver Neukum
2004-04-15  9:21                   ` Duncan Sands [this message]
2004-04-14 16:48 ` Alan Stern
2004-04-14 17:09   ` Duncan Sands
2004-04-14 17:55     ` Alan Stern
2004-04-17 18:31   ` Duncan Sands
2004-04-17 18:53     ` Duncan Sands
2004-04-17 19:52       ` Alan Stern

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=200404151121.31227.baldrick@free.fr \
    --to=baldrick@free.fr \
    --cc=fd@cisco.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb-devel@lists.sourceforge.net \
    --cc=oliver@neukum.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