diff mbox series

[[RFC] iproute2-next] rdma: Add the prefix for driver attributes

Message ID 1550924998-34099-1-git-send-email-oulijun@huawei.com (mailing list archive)
State Not Applicable
Headers show
Series [[RFC] iproute2-next] rdma: Add the prefix for driver attributes | expand

Commit Message

Lijun Ou Feb. 23, 2019, 12:29 p.m. UTC
We need to increase the prefix named drv_ to
distinguish whether the attribute is from
IB/core or the driver attribute.

Signed-off-by: Lijun Ou <oulijun@huawei.com>
---
 rdma/utils.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

Comments

Leon Romanovsky Feb. 24, 2019, 9:46 a.m. UTC | #1
On Sat, Feb 23, 2019 at 08:29:58PM +0800, Lijun Ou wrote:
> We need to increase the prefix named drv_ to
> distinguish whether the attribute is from
> IB/core or the driver attribute.
>
> Signed-off-by: Lijun Ou <oulijun@huawei.com>
> ---
>  rdma/utils.c | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)

I'm completely fin with idea, but you should change JSON prints too.

Thanks
diff mbox series

Patch

diff --git a/rdma/utils.c b/rdma/utils.c
index 069d44f..8890981 100644
--- a/rdma/utils.c
+++ b/rdma/utils.c
@@ -720,7 +720,7 @@  static int print_driver_string(struct rd *rd, const char *key_str,
 		jsonw_string_field(rd->jw, key_str, val_str);
 		return 0;
 	} else {
-		return pr_out("%s %s ", key_str, val_str);
+		return pr_out("drv_%s %s ", key_str, val_str);
 	}
 }
 
@@ -733,9 +733,9 @@  static int print_driver_s32(struct rd *rd, const char *key_str, int32_t val,
 	}
 	switch (print_type) {
 	case RDMA_NLDEV_PRINT_TYPE_UNSPEC:
-		return pr_out("%s %d ", key_str, val);
+		return pr_out("drv_%s %d ", key_str, val);
 	case RDMA_NLDEV_PRINT_TYPE_HEX:
-		return pr_out("%s 0x%x ", key_str, val);
+		return pr_out("drv_%s 0x%x ", key_str, val);
 	default:
 		return -EINVAL;
 	}
@@ -750,9 +750,9 @@  static int print_driver_u32(struct rd *rd, const char *key_str, uint32_t val,
 	}
 	switch (print_type) {
 	case RDMA_NLDEV_PRINT_TYPE_UNSPEC:
-		return pr_out("%s %u ", key_str, val);
+		return pr_out("drv_%s %u ", key_str, val);
 	case RDMA_NLDEV_PRINT_TYPE_HEX:
-		return pr_out("%s 0x%x ", key_str, val);
+		return pr_out("drv_%s 0x%x ", key_str, val);
 	default:
 		return -EINVAL;
 	}
@@ -767,9 +767,9 @@  static int print_driver_s64(struct rd *rd, const char *key_str, int64_t val,
 	}
 	switch (print_type) {
 	case RDMA_NLDEV_PRINT_TYPE_UNSPEC:
-		return pr_out("%s %" PRId64 " ", key_str, val);
+		return pr_out("drv_%s %" PRId64 " ", key_str, val);
 	case RDMA_NLDEV_PRINT_TYPE_HEX:
-		return pr_out("%s 0x%" PRIx64 " ", key_str, val);
+		return pr_out("drv_%s 0x%" PRIx64 " ", key_str, val);
 	default:
 		return -EINVAL;
 	}
@@ -784,9 +784,9 @@  static int print_driver_u64(struct rd *rd, const char *key_str, uint64_t val,
 	}
 	switch (print_type) {
 	case RDMA_NLDEV_PRINT_TYPE_UNSPEC:
-		return pr_out("%s %" PRIu64 " ", key_str, val);
+		return pr_out("drv_%s %" PRIu64 " ", key_str, val);
 	case RDMA_NLDEV_PRINT_TYPE_HEX:
-		return pr_out("%s 0x%" PRIx64 " ", key_str, val);
+		return pr_out("drv_%s 0x%" PRIx64 " ", key_str, val);
 	default:
 		return -EINVAL;
 	}