From: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
To: linux-nfc@lists.01.org
Cc: Jakub Kicinski <kuba@kernel.org>,
"David S . Miller" <davem@davemloft.net>,
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Subject: [linux-nfc] [neard][PATCH 29/34] netlink: use proper format for integers (-Wformat)
Date: Sun, 11 Jul 2021 22:23:46 +0200 [thread overview]
Message-ID: <20210711202351.18363-17-krzysztof.kozlowski@canonical.com> (raw)
In-Reply-To: <20210711202102.18094-1-krzysztof.kozlowski@canonical.com>
Properly print signed and unsigned integers. This fixes warnings like:
src/netlink.c: In function ‘nfc_netlink_event_tm_deactivated’:
./include/near/log.h:45:14: error: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘uint32_t’ {aka ‘unsigned int’} [-Werror=format=]
45 | near_debug("%s:%s() " fmt, \
| ^~~~~~~~~~
src/netlink.c:759:2: note: in expansion of macro ‘DBG’
759 | DBG("%d", idx);
| ^~~
src/netlink.c: In function ‘nfc_netlink_event’:
src/netlink.c:772:54: error: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘__u32’ {aka ‘unsigned int’} [-Werror=format=]
772 | near_error("WARNING: Wrong netlink message sender %d",
| ~^
| |
| int
| %d
773 | src->nl_pid);
| ~~~~~~~~~~~
| |
| __u32 {aka unsigned int}
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
---
src/netlink.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/netlink.c b/src/netlink.c
index 3c77999a05f2..a3b206aeaa88 100644
--- a/src/netlink.c
+++ b/src/netlink.c
@@ -567,7 +567,7 @@ static int get_targets_handler(struct nl_msg *n, void *arg)
iso15693_uid_len = 0;
}
- DBG("target idx %d proto 0x%x sens_res 0x%x sel_res 0x%x NFCID len %d",
+ DBG("target idx %u proto 0x%x sens_res 0x%x sel_res 0x%x NFCID len %d",
target_idx, protocols, sens_res, sel_res, nfcid_len);
DBG("\tiso15693_uid_len %d", iso15693_uid_len);
@@ -607,7 +607,7 @@ static int nfc_netlink_event_targets_found(struct genlmsghdr *gnlh)
adapter_idx = nla_get_u32(attr[NFC_ATTR_DEVICE_INDEX]);
- DBG("adapter %d", adapter_idx);
+ DBG("adapter %u", adapter_idx);
msg = nlmsg_alloc();
if (!msg)
@@ -653,7 +653,7 @@ static int nfc_netlink_event_target_lost(struct genlmsghdr *gnlh)
adapter_idx = nla_get_u32(attr[NFC_ATTR_DEVICE_INDEX]);
target_idx = nla_get_u32(attr[NFC_ATTR_TARGET_INDEX]);
- DBG("adapter %d target %d", adapter_idx, target_idx);
+ DBG("adapter %u target %u", adapter_idx, target_idx);
return __near_adapter_remove_target(adapter_idx, target_idx);
}
@@ -690,7 +690,7 @@ static int nfc_netlink_event_dep_up(struct genlmsghdr *gnlh)
target_idx = nla_get_u32(attrs[NFC_ATTR_TARGET_INDEX]);
- DBG("%d %d", idx, target_idx);
+ DBG("%u %u", idx, target_idx);
return __near_adapter_set_dep_state(idx, true);
} else {
@@ -735,7 +735,7 @@ static int nfc_netlink_event_tm_activated(struct genlmsghdr *gnlh)
idx = nla_get_u32(attrs[NFC_ATTR_DEVICE_INDEX]);
- DBG("%d", idx);
+ DBG("%u", idx);
return __near_adapter_add_device(idx, NULL, 0);
}
@@ -756,7 +756,7 @@ static int nfc_netlink_event_tm_deactivated(struct genlmsghdr *gnlh)
idx = nla_get_u32(attrs[NFC_ATTR_DEVICE_INDEX]);
- DBG("%d", idx);
+ DBG("%u", idx);
return __near_adapter_remove_device(idx);
}
@@ -769,8 +769,8 @@ static int nfc_netlink_event(struct nl_msg *n, void *arg)
DBG("event 0x%x", gnlh->cmd);
if (src->nl_pid) {
- near_error("WARNING: Wrong netlink message sender %d",
- src->nl_pid);
+ near_error("WARNING: Wrong netlink message sender %u",
+ src->nl_pid);
return NL_SKIP;
}
--
2.27.0
_______________________________________________
Linux-nfc mailing list -- linux-nfc@lists.01.org
To unsubscribe send an email to linux-nfc-leave@lists.01.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
next prev parent reply other threads:[~2021-07-11 20:24 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-11 20:20 [linux-nfc] [neard][PATCH 00/34] fixes and improvements for neard (continued) Krzysztof Kozlowski
2021-07-11 20:20 ` [linux-nfc] [neard][PATCH 01/34] Drop empty NEWS Krzysztof Kozlowski
2021-07-11 20:20 ` [linux-nfc] [neard][PATCH 02/34] ci: add building without maintainer options Krzysztof Kozlowski
2021-07-11 20:20 ` [linux-nfc] [neard][PATCH 03/34] ci: be verbose when building Krzysztof Kozlowski
2021-07-11 20:20 ` [linux-nfc] [neard][PATCH 04/34] ci: add more build configurations (Fedora, Alpine, Debian, cross-compile, i386) Krzysztof Kozlowski
2021-07-11 20:20 ` [linux-nfc] [neard][PATCH 05/34] ci: run unit tests Krzysztof Kozlowski
2021-07-11 20:20 ` [linux-nfc] [neard][PATCH 06/34] adapter: adjust indentation of continued arguments Krzysztof Kozlowski
2021-07-11 20:20 ` [linux-nfc] [neard][PATCH 07/34] ci: display printenv Krzysztof Kozlowski
2021-07-11 20:20 ` [linux-nfc] [neard][PATCH 08/34] HACKING: refine required packages Krzysztof Kozlowski
2021-07-11 20:20 ` [linux-nfc] [neard][PATCH 09/34] nciattach: fix poll.h include location Krzysztof Kozlowski
2021-07-11 20:20 ` [linux-nfc] [neard][PATCH 10/34] unit: use proper pointer to uint8_t in test_snep_read_recv_fragments() Krzysztof Kozlowski
2021-07-11 20:20 ` [linux-nfc] [neard][PATCH 11/34] build: fix setting CFLAGS on dash shell (Alpine Linux) Krzysztof Kozlowski
2021-07-11 20:20 ` [linux-nfc] [neard][PATCH 12/34] build: add more compiler warnings Krzysztof Kozlowski
2021-07-11 20:23 ` [linux-nfc] [neard][PATCH 13/34] gdbus: do not shadow global 'pending' variable (-Wshadow) Krzysztof Kozlowski
2021-07-11 20:23 ` [linux-nfc] [neard][PATCH 14/34] nciattach: do not shadow other local 'opt' " Krzysztof Kozlowski
2021-07-11 20:23 ` [linux-nfc] [neard][PATCH 15/34] unit: do not shadow global 'uri' " Krzysztof Kozlowski
2021-07-11 20:23 ` [linux-nfc] [neard][PATCH 16/34] nfctool: use proper format for integers (-Wformat) Krzysztof Kozlowski
2021-07-11 20:23 ` [linux-nfc] [neard][PATCH 17/34] bluetooth: " Krzysztof Kozlowski
2021-07-11 20:23 ` [linux-nfc] [neard][PATCH 18/34] ndef: " Krzysztof Kozlowski
2021-07-11 20:23 ` [linux-nfc] [neard][PATCH 19/34] nfctype2: " Krzysztof Kozlowski
2021-07-11 20:23 ` [linux-nfc] [neard][PATCH 20/34] nfctype3: " Krzysztof Kozlowski
2021-07-11 20:23 ` [linux-nfc] [neard][PATCH 21/34] nfctype5: " Krzysztof Kozlowski
2021-07-11 20:23 ` [linux-nfc] [neard][PATCH 22/34] mifare: " Krzysztof Kozlowski
2021-07-11 20:23 ` [linux-nfc] [neard][PATCH 23/34] p2p: " Krzysztof Kozlowski
2021-07-11 20:23 ` [linux-nfc] [neard][PATCH 24/34] npp: " Krzysztof Kozlowski
2021-07-11 20:23 ` [linux-nfc] [neard][PATCH 25/34] adapter: " Krzysztof Kozlowski
2021-07-11 20:23 ` [linux-nfc] [neard][PATCH 26/34] device: " Krzysztof Kozlowski
2021-07-11 20:23 ` [linux-nfc] [neard][PATCH 27/34] manager: " Krzysztof Kozlowski
2021-07-11 20:23 ` [linux-nfc] [neard][PATCH 28/34] tag: " Krzysztof Kozlowski
2021-07-11 20:23 ` Krzysztof Kozlowski [this message]
2021-07-11 20:23 ` [linux-nfc] [neard][PATCH 30/34] se: " Krzysztof Kozlowski
2021-07-11 20:23 ` [linux-nfc] [neard][PATCH 31/34] ndef: " Krzysztof Kozlowski
2021-07-11 20:23 ` [linux-nfc] [neard][PATCH 32/34] unit: " Krzysztof Kozlowski
2021-07-11 20:23 ` [linux-nfc] [neard][PATCH 33/34] build: enable -Wshadow and -Wformat-signedness compiler warnings Krzysztof Kozlowski
2021-07-11 20:23 ` [linux-nfc] [neard][PATCH 34/34] AUTHORS: Mention Krzysztof Kozlowski's contributions Krzysztof Kozlowski
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=20210711202351.18363-17-krzysztof.kozlowski@canonical.com \
--to=krzysztof.kozlowski@canonical.com \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=linux-nfc@lists.01.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).