net/enic: update format string to match arg types
authorAaron Conole <aconole@redhat.com>
Tue, 26 Sep 2017 18:53:26 +0000 (14:53 -0400)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 12 Oct 2017 00:52:49 +0000 (01:52 +0100)
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>
Reviewed-by: John Daley <johndale@cisco.com>
drivers/net/enic/base/vnic_cq.c
drivers/net/enic/base/vnic_dev.c
drivers/net/enic/base/vnic_rq.c
drivers/net/enic/base/vnic_wq.c

index 2f65f35..33db10f 100644 (file)
@@ -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)
index 162e9c2..da8a464 100644 (file)
@@ -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),
                        &notify_pa, (u8 *)name);
@@ -1156,7 +1156,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)
index 10a40c1..776a6f7 100644 (file)
@@ -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;
index 7c4119c..273e3db 100644 (file)
@@ -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);
 }