提交 8248f477 编写于 作者: Y Yunsheng Lin 提交者: Xie XiuQi

net: hns3: add a 'U' type after integer literals for a macro

driver inclusion
category: bugfix
bugzilla: NA
CVE: NA

Integer literals in C code are always of the type int, and macro
HCLGE_BUF_SIZE_UNIT is used in roundup to calculate aligned
value for hardware's SSU(storage switching unit) buffer allocation,
which has signed-unsigned mix with divide warning detected by
static checker, bacause hdev->mps is a u32 type.

This patch add 'U' after the integer literal to remove the warning.

Feature or Bugfix:Bugfix
Signed-off-by: NYunsheng Lin <linyunsheng@huawei.com>
Reviewed-by: Nlipeng <lipeng321@huawei.com>
Reviewed-by: NXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 6c02ad73
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#define HCLGE_STATS_READ(p, offset) (*((u64 *)((u8 *)(p) + (offset)))) #define HCLGE_STATS_READ(p, offset) (*((u64 *)((u8 *)(p) + (offset))))
#define HCLGE_MAC_STATS_FIELD_OFF(f) (offsetof(struct hclge_mac_stats, f)) #define HCLGE_MAC_STATS_FIELD_OFF(f) (offsetof(struct hclge_mac_stats, f))
#define HCLGE_BUF_SIZE_UNIT 256 #define HCLGE_BUF_SIZE_UNIT 256U
#define HCLGE_BUF_MUL_BY 2 #define HCLGE_BUF_MUL_BY 2
#define HCLGE_BUF_DIV_BY 2 #define HCLGE_BUF_DIV_BY 2
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册