linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] infiniband: remove redundant assignment to pointer 'rdi'
@ 2018-03-01 16:23 Colin King
  2018-03-01 17:47 ` Don Hiatt
  2018-03-06 23:34 ` Jason Gunthorpe
  0 siblings, 2 replies; 3+ messages in thread
From: Colin King @ 2018-03-01 16:23 UTC (permalink / raw)
  To: Dennis Dalessandro, Mike Marciniszyn, Doug Ledford,
	Jason Gunthorpe, linux-rdma
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The pointer rdi is being initialized with a value that is never read
and re-assigned immediately after, hence the initialization is redundant
and can be removed.

Cleans up clang warning:
drivers/infiniband/sw/rdmavt/vt.c:94:23: warning: Value stored to 'rdi'
during its initialization is never read

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/infiniband/sw/rdmavt/vt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/sw/rdmavt/vt.c b/drivers/infiniband/sw/rdmavt/vt.c
index a4553b2b3696..a67b0ddc2230 100644
--- a/drivers/infiniband/sw/rdmavt/vt.c
+++ b/drivers/infiniband/sw/rdmavt/vt.c
@@ -91,7 +91,7 @@ module_exit(rvt_cleanup);
  */
 struct rvt_dev_info *rvt_alloc_device(size_t size, int nports)
 {
-	struct rvt_dev_info *rdi = ERR_PTR(-ENOMEM);
+	struct rvt_dev_info *rdi;
 
 	rdi = (struct rvt_dev_info *)ib_alloc_device(size);
 	if (!rdi)
-- 
2.15.1

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

* Re: [PATCH] infiniband: remove redundant assignment to pointer 'rdi'
  2018-03-01 16:23 [PATCH] infiniband: remove redundant assignment to pointer 'rdi' Colin King
@ 2018-03-01 17:47 ` Don Hiatt
  2018-03-06 23:34 ` Jason Gunthorpe
  1 sibling, 0 replies; 3+ messages in thread
From: Don Hiatt @ 2018-03-01 17:47 UTC (permalink / raw)
  To: Colin King, Dennis Dalessandro, Mike Marciniszyn, Doug Ledford,
	Jason Gunthorpe, linux-rdma
  Cc: kernel-janitors, linux-kernel



On 3/1/2018 8:23 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The pointer rdi is being initialized with a value that is never read
> and re-assigned immediately after, hence the initialization is redundant
> and can be removed.
>
> Cleans up clang warning:
> drivers/infiniband/sw/rdmavt/vt.c:94:23: warning: Value stored to 'rdi'
> during its initialization is never read
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   drivers/infiniband/sw/rdmavt/vt.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/sw/rdmavt/vt.c b/drivers/infiniband/sw/rdmavt/vt.c
> index a4553b2b3696..a67b0ddc2230 100644
> --- a/drivers/infiniband/sw/rdmavt/vt.c
> +++ b/drivers/infiniband/sw/rdmavt/vt.c
> @@ -91,7 +91,7 @@ module_exit(rvt_cleanup);
>    */
>   struct rvt_dev_info *rvt_alloc_device(size_t size, int nports)
>   {
> -	struct rvt_dev_info *rdi = ERR_PTR(-ENOMEM);
> +	struct rvt_dev_info *rdi;
>   
>   	rdi = (struct rvt_dev_info *)ib_alloc_device(size);
>   	if (!rdi)
Thanks: Reviewed-by: Don Hiatt <don.hiatt@intel.com>

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

* Re: [PATCH] infiniband: remove redundant assignment to pointer 'rdi'
  2018-03-01 16:23 [PATCH] infiniband: remove redundant assignment to pointer 'rdi' Colin King
  2018-03-01 17:47 ` Don Hiatt
@ 2018-03-06 23:34 ` Jason Gunthorpe
  1 sibling, 0 replies; 3+ messages in thread
From: Jason Gunthorpe @ 2018-03-06 23:34 UTC (permalink / raw)
  To: Colin Ian King
  Cc: Dennis Dalessandro, Mike Marciniszyn, Doug Ledford, linux-rdma,
	kernel-janitors, linux-kernel

On Thu, Mar 01, 2018 at 04:23:54PM +0000, Colin Ian King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The pointer rdi is being initialized with a value that is never read
> and re-assigned immediately after, hence the initialization is redundant
> and can be removed.
> 
> Cleans up clang warning:
> drivers/infiniband/sw/rdmavt/vt.c:94:23: warning: Value stored to 'rdi'
> during its initialization is never read
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>  drivers/infiniband/sw/rdmavt/vt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

applied to for-next, thanks

Jason

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

end of thread, other threads:[~2018-03-06 23:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-01 16:23 [PATCH] infiniband: remove redundant assignment to pointer 'rdi' Colin King
2018-03-01 17:47 ` Don Hiatt
2018-03-06 23:34 ` 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).