提交 4d7ebed6 编写于 作者: A Andy Shevchenko 提交者: Jakub Kicinski

ice: devlink: use %*phD to print small buffer

Use %*phD format to print small buffer as hex string.
Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: NJacob Keller <jacob.e.keller@intel.com>
Tested-by: NJacob Keller <jacob.e.keller@intel.com>
Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: NJakub Kicinski <kuba@kernel.org>
上级 5d3b8ec9
......@@ -13,9 +13,7 @@ static int ice_info_get_dsn(struct ice_pf *pf, char *buf, size_t len)
/* Copy the DSN into an array in Big Endian format */
put_unaligned_be64(pci_get_dsn(pf->pdev), dsn);
snprintf(buf, len, "%02x-%02x-%02x-%02x-%02x-%02x-%02x-%02x",
dsn[0], dsn[1], dsn[2], dsn[3],
dsn[4], dsn[5], dsn[6], dsn[7]);
snprintf(buf, len, "%8phD", dsn);
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册