From: Geyslan G. Bem Date: Tue, 26 Jan 2016 01:44:59 +0000 (-0300) Subject: usb: host: ehci-dbg: use scnprintf() in qh_lines() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=a5355977947dc4da93ac05a72989fecc95bc6dca;p=linux-beck.git usb: host: ehci-dbg: use scnprintf() in qh_lines() 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/host/ehci-dbg.c b/drivers/usb/host/ehci-dbg.c index 980ca55f466a..97a0582849b4 100644 --- a/drivers/usb/host/ehci-dbg.c +++ b/drivers/usb/host/ehci-dbg.c @@ -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, @@ -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;