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)
committerFelipe Balbi <balbi@kernel.org>
Tue, 11 Feb 2020 06:45:45 +0000 (08:45 +0200)
commit42cd5ffe46c1037d5d9a253c72e71a024a7bfbef
tree366848ad89d2ed2774f94fd37aedf8336faf4c85
parente4bfded56cf39b8d02733c1e6ef546b97961e18a
usb: dwc3: debug: fix string position formatting mixup with ret and len

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")
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
drivers/usb/dwc3/debug.h