From 8248f4771726e931b3ec8a13f5550f98899619ac Mon Sep 17 00:00:00 2001 From: Yunsheng Lin Date: Sun, 28 Apr 2019 09:24:46 +0800 Subject: [PATCH] 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: Yunsheng Lin Reviewed-by: lipeng Reviewed-by: Xie XiuQi Signed-off-by: Yang Yingliang --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 568bf7241dd9..c63ea4da387b 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -28,7 +28,7 @@ #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_BUF_SIZE_UNIT 256 +#define HCLGE_BUF_SIZE_UNIT 256U #define HCLGE_BUF_MUL_BY 2 #define HCLGE_BUF_DIV_BY 2 -- GitLab