[PATCH] scsi: core: drop excess unlikely() from BUG_ON()

2018-09-14 Thread Nicholas Mc Guire
include/asm-generic/bug.h defines BUG_ON(condition) as do { if (unlikely(condition)) BUG(); } while (0). So BUG_ON already provides unlikely() to the condition so there is no point in having a unlikely(unlikely(condition)) - drop the excess unlikely() Signed-off-by: Nicholas Mc Guire --- Found

[PATCH] qla4xxx: drop redundant init_completion

2017-03-22 Thread Nicholas Mc Guire
The redundant init_completion() here seems to be a cut&past error as struct scsi_qla_host only has 4 completion elements to initialize, thus the duplicate init_completion(disable_acb_comp) is simply removed. Signed-off-by: Nicholas Mc Guire --- Found by experimental coccinelle sc

possible if/else bug in dc395x.c

2016-10-16 Thread Nicholas Mc Guire
Hi ! in drivers/scsi/dc395x.c:srb_done() 3387 if (srb->total_xfer_length 3388 && srb->total_xfer_length >= cmd->underflow) 3389 cmd->result = 3390 MK_RES_LNX(DRIVER_SENSE, DID_OK, 3391

[BUG ?] pmcraid: condition with no effect

2015-06-13 Thread Nicholas Mc Guire
scanning for trivial bug-patters with coccinelle spatches returned: ./drivers/scsi/pmcraid.c:1603 WARNING: condition with no effect (if branch == else) introduced in 'commit c20c426732a5 ("[SCSI] pmcraid: MSI-X support and other changes")' drivers/scsi/pmcraid.c - line numbers from 4.1-

[PATCH] qla4xxx: pass timeout as HZ independent value

2015-05-27 Thread Nicholas Mc Guire
4.1-rc5 (localversion-next is -next-20150527) Signed-off-by: Nicholas Mc Guire --- As there is no documentation of the intended timeout it might be wrong to convert it with msecs_to_jiffies as this can reduces the actual jiffies value by at least a factor of 10 - so someone that knows this driver

[PATCH RESEND] scsi: qla4xxx: drop duplicate init_completion

2015-03-16 Thread Nicholas Mc Guire
-off-by: Nicholas Mc Guire --- Originally posted as http://lkml.org/lkml/2014/12/23/355 Patch was only compile-tested with x86_64_defconfig + CONFIG_SCSI_LOWLEVEL=y, CONFIG_SCSI_QLA_ISCSI=m Patch is against 4.0-rc3 (localversion-next is -next-20150316 drivers/scsi/qla4xxx/ql4_os.c |1 - 1 file

[PATCH] scsi: match wait_for_completion_timeout return type

2015-03-11 Thread Nicholas Mc Guire
wait_for_completion_timeout returns unsigned long not int. As other instances of wait_for_completion_timeout in fc_fcp.c use ticks_left of appropriate type, this name is used here as well. Signed-off-by: Nicholas Mc Guire --- Patch was only compile tested with x86_64_defconfig + SCSI_LOWLEVEL=y

RFC scsi: aic94xx: use of complete() looks racy

2015-03-09 Thread Nicholas Mc Guire
Hi ! while reviewing some type missmatch of wait_for_completion_timeout in drivers/scsi/aic94xx/aic94xx_tmf.c:asd_clear_nexus() a question regarding the struct completion use came up: (line numbers are from 4.0-rc2 linux-next) 351 tascb->completion = &completion; 352 353 ASD_DPRINTK(

[PATCH] aic94xx: match wait_for_completion_timeout return type

2015-03-09 Thread Nicholas Mc Guire
return type of wait_for_completion_timeout is unsigned long not int. As leftover is used exclusively for wait_for_completion_timeout its type is simply changed to unsigned long. Signed-off-by: Nicholas Mc Guire --- This was only compile tested for x86_64_defconfig + CONFIG_SCSI_LOWLEVEL=y

[PATCH 2/2] bnx2fc: bnx2fc_io.c: match wait_for_completion_timeout return type

2015-03-04 Thread Nicholas Mc Guire
return type of wait_for_completion_timeout is unsigned long not int. An appropriately named variable of type unsigned long is added and the assignments fixed up. Signed-off-by: Nicholas Mc Guire --- The was only complie tested with x86_64_defconfig + SCSI_LOWLEVEL CONFIG_SCSI_FC_ATTRS=m

[PATCH 2/2] bnx2fc: bnx2fc_io.c: match wait_for_completion_timeout return type

2015-03-04 Thread Nicholas Mc Guire
return type of wait_for_completion_timeout is unsigned long not int. An appropriately named variable of type unsigned long is added and the assignments fixed up. Signed-off-by: Nicholas Mc Guire --- The was only compile tested with x86_64_defconfig + SCSI_LOWLEVEL CONFIG_SCSI_FC_ATTRS=m

[PATCH 1/2] bnx2fc: bnx2fc_fcoe.c: match wait_for_completion_timeout return type

2015-03-04 Thread Nicholas Mc Guire
return type of wait_for_completion_timeout is unsigned long not int. rc is appropriately renamed, changed to type unsigned long and the assignments fixed up. Signed-off-by: Nicholas Mc Guire --- The was only compile tested with x86_64_defconfig + SCSI_LOWLEVEL CONFIG_SCSI_FC_ATTRS=m

[PATCH] storvsc: assign wait_for_completion_timeout to appropriately typed var

2015-02-04 Thread Nicholas Mc Guire
wait_for_completion_timeout() returns unsigned long not int. This assigns the return value to an appropriately typed variable. Signed-off-by: Nicholas Mc Guire --- As a suitable typed and named variable "timeout" is available and there is no conflict in this case no new variable

[PATCH v4] scsi: NCR5380: harmonize jiffies conversion with msecs_to_jiffies

2015-02-04 Thread Nicholas Mc Guire
Instances of var * HZ / 1000 are replaced by msecs_to_jiffies(var). In addition some timing constants that assumed HZ 100 were adjusted to HZ independent settings based on review comments from Michael Schmitz and review of the original drivers in 1.0.31 and 2.2.16. Signed-off-by: Nicholas Mc

[PATCH v3] scsi: NCR5380: use msecs_to_jiffies for conversions

2015-02-03 Thread Nicholas Mc Guire
. Signed-off-by: Nicholas Mc Guire --- v2: the original patch was not taking care of all the dependencies as reported by Finn Thain - this version now uses the suggested config to check the patch. v3: g_NCR5380.c changes fixed up based on feedback from Michael Schmitz as these settings

Re: [PATCH v2] scsi: NCR5380: use msecs_to_jiffies for conversions

2015-02-01 Thread Nicholas Mc Guire
On Mon, 02 Feb 2015, Michael Schmitz wrote: > Hi Nicholas, > > >> The values for USLEEP_* are taken to be in units jiffies, according to > >> comments in NCR5380.c. Replacing them by the msecs_to_jiffies conversion > >> is in fact wrong. > >> > >> Please drop the changes to g_NCR5380.c for that r

Re: [PATCH v2] scsi: NCR5380: use msecs_to_jiffies for conversions

2015-01-31 Thread Nicholas Mc Guire
On Sun, 01 Feb 2015, Michael Schmitz wrote: > Finn, Nicholas, > >> On Sat, 31 Jan 2015, Nicholas Mc Guire wrote: >> >>> This is only an API consolidation to make things more readable. >>> >>> Instances of var * HZ / 1000 are replaced by msecs_to_

[PATCH v2] scsi: NCR5380: use msecs_to_jiffies for conversions

2015-01-31 Thread Nicholas Mc Guire
This is only an API consolidation to make things more readable. Instances of var * HZ / 1000 are replaced by msecs_to_jiffies(var). Signed-off-by: Nicholas Mc Guire v2: the original patch was not taking care of all the dependencies as reported by Finn Thain - this version now uses

[PATCH] scsi: ncr5380: use msecs_to_jiffies for conversions

2015-01-22 Thread Nicholas Mc Guire
This is only an API consolidation to make things more readable Signed-off-by: Nicholas Mc Guire --- Converting milliseconds to jiffies by "val * HZ / 1000" is technically ok but msecs_to_jiffies(val) is the cleaner solution and handles all corner cases correctly. This is a minor A

[PATCH v3] scsi: mpt2sas: wait_for_completion_timeout timeout not reported

2014-12-31 Thread Nicholas Mc Guire
linux-next 3.19.0-rc1 -next-20141226 Acked-by: Joe Lawrence Signed-off-by: Nicholas Mc Guire --- drivers/scsi/mpt2sas/mpt2sas_config.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/mpt2sas/mpt2sas_config.c b/drivers/scsi/mpt2sas/mpt2sas_config.c index

[PATCH v3] scsi: mpt3sas: wait_for_completion_timeout timeout not reported

2014-12-31 Thread Nicholas Mc Guire
linux-next 3.19.0-rc1 -next-20141226 Acked-by: Joe Lawrence Signed-off-by: Nicholas Mc Guire --- drivers/scsi/mpt3sas/mpt3sas_config.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_config.c b/drivers/scsi/mpt3sas/mpt3sas_config.c index

[SCSI] mpt2sas: wait_for_completion_timeout timeout not reported

2014-12-30 Thread Nicholas Mc Guire
-next-20141226 Signed-off-by: Nicholas Mc Guire --- drivers/scsi/mpt2sas/mpt2sas_config.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/mpt2sas/mpt2sas_config.c b/drivers/scsi/mpt2sas/mpt2sas_config.c index c72a2ff..02dc2d8 100644 --- a/drivers/scsi/mpt2sas

[SCIS] mpt3sas: wait_for_completion_timeout timeout not reported

2014-12-30 Thread Nicholas Mc Guire
-rc1 -next-20141226 Signed-off-by: Nicholas Mc Guire --- drivers/scsi/mpt3sas/mpt3sas_config.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_config.c b/drivers/scsi/mpt3sas/mpt3sas_config.c index 4472c2a..04ff21b 100644 --- a/drivers/scsi

[SCSI] aha152x: cleanup on stack DECLARE_COMPLETION

2014-12-29 Thread Nicholas Mc Guire
ile tested with i386_defconfig + CONFIG_ISA=y SCSI_LOWLEVEL=y, CONFIG_SCSI_AHA152X=y Signed-off-by: Nicholas Mc Guire --- drivers/scsi/aha152x.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) create mode 100644 fixups diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c ind

[SCSI RFC] mpt2sas: wait_for_completion_timeout timeout not reported

2014-12-29 Thread Nicholas Mc Guire
: Nicholas Mc Guire --- drivers/scsi/mpt2sas/mpt2sas_config.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/mpt2sas/mpt2sas_config.c b/drivers/scsi/mpt2sas/mpt2sas_config.c index c72a2ff..02dc2d8 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_config.c +++ b/drivers

[PATCH] scsi: unnecessary double init_completion removed

2014-12-23 Thread Nicholas Mc Guire
a valid e-mail address. Signed-off-by: Nicholas Mc Guire --- drivers/scsi/qla4xxx/ql4_os.c |1 - 1 file changed, 1 deletion(-) diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c index 6d25879..0c1da76 100644 --- a/drivers/scsi/qla4xxx/ql4_os.c +++ b/drivers/scsi/

[PATCH] cleanup on stack DECLARE_COMPLETIONs

2014-12-23 Thread Nicholas Mc Guire
viewed and compile tested Signed-off-by: Nicholas Mc Guire --- drivers/macintosh/ams/ams-pmu.c |4 ++-- drivers/misc/sgi-gru/grukservices.c |2 +- drivers/scsi/aha152x.c|2 +- drivers/usb/gadget/udc/fsl_qe_udc.c |2 +- drivers/usb/gadget/udc/fsl_udc_core.c |