linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] uas: replace WARN_ON_ONCE() with assert_spin_locked().
@ 2014-08-11  7:59 Sanjeev Sharma
  2014-08-11  8:28 ` Greg KH
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Sanjeev Sharma @ 2014-08-11  7:59 UTC (permalink / raw)
  To: gregkh
  Cc: hdegoede, kraxel, mdharm-usb, linux-usb, linux-kernel, linux-scsi,
	Sanjeev Sharma, Sanjeev Sharma

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);
 	WARN_ON_ONCE(cmdinfo->state & COMMAND_ABORTED);
 	cmdinfo->state |= COMMAND_ABORTED;
 	cmdinfo->state &= ~IS_IN_WORK_LIST;
@@ -181,7 +181,7 @@ static void uas_add_work(struct uas_cmd_info *cmdinfo)
 	struct scsi_cmnd *cmnd = container_of(scp, struct scsi_cmnd, SCp);
 	struct uas_dev_info *devinfo = cmnd->device->hostdata;
 
-	WARN_ON_ONCE(!spin_is_locked(&devinfo->lock));
+	assert_spin_locked(&devinfo->lock);
 	cmdinfo->state |= IS_IN_WORK_LIST;
 	schedule_work(&devinfo->work);
 }
@@ -283,7 +283,7 @@ static int uas_try_complete(struct scsi_cmnd *cmnd, const char *caller)
 	struct uas_cmd_info *cmdinfo = (void *)&cmnd->SCp;
 	struct uas_dev_info *devinfo = (void *)cmnd->device->hostdata;
 
-	WARN_ON_ONCE(!spin_is_locked(&devinfo->lock));
+	assert_spin_locked(&devinfo->lock);
 	if (cmdinfo->state & (COMMAND_INFLIGHT |
 			      DATA_IN_URB_INFLIGHT |
 			      DATA_OUT_URB_INFLIGHT |
@@ -622,7 +622,7 @@ static int uas_submit_urbs(struct scsi_cmnd *cmnd,
 	struct urb *urb;
 	int err;
 
-	WARN_ON_ONCE(!spin_is_locked(&devinfo->lock));
+	assert_spin_locked(&devinfo->lock);
 	if (cmdinfo->state & SUBMIT_STATUS_URB) {
 		urb = uas_submit_sense_urb(cmnd, gfp, cmdinfo->stream);
 		if (!urb)
-- 
1.7.11.7

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-08-11 22:53 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-11  7:59 [PATCH] uas: replace WARN_ON_ONCE() with assert_spin_locked() Sanjeev Sharma
2014-08-11  8:28 ` Greg KH
     [not found]   ` <20140811082811.GC1422-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2014-08-11 11:56     ` Sharma, Sanjeev
2014-08-11 22:53       ` Greg KH
2014-08-11 18:19 ` Guenter Roeck
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

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).