Skip to contentSkip to conversation

i40iw: add main, hdr, status

bug report Dan Carpenter 3 participants 4 messages Jan 17, 2017 – Jan 18, 2017 2 messages not in the archive InfiniBand

lore
Share & tools
lore
#0 lore raw

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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#1 lore raw
Quoted 19 lines · Dan Carpenter

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);
Quoted 2 lines

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.

Quoted 7 lines
   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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 20170117185247.GA63212-GOXS9JX10wfOxmVO0tvppfooFf0ArEBIu+b9c/[email protected]

#3 lore raw
Quoted 20 lines · Shiraz Saleem
Quoted 19 lines · Dan Carpenter

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);
Quoted 7 lines
Quoted 2 lines

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?

Quoted 5 lines
Quoted 5 lines

   608                  goto exit;
   609          }
Quoted 7 lines
Quoted 3 lines

regards,
dan carpenter
--

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] 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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 20170118112408.GC7544-Hxa29pjIrETlQW142y8m19+IiqhCXseY@public.gmane.org

#5 lore raw
Quoted 26 lines · Shiraz Saleem
Quoted 9 lines · Dan Carpenter
Quoted 8 lines

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'.
Quoted 7 lines
Quoted 7 lines

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);

Quoted 2 lines
Quoted 2 lines
   605          if (status) {
   606                  i40iw_pr_err("cqp create status %d maj_err %d min_err

%d\n",

Quoted 5 lines
Quoted 4 lines
   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?

Quoted 9 lines
Quoted 5 lines

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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html