From: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
To: Armin Schindler <mac@melware.de>, Karsten Keil <isdn@linux-pingi.de>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Nicolas Iooss <nicolas.iooss_linux@m4x.org>
Subject: [PATCH 2/4] isdn/eicon: fix some message formatting errors
Date: Sat, 29 Oct 2016 14:56:03 +0200 [thread overview]
Message-ID: <20161029125605.13610-2-nicolas.iooss_linux@m4x.org> (raw)
In-Reply-To: <20161029125605.13610-1-nicolas.iooss_linux@m4x.org>
There are some inconsistent debug message formats in message.c. For
example,
dprintf("XDI CAPI: RC cancelled Id:0x02, Ch:%02x", e->Id, ch);
wrongly reports an ID of 2 and prints the entity ID as the channel ID.
There are also object pointers which are used instead of the IDs.
All these inconsistent formats have been found by adding __printf
attribute to myDbgPrint_...() functions (used by dbug()). As this makes
the compiler to also complain about using "%ld" with unsigned int values
(instead of "%u") and some other less-important format issues, this
patch does not add any __printf attribute.
This patch has only been compile-tested.
Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
---
drivers/isdn/hardware/eicon/message.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/isdn/hardware/eicon/message.c b/drivers/isdn/hardware/eicon/message.c
index 1a1d99704fe6..7cafa34c3464 100644
--- a/drivers/isdn/hardware/eicon/message.c
+++ b/drivers/isdn/hardware/eicon/message.c
@@ -1059,7 +1059,7 @@ static void plci_remove(PLCI *plci)
}
if (plci->Sig.Id == 0xff)
{
- dbug(1, dprintf("D-channel X.25 plci->NL.Id:%0x", plci->NL.Id));
+ dbug(1, dprintf("D-channel X.25 plci->NL.Id:%02x", plci->NL.Id));
if (plci->NL.Id && !plci->nl_remove_id)
{
nl_req_ncci(plci, REMOVE, 0);
@@ -3109,7 +3109,7 @@ static byte data_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER *a,
Info = _WRONG_IDENTIFIER;
ncci = (word)(Id >> 16);
- dbug(1, dprintf("ncci=0x%x, plci=0x%x", ncci, plci));
+ dbug(1, dprintf("ncci=0x%x, plci=0x%x", ncci, plci->Id));
if (plci && ncci)
{
@@ -3325,7 +3325,7 @@ static byte select_b_req(dword Id, word Number, DIVA_CAPI_ADAPTER *a,
else
{
dbug(1, dprintf("select_b_req[%d],PLCI=0x%x,Tel=0x%x,NL=0x%x,appl=0x%x,sstate=0x%x",
- msg->length, plci->Id, plci->tel, plci->NL.Id, plci->appl, plci->SuppState));
+ msg->length, plci->Id, plci->tel, plci->NL.Id, appl->Id, plci->SuppState));
dbug(1, dprintf("PlciState=0x%x", plci->State));
for (i = 0; i < 7; i++) bp_parms[i].length = 0;
@@ -3910,7 +3910,7 @@ void callback(ENTITY *e)
if (no_cancel_rc && (a->FlowControlIdTable[ch] == e->Id) && e->Id) {
a->FlowControlIdTable[ch] = 0;
if ((rc == OK) && a->FlowControlSkipTable[ch]) {
- dbug(3, dprintf("XDI CAPI: RC cancelled Id:0x02, Ch:%02x", e->Id, ch));
+ dbug(3, dprintf("XDI CAPI: RC cancelled Id:%02x, Ch:%02x", e->Id, ch));
return;
}
}
@@ -9135,7 +9135,7 @@ static word AdvCodecSupport(DIVA_CAPI_ADAPTER *a, PLCI *plci, APPL *appl,
{
if (a->AdvSignalAppl != appl || a->AdvSignalPLCI)
{
- dbug(1, dprintf("AdvSigPlci=0x%x", a->AdvSignalPLCI));
+ dbug(1, dprintf("AdvSigPlci=0x%x", a->AdvSignalPLCI->Id));
return 0x2001; /* codec in use by another application */
}
if (plci != NULL)
--
2.10.1
next prev parent reply other threads:[~2016-10-29 12:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-29 12:56 [PATCH 1/4] isdn/eicon: remove unused argument in DBG_ERR call Nicolas Iooss
2016-10-29 12:56 ` Nicolas Iooss [this message]
2016-10-31 13:42 ` [PATCH 2/4] isdn/eicon: fix some message formatting errors David Laight
2016-10-29 12:56 ` [PATCH 3/4] isdn/eicon: add some __printf attributes Nicolas Iooss
2016-10-29 12:56 ` [PATCH 4/4] isdn/eicon: use const strings with format arguments Nicolas Iooss
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161029125605.13610-2-nicolas.iooss_linux@m4x.org \
--to=nicolas.iooss_linux@m4x.org \
--cc=isdn@linux-pingi.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mac@melware.de \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).