Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
* [PATCH -next] RDMA/bnxt_re: Remove the unused variable en_dev
@ 2024-09-18  2:16 Jiapeng Chong
  2024-09-19  8:46 ` Selvin Xavier
  2024-09-22 13:54 ` Leon Romanovsky
  0 siblings, 2 replies; 4+ messages in thread
From: Jiapeng Chong @ 2024-09-18  2:16 UTC (permalink / raw)
  To: selvin.xavier
  Cc: jgg, leon, linux-rdma, linux-kernel, Jiapeng Chong, Abaci Robot

Variable en_dev is not effectively used, so delete it.

drivers/infiniband/hw/bnxt_re/main.c:1980:22: warning: variable ‘en_dev’ set but not used.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=10867
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 drivers/infiniband/hw/bnxt_re/main.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/infiniband/hw/bnxt_re/main.c b/drivers/infiniband/hw/bnxt_re/main.c
index adff9e494c9d..777068de4bbc 100644
--- a/drivers/infiniband/hw/bnxt_re/main.c
+++ b/drivers/infiniband/hw/bnxt_re/main.c
@@ -1977,7 +1977,6 @@ static void bnxt_re_remove_device(struct bnxt_re_dev *rdev, u8 op_type,
 static void bnxt_re_remove(struct auxiliary_device *adev)
 {
 	struct bnxt_re_en_dev_info *en_info = auxiliary_get_drvdata(adev);
-	struct bnxt_en_dev *en_dev;
 	struct bnxt_re_dev *rdev;
 
 	mutex_lock(&bnxt_re_mutex);
@@ -1985,7 +1984,6 @@ static void bnxt_re_remove(struct auxiliary_device *adev)
 		mutex_unlock(&bnxt_re_mutex);
 		return;
 	}
-	en_dev = en_info->en_dev;
 	rdev = en_info->rdev;
 
 	if (rdev)
-- 
2.32.0.3.g01195cf9f


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

* Re: [PATCH -next] RDMA/bnxt_re: Remove the unused variable en_dev
  2024-09-18  2:16 [PATCH -next] RDMA/bnxt_re: Remove the unused variable en_dev Jiapeng Chong
@ 2024-09-19  8:46 ` Selvin Xavier
  2024-09-22 13:52   ` Leon Romanovsky
  2024-09-22 13:54 ` Leon Romanovsky
  1 sibling, 1 reply; 4+ messages in thread
From: Selvin Xavier @ 2024-09-19  8:46 UTC (permalink / raw)
  To: Jiapeng Chong; +Cc: jgg, leon, linux-rdma, linux-kernel, Abaci Robot

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

On Wed, Sep 18, 2024 at 7:46 AM Jiapeng Chong
<jiapeng.chong@linux.alibaba.com> wrote:
>
> Variable en_dev is not effectively used, so delete it.
>
> drivers/infiniband/hw/bnxt_re/main.c:1980:22: warning: variable ‘en_dev’ set but not used.

Not sure if you are applying v1 of a previous patch series. A similar
issue was reported by kernel test robot and i fixed in v2. I dont see
this code in the latest driver code.
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=10867
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
>  drivers/infiniband/hw/bnxt_re/main.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/drivers/infiniband/hw/bnxt_re/main.c b/drivers/infiniband/hw/bnxt_re/main.c
> index adff9e494c9d..777068de4bbc 100644
> --- a/drivers/infiniband/hw/bnxt_re/main.c
> +++ b/drivers/infiniband/hw/bnxt_re/main.c
> @@ -1977,7 +1977,6 @@ static void bnxt_re_remove_device(struct bnxt_re_dev *rdev, u8 op_type,
>  static void bnxt_re_remove(struct auxiliary_device *adev)
>  {
>         struct bnxt_re_en_dev_info *en_info = auxiliary_get_drvdata(adev);
> -       struct bnxt_en_dev *en_dev;
>         struct bnxt_re_dev *rdev;
>
>         mutex_lock(&bnxt_re_mutex);
> @@ -1985,7 +1984,6 @@ static void bnxt_re_remove(struct auxiliary_device *adev)
>                 mutex_unlock(&bnxt_re_mutex);
>                 return;
>         }
> -       en_dev = en_info->en_dev;
>         rdev = en_info->rdev;
>
>         if (rdev)
> --
> 2.32.0.3.g01195cf9f
>
>

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

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

* Re: [PATCH -next] RDMA/bnxt_re: Remove the unused variable en_dev
  2024-09-19  8:46 ` Selvin Xavier
@ 2024-09-22 13:52   ` Leon Romanovsky
  0 siblings, 0 replies; 4+ messages in thread
From: Leon Romanovsky @ 2024-09-22 13:52 UTC (permalink / raw)
  To: Selvin Xavier; +Cc: Jiapeng Chong, jgg, linux-rdma, linux-kernel, Abaci Robot

On Thu, Sep 19, 2024 at 02:16:11PM +0530, Selvin Xavier wrote:
> On Wed, Sep 18, 2024 at 7:46 AM Jiapeng Chong
> <jiapeng.chong@linux.alibaba.com> wrote:
> >
> > Variable en_dev is not effectively used, so delete it.
> >
> > drivers/infiniband/hw/bnxt_re/main.c:1980:22: warning: variable ‘en_dev’ set but not used.
> 
> Not sure if you are applying v1 of a previous patch series. A similar
> issue was reported by kernel test robot and i fixed in v2. I dont see
> this code in the latest driver code.

Similar but not the same, I applied your v2 series, but Jiapeng's patch
is valid:

  1977 static void bnxt_re_remove(struct auxiliary_device *adev)
  1978 {
  1979         struct bnxt_re_en_dev_info *en_info = auxiliary_get_drvdata(adev);
  1980         struct bnxt_en_dev *en_dev;
  1981         struct bnxt_re_dev *rdev;
  1982
  1983         mutex_lock(&bnxt_re_mutex);
  1984         if (!en_info) {
  1985                 mutex_unlock(&bnxt_re_mutex);
  1986                 return;
  1987         }
  1988         en_dev = en_info->en_dev;
  1989         rdev = en_info->rdev;
  1990
  1991         if (rdev)
  1992                 bnxt_re_remove_device(rdev, BNXT_RE_COMPLETE_REMOVE, adev);
  1993         kfree(en_info);
  1994         mutex_unlock(&bnxt_re_mutex);
  1995 }


Thanks

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

* Re: [PATCH -next] RDMA/bnxt_re: Remove the unused variable en_dev
  2024-09-18  2:16 [PATCH -next] RDMA/bnxt_re: Remove the unused variable en_dev Jiapeng Chong
  2024-09-19  8:46 ` Selvin Xavier
@ 2024-09-22 13:54 ` Leon Romanovsky
  1 sibling, 0 replies; 4+ messages in thread
From: Leon Romanovsky @ 2024-09-22 13:54 UTC (permalink / raw)
  To: selvin.xavier, Jiapeng Chong; +Cc: jgg, linux-rdma, linux-kernel, Abaci Robot


On Wed, 18 Sep 2024 10:16:32 +0800, Jiapeng Chong wrote:
> Variable en_dev is not effectively used, so delete it.
> 
> drivers/infiniband/hw/bnxt_re/main.c:1980:22: warning: variable ‘en_dev’ set but not used.
> 
> 

Applied, thanks!

[1/1] RDMA/bnxt_re: Remove the unused variable en_dev
      https://git.kernel.org/rdma/rdma/c/70920941923316

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


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

end of thread, other threads:[~2024-09-22 13:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-18  2:16 [PATCH -next] RDMA/bnxt_re: Remove the unused variable en_dev Jiapeng Chong
2024-09-19  8:46 ` Selvin Xavier
2024-09-22 13:52   ` Leon Romanovsky
2024-09-22 13:54 ` Leon Romanovsky

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