public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@ti.com>
To: Michal Nazarewicz <mina86@mina86.com>
Cc: Felipe Balbi <balbi@ti.com>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	<linux-usb@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCHv2] usb: f_fs: replace BUG in dead-code with less serious WARN_ON
Date: Thu, 11 Sep 2014 11:56:38 -0500	[thread overview]
Message-ID: <20140911165638.GE1840@saruman.home> (raw)
In-Reply-To: <xa1tegvi14m6.fsf@mina86.com>

[-- Attachment #1: Type: text/plain, Size: 924 bytes --]

On Thu, Sep 11, 2014 at 06:52:49PM +0200, Michal Nazarewicz wrote:
> Even though the BUG() in __ffs_event_add is a dead-code, it is still
> better to warn rather then crash the system if that code ever gets
> executed.
> 
> Reported-by: Felipe Balbi <balbi@ti.com>
> Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
> ---
>  drivers/usb/gadget/function/f_fs.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> On Wed, Sep 10 2014, Felipe Balbi <balbi@ti.com> wrote:
> > WARN(1, "unknown event type %d\n", type);
> > Then you can drop pr_vdebug();
> 
> True, but the printk call will stay in the binary whereas pr_vdebug is not

not a big deal. I'd rather get a message all the time this triggers.

> included in non-debug builds.  Furthermore, WARN() does not use pr_fmt.

not a big deal either, we will get a stack dump and can easily figure
out where that comes from.

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

      reply	other threads:[~2014-09-11 16:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-10 15:50 [PATCH 1/2] usb: f_fs: refactor and document __ffs_ep0_read_events better Michal Nazarewicz
2014-09-10 15:50 ` [PATCH 2/2] usb: f_fs: replace BUG in dead-code with less serious WARN_ON Michal Nazarewicz
2014-09-10 16:13   ` Felipe Balbi
2014-09-11 16:52     ` [PATCHv2] " Michal Nazarewicz
2014-09-11 16:56       ` Felipe Balbi [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=20140911165638.GE1840@saruman.home \
    --to=balbi@ti.com \
    --cc=dan.carpenter@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mina86@mina86.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