public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] i40iw: silence an uninitialized variable warning
@ 2017-01-18 10:34 Dan Carpenter
  2017-01-18 11:19 ` Yuval Shaia
  2017-01-24 21:24 ` Doug Ledford
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2017-01-18 10:34 UTC (permalink / raw)
  To: Faisal Latif
  Cc: Shiraz Saleem, Doug Ledford, Sean Hefty, Hal Rosenstock,
	linux-rdma, kernel-janitors

These can be used without being uninitialized but it's only a printk()
so it's not the end of the world.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/infiniband/hw/i40iw/i40iw_main.c b/drivers/infiniband/hw/i40iw/i40iw_main.c
index 2728af3..7b78a17 100644
--- a/drivers/infiniband/hw/i40iw/i40iw_main.c
+++ b/drivers/infiniband/hw/i40iw/i40iw_main.c
@@ -561,7 +561,7 @@ static enum i40iw_status_code i40iw_create_cqp(struct i40iw_device *iwdev)
 	struct i40iw_sc_dev *dev = &iwdev->sc_dev;
 	struct i40iw_cqp_init_info cqp_init_info;
 	struct i40iw_cqp *cqp = &iwdev->cqp;
-	u16 maj_err, min_err;
+	u16 maj_err = 0, min_err = 0;
 	int i;
 
 	cqp->cqp_requests = kcalloc(sqsize, sizeof(*cqp->cqp_requests), GFP_KERNEL);

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

* Re: [patch] i40iw: silence an uninitialized variable warning
  2017-01-18 10:34 [patch] i40iw: silence an uninitialized variable warning Dan Carpenter
@ 2017-01-18 11:19 ` Yuval Shaia
  2017-01-24 21:24 ` Doug Ledford
  1 sibling, 0 replies; 3+ messages in thread
From: Yuval Shaia @ 2017-01-18 11:19 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Faisal Latif, Shiraz Saleem, Doug Ledford, Sean Hefty,
	Hal Rosenstock, linux-rdma, kernel-janitors

On Wed, Jan 18, 2017 at 01:34:53PM +0300, Dan Carpenter wrote:
> These can be used without being uninitialized but it's only a printk()
> so it's not the end of the world.

In an ideal world i would expect cqp_create function to set maj_err and
min_err when replying with error return code.

> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/infiniband/hw/i40iw/i40iw_main.c b/drivers/infiniband/hw/i40iw/i40iw_main.c
> index 2728af3..7b78a17 100644
> --- a/drivers/infiniband/hw/i40iw/i40iw_main.c
> +++ b/drivers/infiniband/hw/i40iw/i40iw_main.c
> @@ -561,7 +561,7 @@ static enum i40iw_status_code i40iw_create_cqp(struct i40iw_device *iwdev)
>  	struct i40iw_sc_dev *dev = &iwdev->sc_dev;
>  	struct i40iw_cqp_init_info cqp_init_info;
>  	struct i40iw_cqp *cqp = &iwdev->cqp;
> -	u16 maj_err, min_err;
> +	u16 maj_err = 0, min_err = 0;
>  	int i;
>  
>  	cqp->cqp_requests = kcalloc(sqsize, sizeof(*cqp->cqp_requests), GFP_KERNEL);
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [patch] i40iw: silence an uninitialized variable warning
  2017-01-18 10:34 [patch] i40iw: silence an uninitialized variable warning Dan Carpenter
  2017-01-18 11:19 ` Yuval Shaia
@ 2017-01-24 21:24 ` Doug Ledford
  1 sibling, 0 replies; 3+ messages in thread
From: Doug Ledford @ 2017-01-24 21:24 UTC (permalink / raw)
  To: Dan Carpenter, Faisal Latif
  Cc: Shiraz Saleem, Sean Hefty, Hal Rosenstock,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA

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

On Wed, 2017-01-18 at 13:34 +0300, Dan Carpenter wrote:
> These can be used without being uninitialized but it's only a
> printk()
> so it's not the end of the world.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> 
> diff --git a/drivers/infiniband/hw/i40iw/i40iw_main.c
> b/drivers/infiniband/hw/i40iw/i40iw_main.c
> index 2728af3..7b78a17 100644
> --- a/drivers/infiniband/hw/i40iw/i40iw_main.c
> +++ b/drivers/infiniband/hw/i40iw/i40iw_main.c
> @@ -561,7 +561,7 @@ static enum i40iw_status_code
> i40iw_create_cqp(struct i40iw_device *iwdev)
>  	struct i40iw_sc_dev *dev = &iwdev->sc_dev;
>  	struct i40iw_cqp_init_info cqp_init_info;
>  	struct i40iw_cqp *cqp = &iwdev->cqp;
> -	u16 maj_err, min_err;
> +	u16 maj_err = 0, min_err = 0;
>  	int i;
>  
>  	cqp->cqp_requests = kcalloc(sqsize, sizeof(*cqp-
> >cqp_requests), GFP_KERNEL);

Thanks for the patch, but I dropped this in in lieu of the patch to
make cqp_create always set both error codes.

-- 
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
    GPG KeyID: B826A3330E572FDD
   
Key fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

end of thread, other threads:[~2017-01-24 21:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-18 10:34 [patch] i40iw: silence an uninitialized variable warning Dan Carpenter
2017-01-18 11:19 ` Yuval Shaia
2017-01-24 21:24 ` Doug Ledford

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