mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] RDMA/bng_re: Remove unused variable rc
@ 2026-05-05  8:57 Rohit Chavan
  2026-05-07 10:22 ` Siva Reddy Kallam
  2026-05-13 15:13 ` Leon Romanovsky
  0 siblings, 2 replies; 3+ messages in thread
From: Rohit Chavan @ 2026-05-05  8:57 UTC (permalink / raw)
  To: siva.kallam, Jason Gunthorpe, Leon Romanovsky, linux-rdma, linux-kernel
  Cc: Rohit Chavan

The variable 'rc' is initialized to 0 and returned at the end of
bng_re_process_qp_event(), but it is never modified in between.

Simplify the function by removing the redundant variable and returning 0
directly. This cleans up the code and avoids potential compiler warnings
about unused variables.

Signed-off-by: Rohit Chavan <roheetchavan@gmail.com>
---
 drivers/infiniband/hw/bng_re/bng_fw.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/infiniband/hw/bng_re/bng_fw.c b/drivers/infiniband/hw/bng_re/bng_fw.c
index 17d7cc3aa11d..50156c300b33 100644
--- a/drivers/infiniband/hw/bng_re/bng_fw.c
+++ b/drivers/infiniband/hw/bng_re/bng_fw.c
@@ -123,7 +123,6 @@ static int bng_re_process_qp_event(struct bng_re_rcfw *rcfw,
 	bool is_waiter_alive;
 	struct pci_dev *pdev;
 	u32 wait_cmds = 0;
-	int rc = 0;
 
 	pdev = rcfw->pdev;
 	switch (qp_event->event) {
@@ -152,7 +151,7 @@ static int bng_re_process_qp_event(struct bng_re_rcfw *rcfw,
 				 "rcfw timedout: cookie = %#x, free_slots = %d",
 				 cookie, crsqe->free_slots);
 			spin_unlock(&hwq->lock);
-			return rc;
+			return 0;
 		}
 
 		if (crsqe->is_waiter_alive) {
@@ -182,7 +181,7 @@ static int bng_re_process_qp_event(struct bng_re_rcfw *rcfw,
 		spin_unlock(&hwq->lock);
 	}
 	*num_wait += wait_cmds;
-	return rc;
+	return 0;
 }
 
 /* function events */
-- 
2.34.1


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

* Re: [PATCH] RDMA/bng_re: Remove unused variable rc
  2026-05-05  8:57 [PATCH] RDMA/bng_re: Remove unused variable rc Rohit Chavan
@ 2026-05-07 10:22 ` Siva Reddy Kallam
  2026-05-13 15:13 ` Leon Romanovsky
  1 sibling, 0 replies; 3+ messages in thread
From: Siva Reddy Kallam @ 2026-05-07 10:22 UTC (permalink / raw)
  To: Rohit Chavan; +Cc: Jason Gunthorpe, Leon Romanovsky, linux-rdma, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1843 bytes --]

On Tue, May 5, 2026 at 2:27 PM Rohit Chavan <roheetchavan@gmail.com> wrote:
>
> The variable 'rc' is initialized to 0 and returned at the end of
> bng_re_process_qp_event(), but it is never modified in between.
>
> Simplify the function by removing the redundant variable and returning 0
> directly. This cleans up the code and avoids potential compiler warnings
> about unused variables.
>
> Signed-off-by: Rohit Chavan <roheetchavan@gmail.com>
Reviewed-by: Siva Reddy Kallam <siva.kallam@broadcom.com>

> ---
>  drivers/infiniband/hw/bng_re/bng_fw.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/infiniband/hw/bng_re/bng_fw.c b/drivers/infiniband/hw/bng_re/bng_fw.c
> index 17d7cc3aa11d..50156c300b33 100644
> --- a/drivers/infiniband/hw/bng_re/bng_fw.c
> +++ b/drivers/infiniband/hw/bng_re/bng_fw.c
> @@ -123,7 +123,6 @@ static int bng_re_process_qp_event(struct bng_re_rcfw *rcfw,
>         bool is_waiter_alive;
>         struct pci_dev *pdev;
>         u32 wait_cmds = 0;
> -       int rc = 0;
>
>         pdev = rcfw->pdev;
>         switch (qp_event->event) {
> @@ -152,7 +151,7 @@ static int bng_re_process_qp_event(struct bng_re_rcfw *rcfw,
>                                  "rcfw timedout: cookie = %#x, free_slots = %d",
>                                  cookie, crsqe->free_slots);
>                         spin_unlock(&hwq->lock);
> -                       return rc;
> +                       return 0;
>                 }
>
>                 if (crsqe->is_waiter_alive) {
> @@ -182,7 +181,7 @@ static int bng_re_process_qp_event(struct bng_re_rcfw *rcfw,
>                 spin_unlock(&hwq->lock);
>         }
>         *num_wait += wait_cmds;
> -       return rc;
> +       return 0;
>  }
>
>  /* function events */
> --
> 2.34.1
>

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 5471 bytes --]

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

* Re: [PATCH] RDMA/bng_re: Remove unused variable rc
  2026-05-05  8:57 [PATCH] RDMA/bng_re: Remove unused variable rc Rohit Chavan
  2026-05-07 10:22 ` Siva Reddy Kallam
@ 2026-05-13 15:13 ` Leon Romanovsky
  1 sibling, 0 replies; 3+ messages in thread
From: Leon Romanovsky @ 2026-05-13 15:13 UTC (permalink / raw)
  To: siva.kallam, Jason Gunthorpe, linux-rdma, linux-kernel, Rohit Chavan


On Tue, 05 May 2026 14:27:08 +0530, Rohit Chavan wrote:
> The variable 'rc' is initialized to 0 and returned at the end of
> bng_re_process_qp_event(), but it is never modified in between.
> 
> Simplify the function by removing the redundant variable and returning 0
> directly. This cleans up the code and avoids potential compiler warnings
> about unused variables.
> 
> [...]

Applied, thanks!

[1/1] RDMA/bng_re: Remove unused variable rc
      https://git.kernel.org/rdma/rdma/c/4d575fcf8fdbae

Best regards,
-- 
Leon Romanovsky <leon@kernel.org>


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

end of thread, other threads:[~2026-05-13 15:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-05  8:57 [PATCH] RDMA/bng_re: Remove unused variable rc Rohit Chavan
2026-05-07 10:22 ` Siva Reddy Kallam
2026-05-13 15:13 ` Leon Romanovsky

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

all inboxes | Powered by JetHome®