Re: [PATCH rdma-core 5/7] libhns: Fix wrong type of variables and fields
From: Wenpeng Liang <hidden>
Date: 2021-11-24 11:39:41
On 2021/11/23 22:13, Jason Gunthorpe wrote:
On Tue, Nov 09, 2021 at 08:41:01PM +0800, Wenpeng Liang wrote:quoted
From: Xinhao Liu <redacted> Some variables and fields should be in type of unsigned instead of signed. Signed-off-by: Xinhao Liu <redacted> Signed-off-by: Wenpeng Liang <redacted> providers/hns/hns_roce_u.h | 6 +++--- providers/hns/hns_roce_u_hw_v1.c | 6 +++--- providers/hns/hns_roce_u_hw_v2.c | 11 +++++------ 3 files changed, 11 insertions(+), 12 deletions(-)diff --git a/providers/hns/hns_roce_u.h b/providers/hns/hns_roce_u.h index 0d7abd81..d5963941 100644 +++ b/providers/hns/hns_roce_u.h@@ -99,7 +99,7 @@ #define roce_set_bit(origin, shift, val) \ roce_set_field((origin), (1ul << (shift)), (shift), (val)) -#define hr_ilog32(n) ilog32((n) - 1) +#define hr_ilog32(n) ilog32((unsigned int)(n) - 1)This should be a static inline function not a macro, then it can have the correct type. Also please send this series as a PR on the github Thanks, Jason .
I submitted a PR on the github: https://github.com/linux-rdma/rdma-core/pull/1090 Thanks Wenpeng