From patchwork Tue Sep 26 18:53:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Conole X-Patchwork-Id: 29199 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 986BE1B1B4; Tue, 26 Sep 2017 20:53:48 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 1E1781B1B0 for ; Tue, 26 Sep 2017 20:53:45 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 59C5B20B0D for ; Tue, 26 Sep 2017 18:53:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 59C5B20B0D Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=aconole@redhat.com Received: from dhcp-25-97.bos.redhat.com (ovpn-122-85.rdu2.redhat.com [10.10.122.85]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1E08E71C29 for ; Tue, 26 Sep 2017 18:53:42 +0000 (UTC) From: Aaron Conole To: dev@dpdk.org Date: Tue, 26 Sep 2017 14:53:26 -0400 Message-Id: <20170926185329.2776-2-aconole@redhat.com> In-Reply-To: <20170926185329.2776-1-aconole@redhat.com> References: <20170926185329.2776-1-aconole@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 26 Sep 2017 18:53:44 +0000 (UTC) Subject: [dpdk-dev] [RFC 1/4] enic: update format string to match arg types X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The argument `index` (and unique_id) is unsigned, but the format string type used was for signed types. Signed-off-by: Aaron Conole Reviewed-by: John Daley --- 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); }