public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] RDMA/rxe: Change the return type from int to bool
@ 2025-01-11 10:27 Zhu Yanjun
  2025-01-13  0:53 ` Zhijian Li (Fujitsu)
  2025-01-14 11:47 ` Leon Romanovsky
  0 siblings, 2 replies; 4+ messages in thread
From: Zhu Yanjun @ 2025-01-11 10:27 UTC (permalink / raw)
  To: zyjzyj2000, jgg, leon, linux-rdma; +Cc: Zhu Yanjun

The return type of the functions queue_full and queue_empty should be
bool.

No functional changes.

Fixes: 8700e3e7c485 ("Soft RoCE driver")
Signed-off-by: Zhu Yanjun <yanjun.zhu@linux.dev>
---
 drivers/infiniband/sw/rxe/rxe_cq.c    | 2 +-
 drivers/infiniband/sw/rxe/rxe_queue.h | 4 ++--
 drivers/infiniband/sw/rxe/rxe_verbs.c | 6 +++---
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/infiniband/sw/rxe/rxe_cq.c b/drivers/infiniband/sw/rxe/rxe_cq.c
index fec87c9030ab..a2df55e13ea4 100644
--- a/drivers/infiniband/sw/rxe/rxe_cq.c
+++ b/drivers/infiniband/sw/rxe/rxe_cq.c
@@ -88,7 +88,7 @@ int rxe_cq_resize_queue(struct rxe_cq *cq, int cqe,
 int rxe_cq_post(struct rxe_cq *cq, struct rxe_cqe *cqe, int solicited)
 {
 	struct ib_event ev;
-	int full;
+	bool full;
 	void *addr;
 	unsigned long flags;
 
diff --git a/drivers/infiniband/sw/rxe/rxe_queue.h b/drivers/infiniband/sw/rxe/rxe_queue.h
index c711cb98b949..597e3da469a1 100644
--- a/drivers/infiniband/sw/rxe/rxe_queue.h
+++ b/drivers/infiniband/sw/rxe/rxe_queue.h
@@ -151,7 +151,7 @@ static inline u32 queue_get_consumer(const struct rxe_queue *q,
 	return cons;
 }
 
-static inline int queue_empty(struct rxe_queue *q, enum queue_type type)
+static inline bool queue_empty(struct rxe_queue *q, enum queue_type type)
 {
 	u32 prod = queue_get_producer(q, type);
 	u32 cons = queue_get_consumer(q, type);
@@ -159,7 +159,7 @@ static inline int queue_empty(struct rxe_queue *q, enum queue_type type)
 	return ((prod - cons) & q->index_mask) == 0;
 }
 
-static inline int queue_full(struct rxe_queue *q, enum queue_type type)
+static inline bool queue_full(struct rxe_queue *q, enum queue_type type)
 {
 	u32 prod = queue_get_producer(q, type);
 	u32 cons = queue_get_consumer(q, type);
diff --git a/drivers/infiniband/sw/rxe/rxe_verbs.c b/drivers/infiniband/sw/rxe/rxe_verbs.c
index 8a5fc20fd186..c88140d896c5 100644
--- a/drivers/infiniband/sw/rxe/rxe_verbs.c
+++ b/drivers/infiniband/sw/rxe/rxe_verbs.c
@@ -870,7 +870,7 @@ static int post_one_send(struct rxe_qp *qp, const struct ib_send_wr *ibwr)
 	struct rxe_send_wqe *send_wqe;
 	unsigned int mask;
 	unsigned int length;
-	int full;
+	bool full;
 
 	err = validate_send_wr(qp, ibwr, &mask, &length);
 	if (err)
@@ -960,7 +960,7 @@ static int post_one_recv(struct rxe_rq *rq, const struct ib_recv_wr *ibwr)
 	unsigned long length;
 	struct rxe_recv_wqe *recv_wqe;
 	int num_sge = ibwr->num_sge;
-	int full;
+	bool full;
 	int err;
 
 	full = queue_full(rq->queue, QUEUE_TYPE_FROM_ULP);
@@ -1185,7 +1185,7 @@ static int rxe_req_notify_cq(struct ib_cq *ibcq, enum ib_cq_notify_flags flags)
 {
 	struct rxe_cq *cq = to_rcq(ibcq);
 	int ret = 0;
-	int empty;
+	bool empty;
 	unsigned long irq_flags;
 
 	spin_lock_irqsave(&cq->cq_lock, irq_flags);
-- 
2.34.1


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

* Re: [PATCH 1/1] RDMA/rxe: Change the return type from int to bool
  2025-01-11 10:27 [PATCH 1/1] RDMA/rxe: Change the return type from int to bool Zhu Yanjun
@ 2025-01-13  0:53 ` Zhijian Li (Fujitsu)
  2025-01-14  9:22   ` Zhu Yanjun
  2025-01-14 11:47 ` Leon Romanovsky
  1 sibling, 1 reply; 4+ messages in thread
From: Zhijian Li (Fujitsu) @ 2025-01-13  0:53 UTC (permalink / raw)
  To: Zhu Yanjun, zyjzyj2000@gmail.com, jgg@ziepe.ca, leon@kernel.org,
	linux-rdma@vger.kernel.org



On 11/01/2025 18:27, Zhu Yanjun wrote:
> The return type of the functions queue_full and queue_empty should be
> bool.
> 
> No functional changes.
> 
> Fixes: 8700e3e7c485 ("Soft RoCE driver")
> Signed-off-by: Zhu Yanjun <yanjun.zhu@linux.dev>

Looks good to me

Reviewed-by: Li Zhijian <lizhijian@fujitsu.com>


> ---
>   drivers/infiniband/sw/rxe/rxe_cq.c    | 2 +-
>   drivers/infiniband/sw/rxe/rxe_queue.h | 4 ++--
>   drivers/infiniband/sw/rxe/rxe_verbs.c | 6 +++---
>   3 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/infiniband/sw/rxe/rxe_cq.c b/drivers/infiniband/sw/rxe/rxe_cq.c
> index fec87c9030ab..a2df55e13ea4 100644
> --- a/drivers/infiniband/sw/rxe/rxe_cq.c
> +++ b/drivers/infiniband/sw/rxe/rxe_cq.c
> @@ -88,7 +88,7 @@ int rxe_cq_resize_queue(struct rxe_cq *cq, int cqe,
>   int rxe_cq_post(struct rxe_cq *cq, struct rxe_cqe *cqe, int solicited)
>   {
>   	struct ib_event ev;
> -	int full;
> +	bool full;
>   	void *addr;
>   	unsigned long flags;
>   
> diff --git a/drivers/infiniband/sw/rxe/rxe_queue.h b/drivers/infiniband/sw/rxe/rxe_queue.h
> index c711cb98b949..597e3da469a1 100644
> --- a/drivers/infiniband/sw/rxe/rxe_queue.h
> +++ b/drivers/infiniband/sw/rxe/rxe_queue.h
> @@ -151,7 +151,7 @@ static inline u32 queue_get_consumer(const struct rxe_queue *q,
>   	return cons;
>   }
>   
> -static inline int queue_empty(struct rxe_queue *q, enum queue_type type)
> +static inline bool queue_empty(struct rxe_queue *q, enum queue_type type)
>   {
>   	u32 prod = queue_get_producer(q, type);
>   	u32 cons = queue_get_consumer(q, type);
> @@ -159,7 +159,7 @@ static inline int queue_empty(struct rxe_queue *q, enum queue_type type)
>   	return ((prod - cons) & q->index_mask) == 0;
>   }
>   
> -static inline int queue_full(struct rxe_queue *q, enum queue_type type)
> +static inline bool queue_full(struct rxe_queue *q, enum queue_type type)
>   {
>   	u32 prod = queue_get_producer(q, type);
>   	u32 cons = queue_get_consumer(q, type);
> diff --git a/drivers/infiniband/sw/rxe/rxe_verbs.c b/drivers/infiniband/sw/rxe/rxe_verbs.c
> index 8a5fc20fd186..c88140d896c5 100644
> --- a/drivers/infiniband/sw/rxe/rxe_verbs.c
> +++ b/drivers/infiniband/sw/rxe/rxe_verbs.c
> @@ -870,7 +870,7 @@ static int post_one_send(struct rxe_qp *qp, const struct ib_send_wr *ibwr)
>   	struct rxe_send_wqe *send_wqe;
>   	unsigned int mask;
>   	unsigned int length;
> -	int full;
> +	bool full;
>   
>   	err = validate_send_wr(qp, ibwr, &mask, &length);
>   	if (err)
> @@ -960,7 +960,7 @@ static int post_one_recv(struct rxe_rq *rq, const struct ib_recv_wr *ibwr)
>   	unsigned long length;
>   	struct rxe_recv_wqe *recv_wqe;
>   	int num_sge = ibwr->num_sge;
> -	int full;
> +	bool full;
>   	int err;
>   
>   	full = queue_full(rq->queue, QUEUE_TYPE_FROM_ULP);
> @@ -1185,7 +1185,7 @@ static int rxe_req_notify_cq(struct ib_cq *ibcq, enum ib_cq_notify_flags flags)
>   {
>   	struct rxe_cq *cq = to_rcq(ibcq);
>   	int ret = 0;
> -	int empty;
> +	bool empty;
>   	unsigned long irq_flags;
>   
>   	spin_lock_irqsave(&cq->cq_lock, irq_flags);

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

* Re: [PATCH 1/1] RDMA/rxe: Change the return type from int to bool
  2025-01-13  0:53 ` Zhijian Li (Fujitsu)
@ 2025-01-14  9:22   ` Zhu Yanjun
  0 siblings, 0 replies; 4+ messages in thread
From: Zhu Yanjun @ 2025-01-14  9:22 UTC (permalink / raw)
  To: Zhijian Li (Fujitsu), zyjzyj2000@gmail.com, jgg@ziepe.ca,
	leon@kernel.org, linux-rdma@vger.kernel.org

On 13.01.25 01:53, Zhijian Li (Fujitsu) wrote:
> 
> 
> On 11/01/2025 18:27, Zhu Yanjun wrote:
>> The return type of the functions queue_full and queue_empty should be
>> bool.
>>
>> No functional changes.
>>
>> Fixes: 8700e3e7c485 ("Soft RoCE driver")
>> Signed-off-by: Zhu Yanjun <yanjun.zhu@linux.dev>
> 
> Looks good to me

Thanks for your code review.

Zhu Yanjun

> 
> Reviewed-by: Li Zhijian <lizhijian@fujitsu.com>
> 
> 
>> ---
>>    drivers/infiniband/sw/rxe/rxe_cq.c    | 2 +-
>>    drivers/infiniband/sw/rxe/rxe_queue.h | 4 ++--
>>    drivers/infiniband/sw/rxe/rxe_verbs.c | 6 +++---
>>    3 files changed, 6 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/infiniband/sw/rxe/rxe_cq.c b/drivers/infiniband/sw/rxe/rxe_cq.c
>> index fec87c9030ab..a2df55e13ea4 100644
>> --- a/drivers/infiniband/sw/rxe/rxe_cq.c
>> +++ b/drivers/infiniband/sw/rxe/rxe_cq.c
>> @@ -88,7 +88,7 @@ int rxe_cq_resize_queue(struct rxe_cq *cq, int cqe,
>>    int rxe_cq_post(struct rxe_cq *cq, struct rxe_cqe *cqe, int solicited)
>>    {
>>    	struct ib_event ev;
>> -	int full;
>> +	bool full;
>>    	void *addr;
>>    	unsigned long flags;
>>    
>> diff --git a/drivers/infiniband/sw/rxe/rxe_queue.h b/drivers/infiniband/sw/rxe/rxe_queue.h
>> index c711cb98b949..597e3da469a1 100644
>> --- a/drivers/infiniband/sw/rxe/rxe_queue.h
>> +++ b/drivers/infiniband/sw/rxe/rxe_queue.h
>> @@ -151,7 +151,7 @@ static inline u32 queue_get_consumer(const struct rxe_queue *q,
>>    	return cons;
>>    }
>>    
>> -static inline int queue_empty(struct rxe_queue *q, enum queue_type type)
>> +static inline bool queue_empty(struct rxe_queue *q, enum queue_type type)
>>    {
>>    	u32 prod = queue_get_producer(q, type);
>>    	u32 cons = queue_get_consumer(q, type);
>> @@ -159,7 +159,7 @@ static inline int queue_empty(struct rxe_queue *q, enum queue_type type)
>>    	return ((prod - cons) & q->index_mask) == 0;
>>    }
>>    
>> -static inline int queue_full(struct rxe_queue *q, enum queue_type type)
>> +static inline bool queue_full(struct rxe_queue *q, enum queue_type type)
>>    {
>>    	u32 prod = queue_get_producer(q, type);
>>    	u32 cons = queue_get_consumer(q, type);
>> diff --git a/drivers/infiniband/sw/rxe/rxe_verbs.c b/drivers/infiniband/sw/rxe/rxe_verbs.c
>> index 8a5fc20fd186..c88140d896c5 100644
>> --- a/drivers/infiniband/sw/rxe/rxe_verbs.c
>> +++ b/drivers/infiniband/sw/rxe/rxe_verbs.c
>> @@ -870,7 +870,7 @@ static int post_one_send(struct rxe_qp *qp, const struct ib_send_wr *ibwr)
>>    	struct rxe_send_wqe *send_wqe;
>>    	unsigned int mask;
>>    	unsigned int length;
>> -	int full;
>> +	bool full;
>>    
>>    	err = validate_send_wr(qp, ibwr, &mask, &length);
>>    	if (err)
>> @@ -960,7 +960,7 @@ static int post_one_recv(struct rxe_rq *rq, const struct ib_recv_wr *ibwr)
>>    	unsigned long length;
>>    	struct rxe_recv_wqe *recv_wqe;
>>    	int num_sge = ibwr->num_sge;
>> -	int full;
>> +	bool full;
>>    	int err;
>>    
>>    	full = queue_full(rq->queue, QUEUE_TYPE_FROM_ULP);
>> @@ -1185,7 +1185,7 @@ static int rxe_req_notify_cq(struct ib_cq *ibcq, enum ib_cq_notify_flags flags)
>>    {
>>    	struct rxe_cq *cq = to_rcq(ibcq);
>>    	int ret = 0;
>> -	int empty;
>> +	bool empty;
>>    	unsigned long irq_flags;
>>    
>>    	spin_lock_irqsave(&cq->cq_lock, irq_flags);


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

* Re: [PATCH 1/1] RDMA/rxe: Change the return type from int to bool
  2025-01-11 10:27 [PATCH 1/1] RDMA/rxe: Change the return type from int to bool Zhu Yanjun
  2025-01-13  0:53 ` Zhijian Li (Fujitsu)
@ 2025-01-14 11:47 ` Leon Romanovsky
  1 sibling, 0 replies; 4+ messages in thread
From: Leon Romanovsky @ 2025-01-14 11:47 UTC (permalink / raw)
  To: Zhu Yanjun; +Cc: zyjzyj2000, jgg, linux-rdma

On Sat, Jan 11, 2025 at 11:27:58AM +0100, Zhu Yanjun wrote:
> The return type of the functions queue_full and queue_empty should be
> bool.
> 
> No functional changes.
> 
> Fixes: 8700e3e7c485 ("Soft RoCE driver")
> Signed-off-by: Zhu Yanjun <yanjun.zhu@linux.dev>
> ---
>  drivers/infiniband/sw/rxe/rxe_cq.c    | 2 +-
>  drivers/infiniband/sw/rxe/rxe_queue.h | 4 ++--
>  drivers/infiniband/sw/rxe/rxe_verbs.c | 6 +++---
>  3 files changed, 6 insertions(+), 6 deletions(-)

Let's not do change just for the sake of change.
This standalone patch has zero effect on the code, both from functionality
and readability point of views.

Thanks

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

end of thread, other threads:[~2025-01-14 11:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-11 10:27 [PATCH 1/1] RDMA/rxe: Change the return type from int to bool Zhu Yanjun
2025-01-13  0:53 ` Zhijian Li (Fujitsu)
2025-01-14  9:22   ` Zhu Yanjun
2025-01-14 11:47 ` Leon Romanovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox