usb: dwc3: debug: fix string position formatting mixup with ret and len
authorColin Ian King <colin.king@canonical.com>
Mon, 10 Feb 2020 09:51:39 +0000 (09:51 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 28 Feb 2020 16:22:16 +0000 (17:22 +0100)
commit24aeb16934e8fe02ec1ad9a5975d7a4245bce46d
tree2a71340fb5ee20fe98131505f03e2205e3c2e704
parent6dbf3ea0f56637e35bdad7605a6ef0fbb76863dc
usb: dwc3: debug: fix string position formatting mixup with ret and len

commit b32196e35bd7bbc8038db1aba1fbf022dc469b6a upstream.

Currently the string formatting is mixing up the offset of ret and
len. Re-work the code to use just len, remove ret and use scnprintf
instead of snprintf and len position accumulation where required.
Remove the -ve return check since scnprintf never returns a failure
-ve size. Also break overly long lines to clean up checkpatch
warnings.

Addresses-Coverity: ("Unused value")
Fixes: 1381a5113caf ("usb: dwc3: debug: purge usage of strcat")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200210095139.328711-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc3/debug.h