* [bug report] i40iw: add main, hdr, status
@ 2017-01-17 13:58 Dan Carpenter
2017-01-17 18:52 ` Shiraz Saleem
0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2017-01-17 13:58 UTC (permalink / raw)
To: faisal.latif-ral2JQCrhuEAvxtiuMwx3w; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA
Hello Faisal Latif,
The patch 8e06af711bf2: "i40iw: add main, hdr, status" from Jan 20,
2016, leads to the following static checker warning:
drivers/infiniband/hw/i40iw/i40iw_main.c:606 i40iw_create_cqp()
error: uninitialized symbol 'maj_err'.
drivers/infiniband/hw/i40iw/i40iw_main.c
599 status = dev->cqp_ops->cqp_init(dev->cqp, &cqp_init_info);
600 if (status) {
601 i40iw_pr_err("cqp init status %d\n", status);
602 goto exit;
603 }
604 status = dev->cqp_ops->cqp_create(dev->cqp, &maj_err, &min_err);
605 if (status) {
606 i40iw_pr_err("cqp create status %d maj_err %d min_err %d\n",
607 status, maj_err, min_err);
Not all error paths in i40iw_sc_cqp_create() initialized maj_err and
min_err. Can't we just delete this printk?
608 goto exit;
609 }
regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [bug report] i40iw: add main, hdr, status
2017-01-17 13:58 [bug report] i40iw: add main, hdr, status Dan Carpenter
@ 2017-01-17 18:52 ` Shiraz Saleem
[not found] ` <20170117185247.GA63212-GOXS9JX10wfOxmVO0tvppfooFf0ArEBIu+b9c/7xato@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Shiraz Saleem @ 2017-01-17 18:52 UTC (permalink / raw)
To: Dan Carpenter
Cc: faisal.latif-ral2JQCrhuEAvxtiuMwx3w,
linux-rdma-u79uwXL29TY76Z2rM5mHXA
On Tue, Jan 17, 2017 at 04:58:50PM +0300, Dan Carpenter wrote:
> Hello Faisal Latif,
>
> The patch 8e06af711bf2: "i40iw: add main, hdr, status" from Jan 20,
> 2016, leads to the following static checker warning:
>
> drivers/infiniband/hw/i40iw/i40iw_main.c:606 i40iw_create_cqp()
> error: uninitialized symbol 'maj_err'.
>
> drivers/infiniband/hw/i40iw/i40iw_main.c
> 599 status = dev->cqp_ops->cqp_init(dev->cqp, &cqp_init_info);
> 600 if (status) {
> 601 i40iw_pr_err("cqp init status %d\n", status);
> 602 goto exit;
> 603 }
> 604 status = dev->cqp_ops->cqp_create(dev->cqp, &maj_err, &min_err);
> 605 if (status) {
> 606 i40iw_pr_err("cqp create status %d maj_err %d min_err %d\n",
> 607 status, maj_err, min_err);
>
> Not all error paths in i40iw_sc_cqp_create() initialized maj_err and
> min_err. Can't we just delete this printk?
We would like to keep maj_err and min_err prints
In i40iw_create_cqp, can we initialize the locals maj_err and min_err to
0 instead of deleting the printk.
>
> 608 goto exit;
> 609 }
>
> regards,
> dan carpenter
> --
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [bug report] i40iw: add main, hdr, status
[not found] ` <20170117185247.GA63212-GOXS9JX10wfOxmVO0tvppfooFf0ArEBIu+b9c/7xato@public.gmane.org>
@ 2017-01-18 11:24 ` Yuval Shaia
[not found] ` <20170118112408.GC7544-Hxa29pjIrETlQW142y8m19+IiqhCXseY@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Yuval Shaia @ 2017-01-18 11:24 UTC (permalink / raw)
To: Shiraz Saleem
Cc: Dan Carpenter, faisal.latif-ral2JQCrhuEAvxtiuMwx3w,
linux-rdma-u79uwXL29TY76Z2rM5mHXA
On Tue, Jan 17, 2017 at 12:52:48PM -0600, Shiraz Saleem wrote:
> On Tue, Jan 17, 2017 at 04:58:50PM +0300, Dan Carpenter wrote:
> > Hello Faisal Latif,
> >
> > The patch 8e06af711bf2: "i40iw: add main, hdr, status" from Jan 20,
> > 2016, leads to the following static checker warning:
> >
> > drivers/infiniband/hw/i40iw/i40iw_main.c:606 i40iw_create_cqp()
> > error: uninitialized symbol 'maj_err'.
> >
> > drivers/infiniband/hw/i40iw/i40iw_main.c
> > 599 status = dev->cqp_ops->cqp_init(dev->cqp, &cqp_init_info);
> > 600 if (status) {
> > 601 i40iw_pr_err("cqp init status %d\n", status);
> > 602 goto exit;
> > 603 }
> > 604 status = dev->cqp_ops->cqp_create(dev->cqp, &maj_err, &min_err);
> > 605 if (status) {
> > 606 i40iw_pr_err("cqp create status %d maj_err %d min_err %d\n",
> > 607 status, maj_err, min_err);
> >
> > Not all error paths in i40iw_sc_cqp_create() initialized maj_err and
> > min_err. Can't we just delete this printk?
>
> We would like to keep maj_err and min_err prints
>
> In i40iw_create_cqp, can we initialize the locals maj_err and min_err to
> 0 instead of deleting the printk.
Don't you think it is the job of cqp_create to set maj_err and min_err when
replying with an error?
>
> >
> > 608 goto exit;
> > 609 }
> >
> > regards,
> > dan carpenter
> > --
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [bug report] i40iw: add main, hdr, status
[not found] ` <20170118112408.GC7544-Hxa29pjIrETlQW142y8m19+IiqhCXseY@public.gmane.org>
@ 2017-01-18 20:01 ` Saleem, Shiraz
0 siblings, 0 replies; 4+ messages in thread
From: Saleem, Shiraz @ 2017-01-18 20:01 UTC (permalink / raw)
To: Yuval Shaia
Cc: Dan Carpenter, Latif, Faisal,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> On Tue, Jan 17, 2017 at 12:52:48PM -0600, Shiraz Saleem wrote:
> > On Tue, Jan 17, 2017 at 04:58:50PM +0300, Dan Carpenter wrote:
> > > Hello Faisal Latif,
> > >
> > > The patch 8e06af711bf2: "i40iw: add main, hdr, status" from Jan 20,
> > > 2016, leads to the following static checker warning:
> > >
> > > drivers/infiniband/hw/i40iw/i40iw_main.c:606 i40iw_create_cqp()
> > > error: uninitialized symbol 'maj_err'.
> > >
> > > drivers/infiniband/hw/i40iw/i40iw_main.c
> > > 599 status = dev->cqp_ops->cqp_init(dev->cqp, &cqp_init_info);
> > > 600 if (status) {
> > > 601 i40iw_pr_err("cqp init status %d\n", status);
> > > 602 goto exit;
> > > 603 }
> > > 604 status = dev->cqp_ops->cqp_create(dev->cqp, &maj_err,
> &min_err);
> > > 605 if (status) {
> > > 606 i40iw_pr_err("cqp create status %d maj_err %d min_err
> %d\n",
> > > 607 status, maj_err, min_err);
> > >
> > > Not all error paths in i40iw_sc_cqp_create() initialized maj_err and
> > > min_err. Can't we just delete this printk?
> >
> > We would like to keep maj_err and min_err prints
> >
> > In i40iw_create_cqp, can we initialize the locals maj_err and min_err
> > to
> > 0 instead of deleting the printk.
>
> Don't you think it is the job of cqp_create to set maj_err and min_err when replying
> with an error?
>
Agreed. This is a better approach. I sent out a patch for the same.
Thank you Dan and Yuval.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-01-18 20:01 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-17 13:58 [bug report] i40iw: add main, hdr, status Dan Carpenter
2017-01-17 18:52 ` Shiraz Saleem
[not found] ` <20170117185247.GA63212-GOXS9JX10wfOxmVO0tvppfooFf0ArEBIu+b9c/7xato@public.gmane.org>
2017-01-18 11:24 ` Yuval Shaia
[not found] ` <20170118112408.GC7544-Hxa29pjIrETlQW142y8m19+IiqhCXseY@public.gmane.org>
2017-01-18 20:01 ` Saleem, Shiraz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox