On Thu, 2017-01-19 at 21:19 +0530, Chaitra P B wrote:
> diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
> b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
> index 5ffbfb1..b3f9f7a 100644
> --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
> +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
> @@ -1096,6 +1096,27 @@ _scsih_scsi_lookup_get_clear(struct MPT3SAS_ADAPTER
> *ioc, u16 smid)
> }
>
> /**
> + * _scsih_scsi_lookup_get_clear_without_lock - returns scmd entry without
> + * holding any lock.
> + * @ioc: per adapter object
> + * @smid: system request message index
> + *
> + * Returns the smid stored scmd pointer.
> + * Then will derefrence the stored scmd pointer.
> + */
> +static inline struct scsi_cmnd *
> +_scsih_scsi_lookup_get_clear_without_lock(struct MPT3SAS_ADAPTER *ioc,
> + u16 smid)
> +{
> + struct scsi_cmnd *scmd;
> +
> + scmd = ioc->scsi_lookup[smid - 1].scmd;
> + ioc->scsi_lookup[smid - 1].scmd = NULL;
> +
> + return scmd;
> +}
Please make the following changes in the above code:
* Use swap() instead of open-coding it.
* Call _scsih_scsi_lookup_get_clear_without_lock() from
_scsih_scsi_lookup_get_clear() to avoid code duplication.
* Fix the spelling of "dereference".
Thanks,
Bart.--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html