ipioam6: use print_nl instead of print_null
This patch addresses Stephen's comment: """ > + print_null(PRINT_ANY, "", "\n", NULL); Use print_nl() since it handles the case of oneline output. Plus in JSON the newline is meaningless. """ It also removes two useless print_null's. Signed-off-by: Justin Iurman <justin.iurman@uliege.be> Signed-off-by: David Ahern <dsahern@kernel.org>
This commit is contained in:
parent
7e7270bb1f
commit
df8912ede2
12
ip/ipioam6.c
12
ip/ipioam6.c
|
|
@ -62,19 +62,15 @@ static void print_namespace(struct rtattr *attrs[])
|
||||||
print_uint(PRINT_ANY, "schema", " [schema %u]",
|
print_uint(PRINT_ANY, "schema", " [schema %u]",
|
||||||
rta_getattr_u32(attrs[IOAM6_ATTR_SC_ID]));
|
rta_getattr_u32(attrs[IOAM6_ATTR_SC_ID]));
|
||||||
|
|
||||||
if (!attrs[IOAM6_ATTR_NS_DATA])
|
if (attrs[IOAM6_ATTR_NS_DATA])
|
||||||
print_null(PRINT_ANY, "data", "", NULL);
|
|
||||||
else
|
|
||||||
print_hex(PRINT_ANY, "data", ", data %#010x",
|
print_hex(PRINT_ANY, "data", ", data %#010x",
|
||||||
rta_getattr_u32(attrs[IOAM6_ATTR_NS_DATA]));
|
rta_getattr_u32(attrs[IOAM6_ATTR_NS_DATA]));
|
||||||
|
|
||||||
if (!attrs[IOAM6_ATTR_NS_DATA_WIDE])
|
if (attrs[IOAM6_ATTR_NS_DATA_WIDE])
|
||||||
print_null(PRINT_ANY, "wide", "", NULL);
|
|
||||||
else
|
|
||||||
print_0xhex(PRINT_ANY, "wide", ", wide %#018lx",
|
print_0xhex(PRINT_ANY, "wide", ", wide %#018lx",
|
||||||
rta_getattr_u64(attrs[IOAM6_ATTR_NS_DATA_WIDE]));
|
rta_getattr_u64(attrs[IOAM6_ATTR_NS_DATA_WIDE]));
|
||||||
|
|
||||||
print_null(PRINT_ANY, "", "\n", NULL);
|
print_nl();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void print_schema(struct rtattr *attrs[])
|
static void print_schema(struct rtattr *attrs[])
|
||||||
|
|
@ -97,7 +93,7 @@ static void print_schema(struct rtattr *attrs[])
|
||||||
print_hhu(PRINT_ANY, "", " %02x", data[i]);
|
print_hhu(PRINT_ANY, "", " %02x", data[i]);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
print_null(PRINT_ANY, "", "\n", NULL);
|
print_nl();
|
||||||
}
|
}
|
||||||
|
|
||||||
static int process_msg(struct nlmsghdr *n, void *arg)
|
static int process_msg(struct nlmsghdr *n, void *arg)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue