Skip to content

Commit 5172046

Browse files
fenrus75gregkh
authored andcommitted
usb: turn dev_warn+WARN_ON combos into dev_WARN
dev_WARN is both compacter and gives better debug information than just a WARN_ON, since people and tools will copy the device information message together with the WARN_ON in bug reports. Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1 parent 728f089 commit 5172046

1 file changed

Lines changed: 8 additions & 16 deletions

File tree

‎drivers/usb/host/uhci-q.c‎

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,10 @@ static struct uhci_td *uhci_alloc_td(struct uhci_hcd *uhci)
123123

124124
static void uhci_free_td(struct uhci_hcd *uhci, struct uhci_td *td)
125125
{
126-
if (!list_empty(&td->list)) {
127-
dev_warn(uhci_dev(uhci), "td %p still in list!\n", td);
128-
WARN_ON(1);
129-
}
130-
if (!list_empty(&td->fl_list)) {
131-
dev_warn(uhci_dev(uhci), "td %p still in fl_list!\n", td);
132-
WARN_ON(1);
133-
}
126+
if (!list_empty(&td->list))
127+
dev_WARN(uhci_dev(uhci), "td %p still in list!\n", td);
128+
if (!list_empty(&td->fl_list))
129+
dev_WARN(uhci_dev(uhci), "td %p still in fl_list!\n", td);
134130

135131
dma_pool_free(uhci->td_pool, td, td->dma_handle);
136132
}
@@ -295,10 +291,8 @@ static struct uhci_qh *uhci_alloc_qh(struct uhci_hcd *uhci,
295291
static void uhci_free_qh(struct uhci_hcd *uhci, struct uhci_qh *qh)
296292
{
297293
WARN_ON(qh->state != QH_STATE_IDLE && qh->udev);
298-
if (!list_empty(&qh->queue)) {
299-
dev_warn(uhci_dev(uhci), "qh %p list not empty!\n", qh);
300-
WARN_ON(1);
301-
}
294+
if (!list_empty(&qh->queue))
295+
dev_WARN(uhci_dev(uhci), "qh %p list not empty!\n", qh);
302296

303297
list_del(&qh->node);
304298
if (qh->udev) {
@@ -746,11 +740,9 @@ static void uhci_free_urb_priv(struct uhci_hcd *uhci,
746740
{
747741
struct uhci_td *td, *tmp;
748742

749-
if (!list_empty(&urbp->node)) {
750-
dev_warn(uhci_dev(uhci), "urb %p still on QH's list!\n",
743+
if (!list_empty(&urbp->node))
744+
dev_WARN(uhci_dev(uhci), "urb %p still on QH's list!\n",
751745
urbp->urb);
752-
WARN_ON(1);
753-
}
754746

755747
list_for_each_entry_safe(td, tmp, &urbp->td_list, list) {
756748
uhci_remove_td_from_urbp(td);

0 commit comments

Comments
 (0)