Message ID | 1542024784-62272-4-git-send-email-liuyixian@huawei.com (mailing list archive) |
---|---|
State | Rejected |
Headers | show |
Series | RDMA/hns: Some updates for hip08 | expand |
On Mon, Nov 12, 2018 at 08:13:04PM +0800, Yixian Liu wrote: > This patch fixed the warnings reported by fortify. > > Signed-off-by: Yixian Liu <liuyixian@huawei.com> > drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c > index d02fe04..e465556 100644 > +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c > @@ -4549,7 +4549,7 @@ static irqreturn_t hns_roce_v2_msix_interrupt_eq(int irq, void *eq_ptr) > /* Asychronous event interrupt */ > int_work = hns_roce_v2_aeq_int(hr_dev, eq); > > - return IRQ_RETVAL(int_work); > + return (unsigned int)IRQ_RETVAL(int_work); > } This doesn't seem right at all IRQ_RETVAL is supposed to return irqreturn_t Surely something is wrong with your tools if the ternary is thought to return some other type?? Jason
On 2018/11/15 7:57, Jason Gunthorpe wrote: > On Mon, Nov 12, 2018 at 08:13:04PM +0800, Yixian Liu wrote: >> This patch fixed the warnings reported by fortify. >> >> Signed-off-by: Yixian Liu <liuyixian@huawei.com> >> drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c >> index d02fe04..e465556 100644 >> +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c >> @@ -4549,7 +4549,7 @@ static irqreturn_t hns_roce_v2_msix_interrupt_eq(int irq, void *eq_ptr) >> /* Asychronous event interrupt */ >> int_work = hns_roce_v2_aeq_int(hr_dev, eq); >> >> - return IRQ_RETVAL(int_work); >> + return (unsigned int)IRQ_RETVAL(int_work); >> } > > This doesn't seem right at all IRQ_RETVAL is supposed to return > irqreturn_t > > Surely something is wrong with your tools if the ternary is thought to > return some other type?? > > Jason Hi, Jason. You are right. I have checked with our tool team and this warning is unnecessary. I will withdraw this patch from the patch set.
diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c index d02fe04..e465556 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c @@ -4549,7 +4549,7 @@ static irqreturn_t hns_roce_v2_msix_interrupt_eq(int irq, void *eq_ptr) /* Asychronous event interrupt */ int_work = hns_roce_v2_aeq_int(hr_dev, eq); - return IRQ_RETVAL(int_work); + return (unsigned int)IRQ_RETVAL(int_work); } static irqreturn_t hns_roce_v2_msix_interrupt_abn(int irq, void *dev_id) @@ -4608,7 +4608,7 @@ static irqreturn_t hns_roce_v2_msix_interrupt_abn(int irq, void *dev_id) } else dev_err(dev, "There is no abnormal irq found!\n"); - return IRQ_RETVAL(int_work); + return (unsigned int)IRQ_RETVAL(int_work); } static void hns_roce_v2_int_mask_enable(struct hns_roce_dev *hr_dev,
This patch fixed the warnings reported by fortify. Signed-off-by: Yixian Liu <liuyixian@huawei.com> --- drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)