OSDN Git Service

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>
Mon, 10 Feb 2020 19:13:50 +0000 (11:13 -0800)
commitb32196e35bd7bbc8038db1aba1fbf022dc469b6a
tree57775a7010c5bf8a17811d01c190562212d1a5ca
parenta4a601948fc8d0a9661b83df03f5ee11e903efe6
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")
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