From: Aaron Conole <aconole@redhat.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [RFC 1/4] enic: update format string to match arg types
Date: Tue, 26 Sep 2017 14:53:26 -0400 [thread overview]
Message-ID: <20170926185329.2776-2-aconole@redhat.com> (raw)
In-Reply-To: <20170926185329.2776-1-aconole@redhat.com>
The argument `index` (and unique_id) is unsigned, but the format
string type used was for signed types.
Signed-off-by: Aaron Conole <aconole@redhat.com>
---
drivers/net/enic/base/vnic_cq.c | 4 ++--
drivers/net/enic/base/vnic_dev.c | 6 +++---
drivers/net/enic/base/vnic_rq.c | 4 ++--
drivers/net/enic/base/vnic_wq.c | 2 +-
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/net/enic/base/vnic_cq.c b/drivers/net/enic/base/vnic_cq.c
index 2f65f35..33db10f 100644
--- a/drivers/net/enic/base/vnic_cq.c
+++ b/drivers/net/enic/base/vnic_cq.c
@@ -65,11 +65,11 @@ int vnic_cq_alloc(struct vnic_dev *vdev, struct vnic_cq *cq, unsigned int index,
cq->ctrl = vnic_dev_get_res(vdev, RES_TYPE_CQ, index);
if (!cq->ctrl) {
- pr_err("Failed to hook CQ[%d] resource\n", index);
+ pr_err("Failed to hook CQ[%u] resource\n", index);
return -EINVAL;
}
- snprintf(res_name, sizeof(res_name), "%d-cq-%d", instance++, index);
+ snprintf(res_name, sizeof(res_name), "%d-cq-%u", instance++, index);
err = vnic_dev_alloc_desc_ring(vdev, &cq->ring, desc_count, desc_size,
socket_id, res_name);
if (err)
diff --git a/drivers/net/enic/base/vnic_dev.c b/drivers/net/enic/base/vnic_dev.c
index 49b3655..808f95b 100644
--- a/drivers/net/enic/base/vnic_dev.c
+++ b/drivers/net/enic/base/vnic_dev.c
@@ -650,7 +650,7 @@ int vnic_dev_stats_dump(struct vnic_dev *vdev, struct vnic_stats **stats)
if (!vdev->stats) {
snprintf((char *)name, sizeof(name),
- "vnic_stats-%d", instance++);
+ "vnic_stats-%u", instance++);
vdev->stats = vdev->alloc_consistent(vdev->priv,
sizeof(struct vnic_stats), &vdev->stats_pa, (u8 *)name);
if (!vdev->stats)
@@ -900,7 +900,7 @@ int vnic_dev_notify_set(struct vnic_dev *vdev, u16 intr)
}
if (!vnic_dev_in_reset(vdev)) {
snprintf((char *)name, sizeof(name),
- "vnic_notify-%d", instance++);
+ "vnic_notify-%u", instance++);
notify_addr = vdev->alloc_consistent(vdev->priv,
sizeof(struct vnic_devcmd_notify),
¬ify_pa, (u8 *)name);
@@ -1150,7 +1150,7 @@ int vnic_dev_classifier(struct vnic_dev *vdev, u8 cmd, u16 *entry,
tlv_size = filter_size + action_size +
2*sizeof(struct filter_tlv);
snprintf((char *)z_name, sizeof(z_name),
- "vnic_clsf_%d", unique_id++);
+ "vnic_clsf_%u", unique_id++);
tlv_va = vdev->alloc_consistent(vdev->priv,
tlv_size, &tlv_pa, (u8 *)z_name);
if (!tlv_va)
diff --git a/drivers/net/enic/base/vnic_rq.c b/drivers/net/enic/base/vnic_rq.c
index 10a40c1..776a6f7 100644
--- a/drivers/net/enic/base/vnic_rq.c
+++ b/drivers/net/enic/base/vnic_rq.c
@@ -58,13 +58,13 @@ int vnic_rq_alloc(struct vnic_dev *vdev, struct vnic_rq *rq, unsigned int index,
rq->ctrl = vnic_dev_get_res(vdev, RES_TYPE_RQ, index);
if (!rq->ctrl) {
- pr_err("Failed to hook RQ[%d] resource\n", index);
+ pr_err("Failed to hook RQ[%u] resource\n", index);
return -EINVAL;
}
vnic_rq_disable(rq);
- snprintf(res_name, sizeof(res_name), "%d-rq-%d", instance++, index);
+ snprintf(res_name, sizeof(res_name), "%d-rq-%u", instance++, index);
rc = vnic_dev_alloc_desc_ring(vdev, &rq->ring, desc_count, desc_size,
rq->socket_id, res_name);
return rc;
diff --git a/drivers/net/enic/base/vnic_wq.c b/drivers/net/enic/base/vnic_wq.c
index 7c4119c..273e3db 100644
--- a/drivers/net/enic/base/vnic_wq.c
+++ b/drivers/net/enic/base/vnic_wq.c
@@ -52,7 +52,7 @@ int vnic_wq_alloc_ring(struct vnic_dev *vdev, struct vnic_wq *wq,
char res_name[NAME_MAX];
static int instance;
- snprintf(res_name, sizeof(res_name), "%d-wq-%d", instance++, wq->index);
+ snprintf(res_name, sizeof(res_name), "%d-wq-%u", instance++, wq->index);
return vnic_dev_alloc_desc_ring(vdev, &wq->ring, desc_count, desc_size,
wq->socket_id, res_name);
}
--
2.9.5
next prev parent reply other threads:[~2017-09-26 18:53 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-26 18:53 [dpdk-dev] [RFC 0/4] misc enic fixes Aaron Conole
2017-09-26 18:53 ` Aaron Conole [this message]
2017-10-10 17:30 ` [dpdk-dev] [RFC 1/4] enic: update format string to match arg types John Daley (johndale)
2017-09-26 18:53 ` [dpdk-dev] [RFC 2/4] enic: fix assignment Aaron Conole
2017-10-10 17:31 ` John Daley (johndale)
2017-09-26 18:53 ` [dpdk-dev] [RFC 3/4] enic: remove unused code Aaron Conole
2017-10-10 17:31 ` John Daley (johndale)
2017-09-26 18:53 ` [dpdk-dev] [RFC 4/4] enic: remove anscillary assignment Aaron Conole
2017-10-10 17:32 ` John Daley (johndale)
2017-10-03 16:16 ` [dpdk-dev] [RFC 0/4] misc enic fixes Ferruh Yigit
2017-10-09 14:00 ` Aaron Conole
2017-10-10 23:06 ` Ferruh Yigit
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=20170926185329.2776-2-aconole@redhat.com \
--to=aconole@redhat.com \
--cc=dev@dpdk.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).