[PATCH 0/3] block: Deletion of checks before three function calls

2015-01-18 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 18 Jan 2015 14:50:06 +0100 Functions which release a system resource are occasionally documented in the way that they tolerate the passing of a null pointer for example. I do not see a need because of this fact that a function caller repeats a corresponding check.

[PATCH 1/3] block-cciss: Deletion of an unnecessary check before the function call "put_disk"

2015-01-18 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 18 Jan 2015 11:14:16 +0100 The put_disk() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/

[PATCH 3/3] block: Deletion of checks before the function call "iounmap"

2015-01-18 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 18 Jan 2015 13:33:25 +0100 The iounmap() function performs also input parameter validation. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/block/cciss.c| 18 ++

[PATCH v4 00/11] scsi: fix module reference mismatch for scsi host

2015-01-18 Thread Akinobu Mita
While accessing a scsi_device, the use count of the underlying LLDD module is incremented. The module reference is retrieved through .module field of struct scsi_host_template. This mapping between scsi_device and underlying LLDD module works well except some drivers which consist with the core d

[PATCH v4 11/11] ata: pata_of_platform: adjust module reference for scsi host

2015-01-18 Thread Akinobu Mita
The pata_of_platform driver depends on pata_platform module. The module reference of this scsi host is initialized to pata_platform's one. Because this drivers use __pata_platform_probe() which is defined in pata_platform module and calls scsi_host_alloc() internally. So these drivers can be unlo

[PATCH v4 03/11] cxgbi: prepare to move module reference from scsi_host_template to Scsi_Host

2015-01-18 Thread Akinobu Mita
In preparation for moving owner module reference field from struct scsi_host_template to struct Scsi_Host, this converts cxgbi_hbas_add() into macro so that LLDDs can pass THIS_MODULE to __iscsi_host_alloc() through it instead of scsi_host_template->module. Signed-off-by: Akinobu Mita Cc: Mike Ch

[PATCH v4 05/11] 53c700: prepare move module reference from scsi_host_template to Scsi_Host

2015-01-18 Thread Akinobu Mita
In preparation for moving owner module reference field from struct scsi_host_template to struct Scsi_Host, this converts NCR_700_detect() into macro so that LLDDs can pass THIS_MODULE to scsi_host_alloc() through it instead of scsi_host_template->module. Signed-off-by: Akinobu Mita Cc: Christoph

[PATCH v4 09/11] usb: storage: adjust module reference for scsi host

2015-01-18 Thread Akinobu Mita
The unusual usb storage drivers (ums-alauda, ums-cypress, ...) depend on usb-storage module. The module reference of these scsi host is initialized to usb-storage's one. Because these drivers use usb_stor_probe1() which is defined in usb-storage module and calls scsi_host_alloc(). So these drive

[PATCH v4 04/11] libfc: prepare to move module reference from scsi_host_template to Scsi_Host

2015-01-18 Thread Akinobu Mita
In preparation for moving owner module reference field from struct scsi_host_template to struct Scsi_Host, this enables libfc_vport_create() to allocate Scsi_Host with correct module reference through __libfc_host_alloc() which is introduced while changing libfc_host_alloc() from inline function to

[PATCH v4 08/11] scsi: ufs: adjust module reference for scsi host

2015-01-18 Thread Akinobu Mita
The ufs support consists with the core driver (ufshcd) and the actual glue driver (ufshcd-pci or ufshcd-pltfrm). The module reference of this scsi host is initialized to the core driver's one. Because the glue drivers use ufshcd_alloc_host() which is defined in ufshcd module and calls scsi_host_a

[PATCH v4 07/11] scsi: move module reference from scsi_host_template to Scsi_Host

2015-01-18 Thread Akinobu Mita
While accessing a scsi_device, the use count of the underlying LLDD module is incremented. The module reference is retrieved through .module field of struct scsi_host_template. This mapping between scsi_device and underlying LLDD module works well except some drivers which consist with the core d

[PATCH v4 06/11] scsi: legacy: prepare to move module reference from scsi_host_template to Scsi_Host

2015-01-18 Thread Akinobu Mita
In preparation for moving owner module reference field from struct scsi_host_template to struct Scsi_Host, this converts scsi_register() into macro so that legacy LLDDs can pass THIS_MODULE to scsi_host_alloc() through it instead of scsi_host_template->module. Signed-off-by: Akinobu Mita Cc: Chri

[PATCH v4 01/11] ata: prepare to move module reference from scsi_host_template to Scsi_Host

2015-01-18 Thread Akinobu Mita
In preparation for moving owner module reference field from struct scsi_host_template to struct Scsi_Host, this converts the following functions into macros so that LLDDs can pass THIS_MODULE to scsi_host_alloc() through them instead of scsi_host_template->module. ata_host_alloc() ata_host_alloc_p

[PATCH v4 02/11] iscsi: prepare to move module reference from scsi_host_template to Scsi_Host

2015-01-18 Thread Akinobu Mita
In preparation for moving owner module reference field from struct scsi_host_template to struct Scsi_Host, this converts iscsi_host_alloc() into macro so that LLDDs can pass THIS_MODULE to scsi_host_alloc() through it instead of scsi_host_template->module. Signed-off-by: Akinobu Mita Cc: Mike Chr

[PATCH v4 10/11] ata: ahci_platform: adjust module reference for scsi host

2015-01-18 Thread Akinobu Mita
The ahci platform drivers depend on libahci_platform module. The module reference of these scsi host is initialized to libahci_platform's one. Because these drivers use ahci_platform_init_host() which is defined in libahci_platform module and calls scsi_host_alloc() internally. So these drivers

[PATCH 4/4] sr: reduce debug noise in sr_do_ioctl

2015-01-18 Thread Christoph Hellwig
The midlayer scsi logging already logs the command and sense code if the logging level is high enough, no need to duplicate that in the sr driver. Signed-off-by: Christoph Hellwig --- drivers/scsi/sr_ioctl.c | 18 -- 1 file changed, 18 deletions(-) diff --git a/drivers/scsi/sr_i

[PATCH 3/4] ch: remove debug noise in ch_do_scsi

2015-01-18 Thread Christoph Hellwig
The midlayer logging already prints the cdb details if the logging level is high enough, no need to duplicate this in the ch driver. Signed-off-by: Christoph Hellwig --- drivers/scsi/ch.c | 8 1 file changed, 8 deletions(-) diff --git a/drivers/scsi/ch.c b/drivers/scsi/ch.c index 79e46

[PATCH 1/4] scsi: always use format argumets for dev_printk

2015-01-18 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- drivers/scsi/scsi_logging.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/scsi_logging.c b/drivers/scsi/scsi_logging.c index 6128303..ecc5918 100644 --- a/drivers/scsi/scsi_logging.c +++ b/drivers/scsi/scsi_log

[PATCH 2/4] scsi: annotate sdev_prefix_printk and scmd_printk as printf-like

2015-01-18 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- include/scsi/scsi_device.h | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index d1aad4d..2e0281e 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -

Re: [PATCH 1/4] scsi: always use format argumets for dev_printk

2015-01-18 Thread James Bottomley
On Sun, 2015-01-18 at 16:11 +0100, Christoph Hellwig wrote: > Signed-off-by: Christoph Hellwig Thanks. Ideally I would have preferred them folded into the logging series, but if that's not going to be forthcoming, then this works. For the series: Reviewed-by: James Bottomley James -- To un

Re: [PATCH 2/2] MAINTAINERS: ibmvfc driver maintainer change

2015-01-18 Thread Christoph Hellwig
Brian, can you ACK this one? -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH for kernel 3.19] Avoid that scsi_device_put() triggers a kernel warning

2015-01-18 Thread Christoph Hellwig
On Mon, Jan 05, 2015 at 02:02:59PM +0100, Christoph Hellwig wrote: > I don't like this. The problem is that sd_shutdown shouldn't even try > to grab a reference to the scsi device, nevermind the HBA module. We're fairly late in th 3.19 cycle, and it seems like the proper fix for the root cause mi

Re: [PATCH v4 10/11] ata: ahci_platform: adjust module reference for scsi host

2015-01-18 Thread Hans de Goede
Hi, On 18-01-15 16:06, Akinobu Mita wrote: The ahci platform drivers depend on libahci_platform module. The module reference of these scsi host is initialized to libahci_platform's one. Because these drivers use ahci_platform_init_host() which is defined in libahci_platform module and calls sc

Re: [PATCH for kernel 3.19] Avoid that scsi_device_put() triggers a kernel warning

2015-01-18 Thread James Bottomley
On Mon, 2015-01-05 at 12:03 +0100, Bart Van Assche wrote: > Avoid that the following warning is reported when a SCSI LLD kernel > module is unloaded: > > WARNING: CPU: 5 PID: 228 at kernel/module.c:954 module_put+0x207/0x220() > Call Trace: > [] dump_stack+0x4c/0x65 > [] warn_slowpath_common+0x8

Re: [PATCH for kernel 3.19] Avoid that scsi_device_put() triggers a kernel warning

2015-01-18 Thread James Bottomley
On Sun, 2015-01-18 at 16:22 +, James Bottomley wrote: > On Mon, 2015-01-05 at 12:03 +0100, Bart Van Assche wrote: > > Avoid that the following warning is reported when a SCSI LLD kernel > > module is unloaded: > > > > WARNING: CPU: 5 PID: 228 at kernel/module.c:954 module_put+0x207/0x220() > >

module: fix module_refcount() return when running in a module exit routine

2015-01-18 Thread James Bottomley
From: James Bottomley After e513cc1 module: Remove stop_machine from module unloading, module_refcount() is returning (unsigned long)-1 when called from within a routine that runs in module_exit. This is confusing the scsi device put code which is coded to detect a module_refcount() of zero for

Re: module: fix module_refcount() return when running in a module exit routine

2015-01-18 Thread Rusty Russell
James Bottomley writes: > From: James Bottomley > > After e513cc1 module: Remove stop_machine from module unloading, > module_refcount() is returning (unsigned long)-1 when called from within > a routine that runs in module_exit. This is confusing the scsi device > put code which is coded to det

Re: module: fix module_refcount() return when running in a module exit routine

2015-01-18 Thread Masami Hiramatsu
(2015/01/19 1:55), James Bottomley wrote: > From: James Bottomley > > After e513cc1 module: Remove stop_machine from module unloading, > module_refcount() is returning (unsigned long)-1 when called from within > a routine that runs in module_exit. This is confusing the scsi device > put code whi

Re: [PATCH 2/4] scsi: annotate sdev_prefix_printk and scmd_printk as printf-like

2015-01-18 Thread Hannes Reinecke
On 01/18/2015 04:11 PM, Christoph Hellwig wrote: > Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes ReineckezSeries & Storage h...@suse.de +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5,

Re: [PATCH 1/4] scsi: always use format argumets for dev_printk

2015-01-18 Thread Hannes Reinecke
On 01/18/2015 04:11 PM, Christoph Hellwig wrote: > Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes ReineckezSeries & Storage h...@suse.de +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5,

Re: [PATCH 3/4] ch: remove debug noise in ch_do_scsi

2015-01-18 Thread Hannes Reinecke
On 01/18/2015 04:11 PM, Christoph Hellwig wrote: > The midlayer logging already prints the cdb details if the logging > level is high enough, no need to duplicate this in the ch driver. > > Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes Reinecke

Re: [PATCH 4/4] sr: reduce debug noise in sr_do_ioctl

2015-01-18 Thread Hannes Reinecke
On 01/18/2015 04:11 PM, Christoph Hellwig wrote: > The midlayer scsi logging already logs the command and sense code > if the logging level is high enough, no need to duplicate that > in the sr driver. > > Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Ha

Re: module: fix module_refcount() return when running in a module exit routine

2015-01-18 Thread Rusty Russell
Masami Hiramatsu writes: > (2015/01/19 1:55), James Bottomley wrote: >> From: James Bottomley >> >> After e513cc1 module: Remove stop_machine from module unloading, >> module_refcount() is returning (unsigned long)-1 when called from within >> a routine that runs in module_exit. This is confusi