RE: [PATCH 3/6] scsi: aacraid: constify pci_error_handlers structures

2017-08-12 Thread Dave Carroll
> 
> These pci_error_handlers structures are only stored in the err_handler field 
> of a
> pci_driver structure, and this field is declared as const.  Thus the
> pci_error_handlers structures can be const too.
> 
> Done with the help of Coccinelle.
> 
> Signed-off-by: Julia Lawall 
> 
> ---
>  drivers/scsi/aacraid/linit.c |2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c index
> a8dedc3..2b978d8 100644
> --- a/drivers/scsi/aacraid/linit.c
> +++ b/drivers/scsi/aacraid/linit.c
> @@ -2070,7 +2070,7 @@ static void aac_pci_resume(struct pci_dev *pdev)
> dev_err(>dev, "aacraid: PCI error - resume\n");  }
> 
> -static struct pci_error_handlers aac_pci_err_handler = {
> +static const struct pci_error_handlers aac_pci_err_handler = {
> .error_detected = aac_pci_error_detected,
> .mmio_enabled   = aac_pci_mmio_enabled,
> .slot_reset = aac_pci_slot_reset,

Acked-by: Dave Carroll 



[PATCH] scsi: pmcraid: fix duplicated code for different branches

2017-08-12 Thread Gustavo A. R. Silva
Refactor code in order to avoid identical code for different branches.

This issue was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva 
---
This code was tested by compilation only.

 drivers/scsi/pmcraid.c | 7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c
index 1f8b153..b4d6cd8 100644
--- a/drivers/scsi/pmcraid.c
+++ b/drivers/scsi/pmcraid.c
@@ -1595,12 +1595,7 @@ static void pmcraid_handle_config_change(struct 
pmcraid_instance *pinstance)
if (pinstance->ccn.hcam->notification_type ==
NOTIFICATION_TYPE_ENTRY_CHANGED &&
cfg_entry->resource_type == RES_TYPE_VSET) {
-
-   if (fw_version <= PMCRAID_FW_VERSION_1)
-   hidden_entry = (cfg_entry->unique_flags1 & 0x80) != 0;
-   else
-   hidden_entry = (cfg_entry->unique_flags1 & 0x80) != 0;
-
+   hidden_entry = (cfg_entry->unique_flags1 & 0x80) != 0;
} else if (!pmcraid_expose_resource(fw_version, cfg_entry)) {
goto out_notify_apps;
}
-- 
2.5.0



[GIT PULL] target fixes for v4.13-rc5

2017-08-12 Thread Nicholas A. Bellinger
Hi Linus,

Here are the target-pending fixes for v4.13-rc5.  Please go ahead and
pull from:

  git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending.git master

The highlights include:

- Fix iscsi-target payload memory leak during ISCSI_FLAG_TEXT_CONTINUE
  (Varun Prakash)
- Fix tcm_qla2xxx incorrect use of tcm_qla2xxx_free_cmd during ABORT
  (Pascal de Bruijn + Himanshu Madhani + nab)
- Fix iscsi-target long-standing issue with parallel delete of a single
  network portal across multiple target instances (Gary Guo + nab)
- Fix target dynamic se_node GPF during uncached shutdown regression
  (Justin Maggard + nab)

Thank you,

--nab

Bryant G. Ly (1):
  tcmu: free old string on reconfig

Nicholas Bellinger (3):
  qla2xxx: Fix incorrect tcm_qla2xxx_free_cmd use during TMR ABORT (v2)
  iscsi-target: Fix iscsi_np reset hung task during parallel delete
  target: Fix node_acl demo-mode + uncached dynamic shutdown regression

Varun Prakash (4):
  cxgbit: add missing __kfree_skb()
  iscsi-target: fix memory leak in iscsit_setup_text_cmd()
  iscsi-target: fix invalid flags in text response
  cxgbit: fix sg_nents calculation

Xiubo Li (1):
  tcmu: Fix possible to/from address overflow when doing the memcpy

 drivers/scsi/qla2xxx/tcm_qla2xxx.c  | 30 -
 drivers/target/iscsi/cxgbit/cxgbit_cm.c | 16 +++
 drivers/target/iscsi/cxgbit/cxgbit_target.c | 12 +++-
 drivers/target/iscsi/iscsi_target.c |  6 --
 drivers/target/iscsi/iscsi_target_login.c   |  7 +--
 drivers/target/target_core_tpg.c|  4 ++--
 drivers/target/target_core_transport.c  |  4 ++--
 drivers/target/target_core_user.c   | 13 +++--
 include/target/iscsi/iscsi_target_core.h|  1 +
 9 files changed, 40 insertions(+), 53 deletions(-)



Re: [PATCH 0/6] constify pci_error_handlers structures

2017-08-12 Thread Julia Lawall
Another issue arises in the files drivers/infiniband/hw/hfi1/pcie.c and
drivers/infiniband/hw/qib/qib_pcie.c, where the pci_error_handlers
structure is defined in one file and used in another file.  The structure
definition references various functions that are static in the same file.
Should I try to move those functions to the file containing the pci_driver
structure?  Or leave the functions where they are and remove the static
annotation?

thanks,
julia


Re: [PATCH 0/6] constify pci_error_handlers structures

2017-08-12 Thread Julia Lawall


On Sat, 12 Aug 2017, Christoph Hellwig wrote:

> On Sat, Aug 12, 2017 at 09:52:28AM +0200, Julia Lawall wrote:
> > OK, sure.  So to be precise, you want the fields error_detected,
> > mmio_enabled, etc to be added as new fields to the pci_driver structure?
>
> Yes.
>
> > They both have a resume field, though.  What should the pci_error_handlers
> > resume function be renamed to?  Would resume_after_error be too much?
>
> error_resume maybe?

OK

>
> FYI, I already killed it for the PCIe port drivers a while ago:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git/commit/?h=pci/aer=c5dc3c69f17a7e77359f10c342d1816390bc8846

Thanks for the pointer.

julia



Re: [PATCH 0/6] constify pci_error_handlers structures

2017-08-12 Thread Christoph Hellwig
On Sat, Aug 12, 2017 at 09:52:28AM +0200, Julia Lawall wrote:
> OK, sure.  So to be precise, you want the fields error_detected,
> mmio_enabled, etc to be added as new fields to the pci_driver structure?

Yes.

> They both have a resume field, though.  What should the pci_error_handlers
> resume function be renamed to?  Would resume_after_error be too much?

error_resume maybe?

FYI, I already killed it for the PCIe port drivers a while ago:

https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git/commit/?h=pci/aer=c5dc3c69f17a7e77359f10c342d1816390bc8846


Re: [PATCH 0/6] constify pci_error_handlers structures

2017-08-12 Thread Julia Lawall


On Sat, 12 Aug 2017, Christoph Hellwig wrote:

> On Sat, Aug 12, 2017 at 07:44:28AM +0200, Julia Lawall wrote:
> > These pci_error_handlers structures are only stored in the err_handler
> > field of a pci_driver structure, and this field is declared as const.  Thus
> > the pci_error_handlers structures can be const too.
> >
> > Done with the help of Coccinelle.
>
> If you're doing a scripted conversion of the pci_error_handlers
> structured I'd much rather see that structure killed off and folded
> into the pci_driver one.

OK, sure.  So to be precise, you want the fields error_detected,
mmio_enabled, etc to be added as new fields to the pci_driver structure?

They both have a resume field, though.  What should the pci_error_handlers
resume function be renamed to?  Would resume_after_error be too much?

julia


Re: [PATCH 0/6] constify pci_error_handlers structures

2017-08-12 Thread Christoph Hellwig
On Sat, Aug 12, 2017 at 07:44:28AM +0200, Julia Lawall wrote:
> These pci_error_handlers structures are only stored in the err_handler
> field of a pci_driver structure, and this field is declared as const.  Thus
> the pci_error_handlers structures can be const too.
> 
> Done with the help of Coccinelle.

If you're doing a scripted conversion of the pci_error_handlers
structured I'd much rather see that structure killed off and folded
into the pci_driver one.


[PATCH 3/6] scsi: aacraid: constify pci_error_handlers structures

2017-08-12 Thread Julia Lawall
These pci_error_handlers structures are only stored in the err_handler
field of a pci_driver structure, and this field is declared as const.  Thus
the pci_error_handlers structures can be const too.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall 

---
 drivers/scsi/aacraid/linit.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
index a8dedc3..2b978d8 100644
--- a/drivers/scsi/aacraid/linit.c
+++ b/drivers/scsi/aacraid/linit.c
@@ -2070,7 +2070,7 @@ static void aac_pci_resume(struct pci_dev *pdev)
dev_err(>dev, "aacraid: PCI error - resume\n");
 }
 
-static struct pci_error_handlers aac_pci_err_handler = {
+static const struct pci_error_handlers aac_pci_err_handler = {
.error_detected = aac_pci_error_detected,
.mmio_enabled   = aac_pci_mmio_enabled,
.slot_reset = aac_pci_slot_reset,



[PATCH 1/6] scsi: mpt3sas: constify pci_error_handlers structures

2017-08-12 Thread Julia Lawall
These pci_error_handlers structures are only stored in the err_handler
field of a pci_driver structure, and this field is declared as const.  Thus
the pci_error_handlers structures can be const too.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall 

---
 drivers/scsi/mpt3sas/mpt3sas_scsih.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c 
b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index 22998cb..52c163f 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -9277,7 +9277,7 @@ bool scsih_ncq_prio_supp(struct scsi_device *sdev)
 };
 MODULE_DEVICE_TABLE(pci, mpt3sas_pci_table);
 
-static struct pci_error_handlers _mpt3sas_err_handler = {
+static const struct pci_error_handlers _mpt3sas_err_handler = {
.error_detected = scsih_pci_error_detected,
.mmio_enabled   = scsih_pci_mmio_enabled,
.slot_reset = scsih_pci_slot_reset,



[PATCH 4/6] scsi: be2iscsi: constify pci_error_handlers structures

2017-08-12 Thread Julia Lawall
These pci_error_handlers structures are only stored in the err_handler
field of a pci_driver structure, and this field is declared as const.  Thus
the pci_error_handlers structures can be const too.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall 

---
 drivers/scsi/be2iscsi/be_main.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index b4542e7..511732a 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -5786,7 +5786,7 @@ static void beiscsi_remove(struct pci_dev *pcidev)
 }
 
 
-static struct pci_error_handlers beiscsi_eeh_handlers = {
+static const struct pci_error_handlers beiscsi_eeh_handlers = {
.error_detected = beiscsi_eeh_err_detected,
.slot_reset = beiscsi_eeh_reset,
.resume = beiscsi_eeh_resume,



[PATCH 5/6] [SCSI] csiostor: constify pci_error_handlers structures

2017-08-12 Thread Julia Lawall
These pci_error_handlers structures are only stored in the err_handler
field of a pci_driver structure, and this field is declared as const.  Thus
the pci_error_handlers structures can be const too.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall 

---
 drivers/scsi/csiostor/csio_init.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/csiostor/csio_init.c 
b/drivers/scsi/csiostor/csio_init.c
index 28a9c7d..ab4fbcf 100644
--- a/drivers/scsi/csiostor/csio_init.c
+++ b/drivers/scsi/csiostor/csio_init.c
@@ -1168,7 +1168,7 @@ static void csio_remove_one(struct pci_dev *pdev)
dev_err(>dev, "resume of device failed: %d\n", rv);
 }
 
-static struct pci_error_handlers csio_err_handler = {
+static const struct pci_error_handlers csio_err_handler = {
.error_detected = csio_pci_error_detected,
.slot_reset = csio_pci_slot_reset,
.resume = csio_pci_resume,



[PATCH 6/6] bfa: constify pci_error_handlers structures

2017-08-12 Thread Julia Lawall
These pci_error_handlers structures are only stored in the err_handler
field of a pci_driver structure, and this field is declared as const.  Thus
the pci_error_handlers structures can be const too.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall 

---
 drivers/scsi/bfa/bfad.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c
index 5caf5f3..2861694 100644
--- a/drivers/scsi/bfa/bfad.c
+++ b/drivers/scsi/bfa/bfad.c
@@ -1683,7 +1683,7 @@ struct pci_device_id bfad_id_table[] = {
 /*
  * PCI error recovery handlers.
  */
-static struct pci_error_handlers bfad_err_handler = {
+static const struct pci_error_handlers bfad_err_handler = {
.error_detected = bfad_pci_error_detected,
.slot_reset = bfad_pci_slot_reset,
.mmio_enabled = bfad_pci_mmio_enabled,



[PATCH 0/6] constify pci_error_handlers structures

2017-08-12 Thread Julia Lawall
These pci_error_handlers structures are only stored in the err_handler
field of a pci_driver structure, and this field is declared as const.  Thus
the pci_error_handlers structures can be const too.

Done with the help of Coccinelle.

---

 drivers/misc/genwqe/card_base.c  |2 +-
 drivers/scsi/aacraid/linit.c |2 +-
 drivers/scsi/be2iscsi/be_main.c  |2 +-
 drivers/scsi/bfa/bfad.c  |2 +-
 drivers/scsi/csiostor/csio_init.c|2 +-
 drivers/scsi/mpt3sas/mpt3sas_scsih.c |2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)