Skip to contentSkip to conversation

DMA/qedr: Use true and false for bool variable

PATCH Applied Jiapeng Chong 3 participants 3 messages Feb 10, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 DMA/qedr: Use true and false for bool variable

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.

---
 drivers/infiniband/hw/qedr/qedr.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/infiniband/hw/qedr/qedr.h +4 -4
index 9dde703..3cb4feb 100644
@@ -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 *
Signature · 1 line
1.8.3.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 47 lines

From: Jiapeng Chong <[email protected]>
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.

---
 drivers/infiniband/hw/qedr/qedr.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/infiniband/hw/qedr/qedr.h +2 -2
index 9dde703..3cb4feb 100644
@@ -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

||

drivers/infiniband/hw/qedr/qedr.h +2 -3
 	    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 *
--
Quoted 1 line

1.8.3.1

Thanks,

maintainer Applied
#2 lore raw
In reply to Jiapeng Chong
Quoted 8 lines · 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.

Quoted 6 lines
---
 drivers/infiniband/hw/qedr/qedr.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Applied to for-next, thanks

Jason