aboutsummaryrefslogtreecommitdiffstats
path: root/drivers (follow)
AgeCommit message (Collapse)AuthorFilesLines
2017-08-29scsi: scsi_transport_sas: switch to bsg-lib for SMP passthroughChristoph Hellwig7-376/+240
Simplify the SMP passthrough code by switching it to the generic bsg-lib helpers that abstract away the details of the request code, and gets drivers out of seeing struct scsi_request. For the libsas host SMP code there is a small behavior difference in that we now always clear the residual len for successful commands, similar to the three other SMP handler implementations. Given that there is no partial command handling in the host SMP handler this should not matter in practice. [mkp: typos and checkpatch fixes] Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-29scsi: smartpqi: remove the smp_handler stubChristoph Hellwig1-9/+0
The SAS transport class will do the right thing and not register the BSG node if now smp_handler method is present. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-29scsi: hpsa: remove the smp_handler stubChristoph Hellwig1-9/+0
The SAS transport class will do the right thing and not register the BSG node if now smp_handler method is present. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Acked-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-29scsi: bsg-lib: pass the release callback through bsg_setup_queueChristoph Hellwig2-3/+5
The SAS code will need it. Also mark the name argument const to match bsg_register_queue. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-29scsi: Rework handling of scsi_device.vpd_pg8[03]Bart Van Assche3-43/+46
Introduce struct scsi_vpd for the VPD page length, data and the RCU head that will be used to free the VPD data. Use kfree_rcu() instead of kfree() to free VPD data. Move the VPD buffer pointer check inside the RCU read lock in the sysfs code. Only annotate pointers that are shared across threads with __rcu. Use rcu_dereference() when dereferencing an RCU pointer. This patch suppresses about twenty sparse complaints about the vpd_pg8[03] pointers. This patch also fixes a race condition, namely that updating of the VPD pointers and length variables in struct scsi_device was not atomic with reference to the code reading these variables. See also "Does the update code tolerate concurrent accesses?" in Documentation/RCU/checklist.txt. Fixes: commit 09e2b0b14690 ("scsi: rescan VPD attributes") Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com> Acked-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Shane Seymour <shane.seymour@hpe.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Johannes Thumshirn <jthumshirn@suse.de> Cc: Shane Seymour <shane.seymour@hpe.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-29scsi: Rework the code for caching Vital Product Data (VPD)Bart Van Assche1-78/+66
Introduce the scsi_get_vpd_buf() and scsi_update_vpd_page() functions. The only functional change in this patch is that if updating page 0x80 fails that it is attempted to update page 0x83. Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com> Acked-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Shane Seymour <shane.seymour@hpe.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Johannes Thumshirn <jthumshirn@suse.de> Cc: Shane M Seymour <shane.seymour@hpe.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-28scsi: qlogicpti: fixup qlogicpti_reset() definitionHannes Reinecke1-1/+2
A merge error crept in when formatting commit af167bc ("scsi: qlogicpti: move bus reset to host reset") Fixes: af167bc ("scsi: qlogicpti: move bus reset to host reset") Signed-off-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-25scsi: lpfc: avoid false-positive gcc-8 warningArnd Bergmann1-3/+3
This is an interesting regression with gcc-8, showing a harmless warning for correct code: In file included from include/linux/kernel.h:13:0, ... from drivers/scsi/lpfc/lpfc_debugfs.c:23: include/linux/printk.h:301:2: error: 'eq' may be used uninitialized in this function [-Werror=maybe-uninitialized] printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) ^~~~~~ In file included from drivers/scsi/lpfc/lpfc_debugfs.c:58:0: drivers/scsi/lpfc/lpfc_debugfs.h:451:31: note: 'eq' was declared here I managed to reduce the warning into a small test case for gcc-8 that I reported in the gcc bugzilla[1]. As a workaround, this changes the logic to move the two assignments of 'eq' out of the conditions and instead make the index conditional. This works for all configurations I tried and avoids adding a bogus initialization. Acked-by: James Smart <james.smart@broadcom.com> Link: [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81958 Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-25scsi: lpfc: avoid an unused function warningArnd Bergmann1-2/+3
The only reference to lpfc_nvmet_replenish_context() is inside of an disabled: drivers/scsi/lpfc/lpfc_nvmet.c:1457:1: error: 'lpfc_nvmet_replenish_context' defined but not used [-Werror=unused-function] This replaces the preprocessor conditional with a C condition, so the compiler can see that the function is intentionally unused. Fixes: 9a38e4f1c82f ("scsi: lpfc: Fix MRQ > 1 context list handling") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-25scsi: cxlflash: Fix vlun resize failure in the shrink pathUma Krishnan1-5/+1
The ioctl DK_CAPI_VLUN_RESIZE can fail if the allocated vlun size is reduced from almost maximum capacity and then increased again. The shrink_lxt() routine is currently using the SISL_ASTATUS_MASK to mask the higher 48 bits of the lxt entry. This is unnecessary and incorrect as it uses a mask designed for the asynchronous interrupt status register. When the 4 port support was added to cxlflash, the SISL_ASTATUS_MASK was updated to reflect the status bits for all 4 ports. This change indirectly affected the shrink_lxt() code path. To extract the base, simply shift the bits without masking. Fixes: 565180723294 ("scsi: cxlflash: SISlite updates to support 4 ports") Signed-off-by: Uma Krishnan <ukrishn@linux.vnet.ibm.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-25scsi: cxlflash: Avoid double mutex unlockMatthew R. Ochs1-3/+10
The AFU recovery routine uses an interruptible mutex to control the flow of in-flight recoveries. Upon receiving an interruptible signal the code branches to a common exit path which wrongly assumes the mutex is held. Add a local variable to track when the mutex should be unlocked. Signed-off-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Signed-off-by: Uma Krishnan <ukrishn@linux.vnet.ibm.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-25scsi: cxlflash: Remove unnecessary existence checkMatthew R. Ochs1-2/+1
The AFU termination sequence has been refactored over time such that the main tear down routine, term_afu(), can no longer can be invoked with a NULL AFU pointer. Remove the unnecessary existence check from term_afu(). Signed-off-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Signed-off-by: Uma Krishnan <ukrishn@linux.vnet.ibm.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-25scsi: ibmvfc: ibmvscsi: ibmvscsi_tgt: constify vio_device_idArvind Yadav3-3/+3
vio_device_id are not supposed to change at runtime. All functions working with vio_device_id provided by <asm/vio.h> work with const vio_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-25scsi: Fix the kerneldoc for scsi_initialize_rq()Jonathan Corbet1-0/+1
The kerneldoc comment for scsi_initialize_rq() neglected to document the "rq" parameter, leading to this docs build warning: ./drivers/scsi/scsi_lib.c:1116: warning: No description found for parameter 'rq' Document the parameter and make the build slightly quieter. [mkp: used wording suggested by Bart] Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-25scsi: ses: Fix racy cleanup of /sys in remove_dev()Calvin Owens1-2/+1
Currently we free the resources backing the enclosure device before we call device_unregister(). This is racy: during rmmod of low-level SCSI drivers that hook into enclosure, we end up with a small window of time during which writing to /sys can OOPS. Example trace with mpt3sas: general protection fault: 0000 [#1] SMP KASAN Modules linked in: mpt3sas(-) <...> RIP: [<ffffffffa0388a98>] ses_get_page2_descriptor.isra.6+0x38/0x220 [ses] Call Trace: [<ffffffffa0389d14>] ses_set_fault+0xf4/0x400 [ses] [<ffffffffa0361069>] set_component_fault+0xa9/0xf0 [enclosure] [<ffffffff8205bffc>] dev_attr_store+0x3c/0x70 [<ffffffff81677df5>] sysfs_kf_write+0x115/0x180 [<ffffffff81675725>] kernfs_fop_write+0x275/0x3a0 [<ffffffff8151f810>] __vfs_write+0xe0/0x3e0 [<ffffffff8152281f>] vfs_write+0x13f/0x4a0 [<ffffffff81526731>] SyS_write+0x111/0x230 [<ffffffff828b401b>] entry_SYSCALL_64_fastpath+0x13/0x94 Fortunately the solution is extremely simple: call device_unregister() before we free the resources, and the race no longer exists. The driver core holds a reference over ->remove_dev(), so AFAICT this is safe. Signed-off-by: Calvin Owens <calvinowens@fb.com> Acked-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-25scsi: mptsas: Fixup device hotplug for VMWare ESXiHannes Reinecke1-4/+3
VMWare ESXi emulates an mptsas HBA, but exposes all drives as direct-attached SAS drives. This it not how the driver originally envisioned things; SAS drives were supposed to be connected via an expander, and only SATA drives would be direct attached. As such, any hotplug event for direct-attach SAS drives was silently ignored, and the guest failed to detect new drives from within a VMWare ESXi environment. [mkp: typos] Bugzilla: https://bugzilla.suse.com/show_bug.cgi?id=1030850 Signed-off-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-25scsi: make device_type constBhumika Goyal2-4/+4
Make these const as they are only stored in the type field of a device structure, which is const. Done using Coccinelle. Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-25scsi: sd: remove duplicated setting of gd->minorsweiping zhang1-1/+0
gd->minors has been set when call alloc_disk() in sd_probe. Signed-off-by: weiping zhang <zhangweiping@didichuxing.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-25scsi: eata: remove 'arg_done' from eata2x_eh_host_reset()Hannes Reinecke1-8/+1
Just displaying some different information; drop it. Signed-off-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-25scsi: visorhba: sanitze private device data allocationHannes Reinecke1-70/+53
There's no need to keep the private data for a device in a separate list; better to store it in ->hostdata and do away with the additional list. Signed-off-by: Hannes Reinecke <hare@suse.com> Reviewed-by: David Kershner <david.kershner@unisys.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-25scsi: megaraid_mbox: drop duplicate bus reset and device reset functionHannes Reinecke1-2/+0
megaraid_mbox only has one reset function, and that is a host reset. So drop the duplicate bus reset and device reset functions. Signed-off-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-25scsi: bnx2fc: remove obsolete bnx2fc_eh_host_reset() definitionHannes Reinecke1-1/+0
Never used anywhere. Signed-off-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-25scsi: 53c700: move bus reset to host resetHannes Reinecke1-20/+3
bus reset always returns SUCCESS, meaning host reset was never tested. At the same time the only difference to the HBA is a missing call to NCR_700_chip_reset(). So add the missing call to bus reset, drop host reset, and move bus reset to host reset. Signed-off-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-25scsi: aha152x: drop host resetHannes Reinecke1-10/+3
The driver has both a bus and a host reset, where the host reset does a bus reset followed by an attempt to reset the chip registers to a default state. However, as the bus reset always returned SUCCESS the host reset was never called, so the functionality of the register reset function was never validated. Additionally, tha AIC-6260 chip has a hard reset line, which actually should be preferred for a host reset. But I haven't found a way how this can be triggered via software, so take the safe approach and drop the host reset. [mkp: typo] Signed-off-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-25scsi: nsp32: drop bus resetHannes Reinecke1-21/+1
bus reset is a host reset without nsp32hw_init(), and will always return SUCCESS, thus disabling the use of host reset. So drop bus reset in favour of host reset. Signed-off-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-25scsi: qedf: drop bus reset handlerHannes Reinecke1-11/+0
qedf has a host reset handler, but as the bus reset handler is a stub always returning SUCCESS the host reset is never invoked. So drop the bus reset handler. Signed-off-by: Hannes Reinecke <hare@suse.com> Tested-by: Chad Dupuis <chad.dupuis@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-25scsi: ppa: drop duplicate bus_reset handlerHannes Reinecke1-1/+0
bus_reset and host_reset are the same functions, so drop bus_reset. Signed-off-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-25scsi: imm: drop duplicate bus_reset handlerHannes Reinecke1-1/+0
host_reset and bus_reset is the same function, so drop bus reset. Signed-off-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-25scsi: qlogicfas: move bus_reset to host_resetHannes Reinecke4-7/+7
The bus reset handler is really a host reset. Signed-off-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-25scsi: NCR5380: Move bus reset to host resetHannes Reinecke8-14/+14
The bus reset handler really is a host reset, so move it to eh_bus_reset_handler. Signed-off-by: Hannes Reinecke <hare@suse.com> Acked-by: Finn Thain <fthain@telegraphics.com.au> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-25scsi: acornscsi: move bus reset to host resetHannes Reinecke1-5/+6
The bus reset function is really a host reset, so move it to eh_host_reset_handler. Signed-off-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-25scsi: qlogicpti: move bus reset to host resetHannes Reinecke1-3/+2
The bus reset function really is a host reset, so move it to eh_host_reset_handler(). Signed-off-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-25scsi: rtsx: drop bus reset functionHannes Reinecke1-11/+0
Function is a stub, so can as well be dropped. Signed-off-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-25scsi: drop bus reset for wd33c93-compatible boardsHannes Reinecke6-83/+2
The bus reset function is just a wrapper calling host reset under the host lock. So move taking of the host lock into the host reset function and drop bus reset. Signed-off-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-25scsi: fdomain: move bus reset to host resetHannes Reinecke3-5/+5
The bus reset function really is a host reset, so move it to eh_host_reset_handler(). Signed-off-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-25scsi: hptiop: Simplify reset handlingHannes Reinecke1-7/+4
The Highpoint driver only has one reset function, and that is a host reset. So stop pretending we're doing anything else. Signed-off-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-25scsi: bfa: move bus reset to target resetHannes Reinecke1-22/+15
The bus reset handler is just calling target reset on all targets, which is exactly what SCSI EH will be doing anyway. So move the bus reset function to target reset and drop the loop. Signed-off-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-25scsi: libsas: move bus_reset_handler() to target_reset_handler()Hannes Reinecke6-11/+11
The bus reset handler is calling I_T Nexus reset, which logically is a target reset as it need to specify both the initiator and the target. So move it to target reset. Signed-off-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-25scsi: uas: move eh_bus_reset_handler to eh_device_reset_handlerHannes Reinecke1-2/+2
The bus_reset handler is really a device reset, so move it to eh_device_reset_handler(). Signed-off-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-25scsi: fnic: do not call host reset from command abortHannes Reinecke1-4/+0
Command abort already returns FAILED, which will then be escalated to a host reset. So no need to call host_reset directly. Signed-off-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-25scsi: fc_fcp: do not call fc_block_scsi_eh() from host resetHannes Reinecke1-2/+0
When calling host reset we're resetting all ports anyway, so there is no point in waiting for the ports to become unblocked. Signed-off-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-25scsi: ibmvfc: Do not call fc_block_scsi_eh() on host resetHannes Reinecke1-5/+1
When we're resetting the host any remote port states will be reset anyway, so it's pointless to wait for dev_loss_tmo during host reset. Signed-off-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-25scsi: mptfc: Do not call fc_block_scsi_eh() on host resetHannes Reinecke1-9/+1
When we're resetting the host any remote port states will be reset anyway, so it's pointless to wait for dev_loss_tmo during host reset. Signed-off-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-25scsi: fix comment in scsi_device_set_state()Hannes Reinecke1-1/+1
The function returns '0' if successful; with the original comment the function doesn't have a way to indicate success ... Signed-off-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Bart van Assche <bvanassche@wdc.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-25scsi: iscsi_tcp: Remove a set-but-not-used variableBart Van Assche1-2/+0
This patch avoids that gcc reports the following warning when building with W=1: drivers/scsi/iscsi_tcp.c:166:24: warning: variable ?session? set but not used [-Wunused-but-set-variable] Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Hannes Reinecke <hare@suse.com> Cc: Lee Duncan <lduncan@suse.com> Cc: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-25scsi: scsi_debug: Remove a set-but-not-used variableBart Van Assche1-2/+1
This patch avoids that gcc reports the following warning when building with W=1: drivers/scsi/scsi_debug.c:2264:15: warning: variable ?pcontrol? set but not used [-Wunused-but-set-variable] Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Hannes Reinecke <hare@suse.com> Cc: Douglas Gilbert <dgilbert@interlog.com> Cc: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-25scsi: scsi_transport_srp: Suppress a W=1 compiler warningBart Van Assche1-1/+1
Avoid that the following compiler warning is reported when building with W=1: drivers/scsi/scsi_transport_srp.c:92:19: warning: comparison is always false due to limited range of data type [-Wtype-limits] Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Cc: Hannes Reinecke <hare@suse.de> Cc: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-25scsi: scsi_transport_sas: Check kzalloc() return valueBart Van Assche1-0/+3
Check whether memory allocation succeeded before dereferencing the pointer to the allocated memory. Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Hannes Reinecke <hare@suse.com> Cc: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-25scsi: libsas: Annotate fall-through in a switch statementBart Van Assche1-0/+1
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Hannes Reinecke <hare@suse.com> Cc: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-08-25scsi: libsas: Remove a set-but-not-used variableBart Van Assche1-3/+0
This was detected by building with W=1. Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Cc: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>