linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] DMA/qedr: Use true and false for bool variable
@ 2021-02-10  9:38 Jiapeng Chong
  2021-02-10  9:55 ` [EXT] " Michal Kalderon
  2021-02-10 18:21 ` Jason Gunthorpe
  0 siblings, 2 replies; 3+ messages in thread
From: Jiapeng Chong @ 2021-02-10  9:38 UTC (permalink / raw)
  To: mkalderon; +Cc: aelior, dledford, jgg, linux-rdma, linux-kernel, Jiapeng Chong

Fix the following coccicheck warning:

./drivers/infiniband/hw/qedr/qedr.h:629:9-10: WARNING: return of 0/1 in
function 'qedr_qp_has_rq' with return type bool.

./drivers/infiniband/hw/qedr/qedr.h:620:9-10: WARNING: return of 0/1 in
function 'qedr_qp_has_sq' with return type bool.

Reported-by: Abaci Robot<abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 drivers/infiniband/hw/qedr/qedr.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/infiniband/hw/qedr/qedr.h b/drivers/infiniband/hw/qedr/qedr.h
index 9dde703..3cb4feb 100644
--- a/drivers/infiniband/hw/qedr/qedr.h
+++ b/drivers/infiniband/hw/qedr/qedr.h
@@ -617,18 +617,18 @@ static inline bool qedr_qp_has_srq(struct qedr_qp *qp)
 static inline bool qedr_qp_has_sq(struct qedr_qp *qp)
 {
 	if (qp->qp_type == IB_QPT_GSI || qp->qp_type == IB_QPT_XRC_TGT)
-		return 0;
+		return false;
 
-	return 1;
+	return true;
 }
 
 static inline bool qedr_qp_has_rq(struct qedr_qp *qp)
 {
 	if (qp->qp_type == IB_QPT_GSI || qp->qp_type == IB_QPT_XRC_INI ||
 	    qp->qp_type == IB_QPT_XRC_TGT || qedr_qp_has_srq(qp))
-		return 0;
+		return false;
 
-	return 1;
+	return true;
 }
 
 static inline struct qedr_user_mmap_entry *
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [EXT] [PATCH] DMA/qedr: Use true and false for bool variable
  2021-02-10  9:38 [PATCH] DMA/qedr: Use true and false for bool variable Jiapeng Chong
@ 2021-02-10  9:55 ` Michal Kalderon
  2021-02-10 18:21 ` Jason Gunthorpe
  1 sibling, 0 replies; 3+ messages in thread
From: Michal Kalderon @ 2021-02-10  9:55 UTC (permalink / raw)
  To: Jiapeng Chong; +Cc: Ariel Elior, dledford, jgg, linux-rdma, linux-kernel

> From: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> Sent: Wednesday, February 10, 2021 11:38 AM
> 
> ----------------------------------------------------------------------
> Fix the following coccicheck warning:
> 
> ./drivers/infiniband/hw/qedr/qedr.h:629:9-10: WARNING: return of 0/1 in
> function 'qedr_qp_has_rq' with return type bool.
> 
> ./drivers/infiniband/hw/qedr/qedr.h:620:9-10: WARNING: return of 0/1 in
> function 'qedr_qp_has_sq' with return type bool.
> 
> Reported-by: Abaci Robot<abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
>  drivers/infiniband/hw/qedr/qedr.h | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/qedr/qedr.h
> b/drivers/infiniband/hw/qedr/qedr.h
> index 9dde703..3cb4feb 100644
> --- a/drivers/infiniband/hw/qedr/qedr.h
> +++ b/drivers/infiniband/hw/qedr/qedr.h
> @@ -617,18 +617,18 @@ static inline bool qedr_qp_has_srq(struct qedr_qp
> *qp)  static inline bool qedr_qp_has_sq(struct qedr_qp *qp)  {
>  	if (qp->qp_type == IB_QPT_GSI || qp->qp_type ==
> IB_QPT_XRC_TGT)
> -		return 0;
> +		return false;
> 
> -	return 1;
> +	return true;
>  }
> 
>  static inline bool qedr_qp_has_rq(struct qedr_qp *qp)  {
>  	if (qp->qp_type == IB_QPT_GSI || qp->qp_type == IB_QPT_XRC_INI
> ||
>  	    qp->qp_type == IB_QPT_XRC_TGT || qedr_qp_has_srq(qp))
> -		return 0;
> +		return false;
> 
> -	return 1;
> +	return true;
>  }
> 
>  static inline struct qedr_user_mmap_entry *
> --
> 1.8.3.1

Thanks, 

Acked-by: Michal Kalderon <michal.kalderon@marvell.com>



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] DMA/qedr: Use true and false for bool variable
  2021-02-10  9:38 [PATCH] DMA/qedr: Use true and false for bool variable Jiapeng Chong
  2021-02-10  9:55 ` [EXT] " Michal Kalderon
@ 2021-02-10 18:21 ` Jason Gunthorpe
  1 sibling, 0 replies; 3+ messages in thread
From: Jason Gunthorpe @ 2021-02-10 18:21 UTC (permalink / raw)
  To: Jiapeng Chong; +Cc: mkalderon, aelior, dledford, linux-rdma, linux-kernel

On Wed, Feb 10, 2021 at 05:38:21PM +0800, Jiapeng Chong wrote:
> Fix the following coccicheck warning:
> 
> ./drivers/infiniband/hw/qedr/qedr.h:629:9-10: WARNING: return of 0/1 in
> function 'qedr_qp_has_rq' with return type bool.
> 
> ./drivers/infiniband/hw/qedr/qedr.h:620:9-10: WARNING: return of 0/1 in
> function 'qedr_qp_has_sq' with return type bool.
> 
> Reported-by: Abaci Robot<abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> Acked-by: Michal Kalderon <michal.kalderon@marvell.com>
> ---
>  drivers/infiniband/hw/qedr/qedr.h | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

Applied to for-next, thanks

Jason

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-02-10 18:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-10  9:38 [PATCH] DMA/qedr: Use true and false for bool variable Jiapeng Chong
2021-02-10  9:55 ` [EXT] " Michal Kalderon
2021-02-10 18:21 ` Jason Gunthorpe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).