[PATCH 3/6] ibmvscsi: Replace magic values in set_adpater_info() with defines

Johannes Thumshirn jthumshirn at suse.de
Thu Feb 4 19:44:59 AEDT 2016


On Wed, Feb 03, 2016 at 05:28:31PM -0600, Tyrel Datwyler wrote:
> Add defines for mad version and mad os_type, and replace the magic
> numbers in set_adapter_info() accordingly.
> 
> Signed-off-by: Tyrel Datwyler <tyreld at linux.vnet.ibm.com>
> ---
>  drivers/scsi/ibmvscsi/ibmvscsi.c | 4 ++--
>  drivers/scsi/ibmvscsi/viosrp.h   | 2 ++
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c
> index 176260d..7e51615 100644
> --- a/drivers/scsi/ibmvscsi/ibmvscsi.c
> +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
> @@ -283,8 +283,8 @@ static void set_adapter_info(struct ibmvscsi_host_data *hostdata)
>  	hostdata->madapter_info.partition_number =
>  					cpu_to_be32(partition_number);
>  
> -	hostdata->madapter_info.mad_version = cpu_to_be32(1);
> -	hostdata->madapter_info.os_type = cpu_to_be32(2);
> +	hostdata->madapter_info.mad_version = cpu_to_be32(SRP_MAD_VERSION_1);
> +	hostdata->madapter_info.os_type = cpu_to_be32(SRP_MAD_OS_LINUX);
>  }
>  
>  /**
> diff --git a/drivers/scsi/ibmvscsi/viosrp.h b/drivers/scsi/ibmvscsi/viosrp.h
> index 17f2de0..da9bb29 100644
> --- a/drivers/scsi/ibmvscsi/viosrp.h
> +++ b/drivers/scsi/ibmvscsi/viosrp.h
> @@ -38,6 +38,8 @@
>  #define SRP_VERSION "16.a"
>  #define SRP_MAX_IU_LEN	256
>  #define SRP_MAX_LOC_LEN 32
> +#define SRP_MAD_VERSION_1 1
> +#define SRP_MAD_OS_LINUX 2
>  
>  union srp_iu {
>  	struct srp_login_req login_req;
> -- 
> 2.5.0
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reviewed-by: Johannes Thumshirn <jthumshirn at suse.de>
-- 
Johannes Thumshirn                                          Storage
jthumshirn at suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850


More information about the Linuxppc-dev mailing list