
From: Chenghai Huang <huangchenghai2@huawei.com> Add parentheses to the input variable. Signed-off-by: Chenghai Huang <huangchenghai2@huawei.com> Signed-off-by: Qi Tao <taoqi10@huawei.com> --- drv/hisi_comp.c | 6 +++--- drv/hisi_comp_huf.c | 2 +- v1/drv/hisi_zip_huf.c | 2 +- v1/drv/hisi_zip_udrv.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drv/hisi_comp.c b/drv/hisi_comp.c index cd558a80..98b45d71 100644 --- a/drv/hisi_comp.c +++ b/drv/hisi_comp.c @@ -69,9 +69,9 @@ #define upper_32_bits(addr) ((__u32)((uintptr_t)(addr) >> HZ_HADDR_SHIFT)) /* the min output buffer size is (input size * 1.125) */ -#define min_out_buf_size(inl) ((((__u64)inl * 9) + 7) >> 3) +#define min_out_buf_size(inl) ((((__u64)(inl) * 9) + 7) >> 3) /* the max input size is (output buffer size * 8 / 9) and align with 4 byte */ -#define max_in_data_size(outl) ((__u32)(((__u64)outl << 3) / 9) & 0xfffffffc) +#define max_in_data_size(outl) ((__u32)(((__u64)(outl) << 3) / 9) & 0xfffffffc) #define HZ_MAX_SIZE (8 * 1024 * 1024) @@ -100,7 +100,7 @@ #define CTX_WIN_LEN_MASK 0xffff #define CTX_HEAD_BIT_CNT_SHIFT 0xa #define CTX_HEAD_BIT_CNT_MASK 0xfC00 -#define WIN_LEN_ALIGN(len) ((len + 15) & ~(__u32)0x0F) +#define WIN_LEN_ALIGN(len) (((len) + 15) & ~(__u32)0x0F) enum alg_type { HW_DEFLATE = 0x1, diff --git a/drv/hisi_comp_huf.c b/drv/hisi_comp_huf.c index 890e54b4..b9c7f258 100644 --- a/drv/hisi_comp_huf.c +++ b/drv/hisi_comp_huf.c @@ -14,7 +14,7 @@ #define EMPTY_STORE_BLOCK_VAL 0xffff0000L #define BLOCK_IS_COMPLETE 1 #define BLOCK_IS_INCOMPLETE 0 -#define LEN_NLEN_CHECK(data) ((data & 0xffff) != ((data >> 16) ^ 0xffff)) +#define LEN_NLEN_CHECK(data) (((data) & 0xffff) != (((data) >> 16) ^ 0xffff)) /* Constants related to the Huffman code table */ #define LIT_LEN_7BIT_THRESHOLD 7 diff --git a/v1/drv/hisi_zip_huf.c b/v1/drv/hisi_zip_huf.c index 3ce270f4..dce9eaf6 100644 --- a/v1/drv/hisi_zip_huf.c +++ b/v1/drv/hisi_zip_huf.c @@ -14,7 +14,7 @@ #define EMPTY_STORE_BLOCK_VAL 0xffff0000L #define HF_BLOCK_IS_COMPLETE 1 #define HF_BLOCK_IS_INCOMPLETE 0 -#define LEN_NLEN_CHECK(data) ((data & 0xffff) != ((data >> 16) ^ 0xffff)) +#define LEN_NLEN_CHECK(data) (((data) & 0xffff) != (((data) >> 16) ^ 0xffff)) /* Constants related to the Huffman code table */ #define LIT_LEN_7BITS_THRESHOLD 7 diff --git a/v1/drv/hisi_zip_udrv.c b/v1/drv/hisi_zip_udrv.c index f2733ad1..ab4254e4 100644 --- a/v1/drv/hisi_zip_udrv.c +++ b/v1/drv/hisi_zip_udrv.c @@ -88,7 +88,7 @@ #define CTX_WIN_LEN_MASK 0xffff #define CTX_HEAD_BIT_CNT_SHIFT 0xa #define CTX_HEAD_BIT_CNT_MASK 0xfC00 -#define WIN_LEN_ALIGN(len) ((len + 15) & ~(__u32)0x0F) +#define WIN_LEN_ALIGN(len) (((len) + 15) & ~(__u32)0x0F) enum { BD_TYPE, -- 2.33.0