Skip to content

Commit

Permalink
usb: host: ehci-dbg: use scnprintf() in qh_lines()
Browse files Browse the repository at this point in the history
This patch replaces two snprintf() calls with scnprintf() in qh_lines()
and hence removes the unneeded sequential truncation tests.

Signed-off-by: Geyslan G. Bem <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
geyslan authored and gregkh committed Feb 3, 2016
1 parent c2fb017 commit a535597
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions drivers/usb/host/ehci-dbg.c
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ static void qh_lines(
type = "?";
break;
}
temp = snprintf(next, size,
temp = scnprintf(next, size,
"\n\t%p%c%s len=%d %08x urb %p"
" [td %08x buf[0] %08x]",
td, mark, type,
Expand All @@ -493,17 +493,13 @@ static void qh_lines(
td->urb,
(u32) td->qtd_dma,
hc32_to_cpup(ehci, &td->hw_buf[0]));
if (size < temp)
temp = size;
size -= temp;
next += temp;
if (temp == size)
goto done;
}

temp = snprintf(next, size, "\n");
if (size < temp)
temp = size;
temp = scnprintf(next, size, "\n");
size -= temp;
next += temp;

Expand Down

0 comments on commit a535597

Please sign in to comment.