From: Guenter Roeck <linux@roeck-us.net>
To: Sanjeev Sharma <sanjeev_sharma@mentor.com>
Cc: gregkh@linuxfoundation.org, hdegoede@redhat.com,
kraxel@redhat.com, mdharm-usb@one-eyed-alien.net,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-scsi@vger.kernel.org
Subject: Re: [PATCH] uas: replace WARN_ON_ONCE() with assert_spin_locked().
Date: Mon, 11 Aug 2014 11:19:05 -0700 [thread overview]
Message-ID: <20140811181905.GA25727@roeck-us.net> (raw)
In-Reply-To: <1407743966-25325-1-git-send-email-sanjeev_sharma@mentor.com>
On Mon, Aug 11, 2014 at 01:29:26PM +0530, Sanjeev Sharma wrote:
> spin_is_locked() always return false in uniprocessor configuration and therefore it
> would be advise to repalce with assert_spin_locked().
>
> Signed-off-by: Sanjeev Sharma <Sanjeev_Sharma@mentor.com>
> ---
> drivers/usb/storage/uas.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c
> index 3f42785..8e5877d 100644
> --- a/drivers/usb/storage/uas.c
> +++ b/drivers/usb/storage/uas.c
> @@ -154,7 +154,7 @@ static void uas_mark_cmd_dead(struct uas_dev_info *devinfo,
> struct scsi_cmnd *cmnd = container_of(scp, struct scsi_cmnd, SCp);
>
> uas_log_cmd_state(cmnd, caller);
> - WARN_ON_ONCE(!spin_is_locked(&devinfo->lock));
> + assert_spin_locked(&devinfo->lock);
Seems to me that replacing WARN_ON_ONCE (which may be annoying but only
creates a traceback, and only once) with assert_spin_locked (which
crashes the kernel) is a bit drastic.
Guenter
next prev parent reply other threads:[~2014-08-11 18:19 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-11 7:59 [PATCH] uas: replace WARN_ON_ONCE() with assert_spin_locked() Sanjeev Sharma
2014-08-11 8:28 ` Greg KH
2014-08-11 11:56 ` Sharma, Sanjeev
2014-08-11 22:53 ` Greg KH
2014-08-11 18:19 ` Guenter Roeck [this message]
2014-08-11 18:55 ` Hans de Goede
2014-08-11 19:08 ` Guenter Roeck
2014-08-11 19:53 ` Hans de Goede
2014-08-11 18:56 ` Hans de Goede
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=20140811181905.GA25727@roeck-us.net \
--to=linux@roeck-us.net \
--cc=gregkh@linuxfoundation.org \
--cc=hdegoede@redhat.com \
--cc=kraxel@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mdharm-usb@one-eyed-alien.net \
--cc=sanjeev_sharma@mentor.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