Re: [PATCH v3] scsi: storvsc: Removing Pre Win8 related logic

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 
> The latest storvsc code has already removed the support for windows 7 and
> earlier. There is still some code logic reamining which is there to support
> pre Windows 8 OS. This patch removes these stale logic.
> This patch majorly does three things :
> 
> 1. Removes vmscsi_size_delta and its logic, as the vmscsi_request struct is
> same for all the OS post windows 8 there is no need of delta.
> 2. Simplify sense_buffer_size logic, as there is single buffer size for
> all the post windows 8 OS.
> 3. Embed the vmscsi_win8_extension structure inside the vmscsi_request,
> as there is no separate handling required for different OS.
> 
> Signed-off-by: Saurabh Sengar <ssengar@xxxxxxxxxxxxxxxxxxx>
> ---
> v3 : Removed pre win8 macros:
> 	- POST_WIN7_STORVSC_SENSE_BUFFER_SIZE
> 	- VMSTOR_PROTO_VERSION_WIN6
> 	- VMSTOR_PROTO_VERSION_WIN7
> 
>  drivers/scsi/storvsc_drv.c | 152 ++++++++++---------------------------
>  1 file changed, 40 insertions(+), 112 deletions(-)
> 
> diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
> index 5585e9d30bbf..66d9adb5487f 100644
> --- a/drivers/scsi/storvsc_drv.c
> +++ b/drivers/scsi/storvsc_drv.c
> @@ -55,8 +55,6 @@
>  #define VMSTOR_PROTO_VERSION(MAJOR_, MINOR_)	((((MAJOR_) & 0xff) << 8) | \
>  						(((MINOR_) & 0xff)))
>  
> -#define VMSTOR_PROTO_VERSION_WIN6	VMSTOR_PROTO_VERSION(2, 0)
> -#define VMSTOR_PROTO_VERSION_WIN7	VMSTOR_PROTO_VERSION(4, 2)
>  #define VMSTOR_PROTO_VERSION_WIN8	VMSTOR_PROTO_VERSION(5, 1)
>  #define VMSTOR_PROTO_VERSION_WIN8_1	VMSTOR_PROTO_VERSION(6, 0)
>  #define VMSTOR_PROTO_VERSION_WIN10	VMSTOR_PROTO_VERSION(6, 2)

Keeping the macros is ok, could help with diagnosing some future problem?

> @@ -136,19 +134,15 @@ struct hv_fc_wwn_packet {
>   */
>  #define STORVSC_MAX_CMD_LEN			0x10
>  
> -#define POST_WIN7_STORVSC_SENSE_BUFFER_SIZE	0x14
> -#define PRE_WIN8_STORVSC_SENSE_BUFFER_SIZE	0x12
> -
>  #define STORVSC_SENSE_BUFFER_SIZE		0x14
>  #define STORVSC_MAX_BUF_LEN_WITH_PADDING	0x14
>  
>  /*
> - * Sense buffer size changed in win8; have a run-time
> - * variable to track the size we should use.  This value will
> - * likely change during protocol negotiation but it is valid
> - * to start by assuming pre-Win8.
> + * Sense buffer size was differnt pre win8 but those OS are not supported any
> + * more starting 5.19 kernel. This results in to supporting a single value from
> + * win8 onwards.
>   */

Spelling s/differnt/different/
Also the wording has become awkward.

Suggest simpler, shorter comment and make it cons.

/* Sense buffer size is the same for all versions since Windows 8 */
static const int sense_buffer_size = STORVSC_SENSE_BUFFER_SIZE;


> -static int sense_buffer_size = PRE_WIN8_STORVSC_SENSE_BUFFER_SIZE;
> +static int sense_buffer_size = STORVSC_SENSE_BUFFER_SIZE;
>



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux