Re: [PATCH 110/117] Finalize the switch from 'int' to 'union scsi_status'

Lee Duncan
2021-05-06T18:55:53Z

On 4/19/21 7:13 PM, Bart Van Assche wrote:
> A previous patch changed 'int result;' into a union and introduced the
> scsi_status member in that union. Now that the conversion from type
> 'int' into 'union scsi_status' is complete, remove the 'result' member.
>
> Cc: Christoph Hellwig <hch@lst.de>
> Cc: Ming Lei <ming.lei@redhat.com>
> Cc: Hannes Reinecke <hare@suse.de>
> Cc: John Garry <john.garry@huawei.com>
> Cc: Lee Duncan <lduncan@suse.com>
> Cc: Can Guo <cang@codeaurora.org>
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> ---
> include/linux/bsg-lib.h | 5 +----
> include/scsi/scsi_bsg_iscsi.h | 7 ++-----
> include/scsi/scsi_cmnd.h | 5 +----
> include/scsi/scsi_eh.h | 5 +----
> include/scsi/scsi_request.h | 5 +----
> include/uapi/scsi/scsi_bsg_fc.h | 5 +----
> include/uapi/scsi/scsi_bsg_ufs.h | 7 ++-----
> 7 files changed, 9 insertions(+), 30 deletions(-)
>
> diff --git a/include/linux/bsg-lib.h b/include/linux/bsg-lib.h
> index f934afc45760..6143a54454db 100644
> --- a/include/linux/bsg-lib.h
> +++ b/include/linux/bsg-lib.h
> @@ -53,10 +53,7 @@ struct bsg_job {
> struct bsg_buffer request_payload;
> struct bsg_buffer reply_payload;
>
> - union {
> - int result; /* do not use in new code */
> - union scsi_status status;
> - };
> + union scsi_status status;
> unsigned int reply_payload_rcv_len;
>
> /* BIDI support */
> diff --git a/include/scsi/scsi_bsg_iscsi.h b/include/scsi/scsi_bsg_iscsi.h
> index d18e7e061927..e384df88fab1 100644
> --- a/include/scsi/scsi_bsg_iscsi.h
> +++ b/include/scsi/scsi_bsg_iscsi.h
> @@ -76,17 +76,14 @@ struct iscsi_bsg_request {
> /* response (request sense data) structure of the sg_io_v4 */
> struct iscsi_bsg_reply {
> /*
> - * The completion result. Result exists in two forms:
> + * The completion status. Result exists in two forms:
> * if negative, it is an -Exxx system errno value. There will
> * be no further reply information supplied.
> * else, it's the 4-byte scsi error result, with driver, host,
> * msg and status fields. The per-msgcode reply structure
> * will contain valid data.
> */
> - union {
> - uint32_t result; /* do not use in new code */
> - union scsi_status status;
> - };
> + union scsi_status status;
>
> /* If there was reply_payload, how much was recevied ? */
> uint32_t reply_payload_rcv_len;
> diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h
> index 539be97b0a7d..b616e1d8af9a 100644
> --- a/include/scsi/scsi_cmnd.h
> +++ b/include/scsi/scsi_cmnd.h
> @@ -141,10 +141,7 @@ struct scsi_cmnd {
> * to be at an address < 16Mb). */
>
> /* Status code from lower level driver */
> - union {
> - int result; /* do not use in new code. */
> - union scsi_status status;
> - };
> + union scsi_status status;
> int flags; /* Command flags */
> unsigned long state; /* Command completion state */
>
> diff --git a/include/scsi/scsi_eh.h b/include/scsi/scsi_eh.h
> index dcd66bb9a1ba..406e22887d96 100644
> --- a/include/scsi/scsi_eh.h
> +++ b/include/scsi/scsi_eh.h
> @@ -33,10 +33,7 @@ extern int scsi_ioctl_reset(struct scsi_device *, int __user *);
>
> struct scsi_eh_save {
> /* saved state */
> - union {
> - int result; /* do not use in new code */
> - union scsi_status status;
> - };
> + union scsi_status status;
> unsigned int resid_len;
> int eh_eflags;
> enum dma_data_direction data_direction;
> diff --git a/include/scsi/scsi_request.h b/include/scsi/scsi_request.h
> index 83f5549cc74c..41b8f9f6a349 100644
> --- a/include/scsi/scsi_request.h
> +++ b/include/scsi/scsi_request.h
> @@ -11,10 +11,7 @@ struct scsi_request {
> unsigned char __cmd[BLK_MAX_CDB];
> unsigned char *cmd;
> unsigned short cmd_len;
> - union {
> - int result; /* do not use in new code */
> - union scsi_status status;
> - };
> + union scsi_status status;
> unsigned int sense_len;
> unsigned int resid_len; /* residual count */
> int retries;
> diff --git a/include/uapi/scsi/scsi_bsg_fc.h b/include/uapi/scsi/scsi_bsg_fc.h
> index 419db719fe8e..6d095aefc265 100644
> --- a/include/uapi/scsi/scsi_bsg_fc.h
> +++ b/include/uapi/scsi/scsi_bsg_fc.h
> @@ -295,10 +295,7 @@ struct fc_bsg_reply {
> * will contain valid data.
> */
> #ifdef __KERNEL__
> - union {
> - __u32 result; /* do not use in new kernel code */
> - union scsi_status status;
> - };
> + union scsi_status status;
> #else
> __u32 result;
> #endif
> diff --git a/include/uapi/scsi/scsi_bsg_ufs.h b/include/uapi/scsi/scsi_bsg_ufs.h
> index 3dfe5a5a0842..1c282ab144f6 100644
> --- a/include/uapi/scsi/scsi_bsg_ufs.h
> +++ b/include/uapi/scsi/scsi_bsg_ufs.h
> @@ -92,7 +92,7 @@ struct ufs_bsg_request {
> /* response (request sense data) structure of the sg_io_v4 */
> struct ufs_bsg_reply {
> /*
> - * The completion result. Result exists in two forms:
> + * The completion status. Exists in two forms:
> * if negative, it is an -Exxx system errno value. There will
> * be no further reply information supplied.
> * else, it's the 4-byte scsi error result, with driver, host,
> @@ -100,10 +100,7 @@ struct ufs_bsg_reply {
> * will contain valid data.
> */
> #ifdef __KERNEL__
> - union {
> - __u32 result; /* do not use in new kernel code */
> - union scsi_status status;
> - };
> + union scsi_status status;
> #else
> __u32 result;
> #endif
>

Reviewed-by: Lee Duncan <lduncan@suse.com>