On Wed, Sep 09, 2020 at 04:57:27PM +0800, Weihang Li wrote: > From: Lang Cheng <chenglang@xxxxxxxxxx> > > roce_get_field() and roce_set_field() are only used to set variables in > type of __le32, add checks for type to avoid inappropriate assignments. > > Signed-off-by: Lang Cheng <chenglang@xxxxxxxxxx> > Signed-off-by: Weihang Li <liweihang@xxxxxxxxxx> > --- > drivers/infiniband/hw/hns/hns_roce_common.h | 14 ++++++++------ > 1 file changed, 8 insertions(+), 6 deletions(-) I'm skeptical this actually works. __le32 and u32 are the same thing unless using sparse, and sparse will already catch mis-uses as-is. Jason