Commit 0cc25c6a authored by Hao Chen's avatar Hao Chen Committed by David S. Miller

net: hns3: Align type of some variables with their print type

The c language has a set of implicit type conversions, when
two variables perform bitwise or arithmetic operations.

For example, variable A (type u16/u8) -1, its output is int type variable.
u16/u8 will convert to int type implicitly before it does arithmetic
operations. So, change 1 to unsigned type.
Signed-off-by: default avatarHao Chen <chenhao288@hisilicon.com>
Signed-off-by: default avatarGuangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 114967ad
...@@ -99,7 +99,7 @@ static void hclge_dbg_fill_content(char *content, u16 len, ...@@ -99,7 +99,7 @@ static void hclge_dbg_fill_content(char *content, u16 len,
static char *hclge_dbg_get_func_id_str(char *buf, u8 id) static char *hclge_dbg_get_func_id_str(char *buf, u8 id)
{ {
if (id) if (id)
sprintf(buf, "vf%u", id - 1); sprintf(buf, "vf%u", id - 1U);
else else
sprintf(buf, "pf"); sprintf(buf, "pf");
......
...@@ -6806,7 +6806,7 @@ static int hclge_fd_parse_ring_cookie(struct hclge_dev *hdev, u64 ring_cookie, ...@@ -6806,7 +6806,7 @@ static int hclge_fd_parse_ring_cookie(struct hclge_dev *hdev, u64 ring_cookie,
if (vf > hdev->num_req_vfs) { if (vf > hdev->num_req_vfs) {
dev_err(&hdev->pdev->dev, dev_err(&hdev->pdev->dev,
"Error: vf id (%u) should be less than %u\n", "Error: vf id (%u) should be less than %u\n",
vf - 1, hdev->num_req_vfs); vf - 1U, hdev->num_req_vfs);
return -EINVAL; return -EINVAL;
} }
...@@ -6816,7 +6816,7 @@ static int hclge_fd_parse_ring_cookie(struct hclge_dev *hdev, u64 ring_cookie, ...@@ -6816,7 +6816,7 @@ static int hclge_fd_parse_ring_cookie(struct hclge_dev *hdev, u64 ring_cookie,
if (ring >= tqps) { if (ring >= tqps) {
dev_err(&hdev->pdev->dev, dev_err(&hdev->pdev->dev,
"Error: queue id (%u) > max tqp num (%u)\n", "Error: queue id (%u) > max tqp num (%u)\n",
ring, tqps - 1); ring, tqps - 1U);
return -EINVAL; return -EINVAL;
} }
......
...@@ -181,7 +181,7 @@ static int hclge_get_ring_chain_from_mbx( ...@@ -181,7 +181,7 @@ static int hclge_get_ring_chain_from_mbx(
if (req->msg.param[i].tqp_index >= vport->nic.kinfo.rss_size) { if (req->msg.param[i].tqp_index >= vport->nic.kinfo.rss_size) {
dev_err(&hdev->pdev->dev, "tqp index(%u) is out of range(0-%u)\n", dev_err(&hdev->pdev->dev, "tqp index(%u) is out of range(0-%u)\n",
req->msg.param[i].tqp_index, req->msg.param[i].tqp_index,
vport->nic.kinfo.rss_size - 1); vport->nic.kinfo.rss_size - 1U);
return -EINVAL; return -EINVAL;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment