summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2012-11-25 00:05:15 +0100
committerMarcel Holtmann <marcel@holtmann.org>2012-11-25 00:05:15 +0100
commit535e16c8a4295b039563ad55b43403331be6dea9 (patch)
treedf513472a0bfbb300d41601689674f1f6b4c981b
parent7feb9e2711711c3d86be2b15090b5cc4252788eb (diff)
qmimodem: Fix debug printing of messages
-rw-r--r--drivers/qmimodem/qmi.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/qmimodem/qmi.c b/drivers/qmimodem/qmi.c
index b7b6198e..566242d5 100644
--- a/drivers/qmimodem/qmi.c
+++ b/drivers/qmimodem/qmi.c
@@ -444,6 +444,7 @@ static void __debug_msg(const char dir, const void *buf, size_t len,
const void *ptr;
uint16_t offset;
char strbuf[72 + 16], *str;
+ bool pending_print = false;
if (!function || !len)
return;
@@ -547,17 +548,21 @@ static void __debug_msg(const char dir, const void *buf, size_t len,
tlv_length);
}
- if (str - strbuf > 72) {
+ if (str - strbuf > 60) {
function(strbuf, user_data);
str = strbuf;
str += sprintf(str, " ");
- }
+
+ pending_print = false;
+ } else
+ pending_print = true;
offset += QMI_TLV_HDR_SIZE + tlv_length;
}
- function(strbuf, user_data);
+ if (pending_print)
+ function(strbuf, user_data);
}
static void __debug_device(struct qmi_device *device,