All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Hannes Reinecke <hare@suse.de>,
	"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>,
	James Bottomley <james.bottomley@hansenpartnership.com>,
	linux-scsi@vger.kernel.org
Subject: Re: [PATCH 05/24] scsi: use standard SAM status codes
Date: Fri, 1 Nov 2019 09:26:13 -0700	[thread overview]
Message-ID: <8c3245df-97e3-95aa-498f-4ed47db96132@acm.org> (raw)
In-Reply-To: <20191031110452.73463-6-hare@suse.de>

On 10/31/19 4:04 AM, Hannes Reinecke wrote:
> Use standard SAM status codes and omit the explicit shift to convert
> to linux-specific ones.

Isn't an explicit shift required to convert *from* linux-specific codes 
instead of for converting *to* linux-specific ones?

>   drivers/ata/libata-scsi.c             |  2 +-
>   drivers/infiniband/ulp/srp/ib_srp.c   |  2 +-
>   drivers/scsi/3w-9xxx.c                |  5 +++--
>   drivers/scsi/3w-sas.c                 |  3 ++-
>   drivers/scsi/3w-xxxx.c                |  4 ++--
>   drivers/scsi/arcmsr/arcmsr_hba.c      |  4 ++--
>   drivers/scsi/bfa/bfad_im.c            |  2 +-
>   drivers/scsi/dc395x.c                 | 18 +++++-------------
>   drivers/scsi/dpt_i2o.c                |  2 +-
>   drivers/scsi/gdth.c                   | 12 ++++++------
>   drivers/scsi/megaraid.c               | 10 +++++-----
>   drivers/scsi/megaraid/megaraid_mbox.c | 12 ++++++------
>   drivers/scsi/pcmcia/nsp_cs.c          |  2 +-
>   13 files changed, 36 insertions(+), 42 deletions(-)

Should this patch be split into one patch per driver such? If this patch 
would introduce a regression that will make it easier to address such 
regressions. Splitting this patch will also make reviewing easier.

> diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c
> index 3337b1e80412..ada77c136f8b 100644
> --- a/drivers/scsi/3w-9xxx.c
> +++ b/drivers/scsi/3w-9xxx.c
> @@ -1018,7 +1018,8 @@ static int twa_fill_sense(TW_Device_Extension *tw_dev, int request_id, int copy_
>   
>   	if (copy_sense) {
>   		memcpy(tw_dev->srb[request_id]->sense_buffer, full_command_packet->header.sense_data, TW_SENSE_DATA_LENGTH);
> -		tw_dev->srb[request_id]->result = (full_command_packet->command.newcommand.status << 1);
> +		tw_dev->srb[request_id]->result =
> +			full_command_packet->command.newcommand.status;
>   		retval = TW_ISR_DONT_RESULT;
>   		goto out;
>   	}

Does this change preserve the behavior of this LLD?

> diff --git a/drivers/scsi/3w-sas.c b/drivers/scsi/3w-sas.c
> index dda6fa857709..d11f62c60877 100644
> --- a/drivers/scsi/3w-sas.c
> +++ b/drivers/scsi/3w-sas.c
> @@ -891,7 +891,8 @@ static int twl_fill_sense(TW_Device_Extension *tw_dev, int i, int request_id, in
>   
>   	if (copy_sense) {
>   		memcpy(tw_dev->srb[request_id]->sense_buffer, header->sense_data, TW_SENSE_DATA_LENGTH);
> -		tw_dev->srb[request_id]->result = (full_command_packet->command.newcommand.status << 1);
> +		tw_dev->srb[request_id]->result =
> +			full_command_packet->command.newcommand.status;
>   		goto out;
>   	}

Same question here.

> diff --git a/drivers/scsi/bfa/bfad_im.c b/drivers/scsi/bfa/bfad_im.c
> index 6b5841b1c06e..e3cbe5d20aca 100644
> --- a/drivers/scsi/bfa/bfad_im.c
> +++ b/drivers/scsi/bfa/bfad_im.c
> @@ -150,7 +150,7 @@ bfa_cb_tskim_done(void *bfad, struct bfad_tskim_s *dtsk,
>   	struct scsi_cmnd *cmnd = (struct scsi_cmnd *)dtsk;
>   	wait_queue_head_t *wq;
>   
> -	cmnd->SCp.Status |= tsk_status << 1;
> +	cmnd->SCp.Status |= tsk_status;
>   	set_bit(IO_DONE_BIT, (unsigned long *)&cmnd->SCp.Status);
>   	wq = (wait_queue_head_t *) cmnd->SCp.ptr;
>   	cmnd->SCp.ptr = NULL;

Same question here.

Thanks,

Bart.

  reply	other threads:[~2019-11-01 16:26 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-31 11:04 [PATCHv2 00/24] Revamp SCSI result values Hannes Reinecke
2019-10-31 11:04 ` [PATCH 01/24] aic7xxx,aic79xxx: remove driver-defined SAM status definitions Hannes Reinecke
2019-11-01 16:14   ` Bart Van Assche
2019-10-31 11:04 ` [PATCH 02/24] bfa: drop driver-defined SCSI status codes Hannes Reinecke
2019-11-01 16:15   ` Bart Van Assche
2019-10-31 11:04 ` [PATCH 03/24] wd33c93: use SCSI status Hannes Reinecke
2019-11-01 16:16   ` Bart Van Assche
2019-10-31 11:04 ` [PATCH 04/24] acornscsi: use standard defines Hannes Reinecke
2019-11-01 16:18   ` Bart Van Assche
2019-11-01 16:40     ` Hannes Reinecke
2019-10-31 11:04 ` [PATCH 05/24] scsi: use standard SAM status codes Hannes Reinecke
2019-11-01 16:26   ` Bart Van Assche [this message]
2019-11-01 16:54     ` Hannes Reinecke
2019-11-01 18:10       ` Bart Van Assche
2019-10-31 11:04 ` [PATCH 06/24] scsi: change status_byte() to return the standard SCSI status Hannes Reinecke
2019-10-31 11:04 ` [PATCH 07/24] target_core: Fixup target_complete_cmd() usage Hannes Reinecke
2019-11-01 16:29   ` Bart Van Assche
2019-10-31 11:04 ` [PATCH 08/24] sg: use SAM status definitions and avoid using masked_status Hannes Reinecke
2019-10-31 11:04 ` [PATCH 09/24] scsi: Kill obsolete linux-specific status codes Hannes Reinecke
2019-11-02 13:14   ` kbuild test robot
2019-11-02 13:14     ` kbuild test robot
2019-10-31 11:04 ` [PATCH 10/24] scsi: introduce set_status_byte() Hannes Reinecke
2019-11-01 16:36   ` Bart Van Assche
2019-10-31 11:04 ` [PATCH 11/24] advansys: kill driver_defined status byte accessors Hannes Reinecke
2019-10-31 11:04 ` [PATCH 12/24] scsi: introduce scsi_build_sense() Hannes Reinecke
2019-11-01 16:35   ` Bart Van Assche
2019-10-31 11:04 ` [PATCH 13/24] scsi: Kill DRIVER_SENSE Hannes Reinecke
2019-10-31 11:04 ` [PATCH 14/24] scsi: Kill DRIVER_HARD Hannes Reinecke
2019-10-31 11:04 ` [PATCH 15/24] scsi_error: use DID_TIME_OUT instead of DRIVER_TIMEOUT Hannes Reinecke
2019-10-31 11:04 ` [PATCH 16/24] scsi: Kill DRIVER_TIMEOUT Hannes Reinecke
2019-10-31 11:04 ` [PATCH 17/24] scsi: do not use DRIVER_INVALID Hannes Reinecke
2019-11-02  3:28   ` Finn Thain
2019-10-31 11:04 ` [PATCH 18/24] st: return error code in st_scsi_execute() Hannes Reinecke
2019-10-31 11:04 ` [PATCH 19/24] scsi_ioctl: return error code when blk_rq_map_kern() fails Hannes Reinecke
2019-10-31 11:04 ` [PATCH 20/24] scsi_dh_alua: do not interpret DRIVER_ERROR Hannes Reinecke
2019-10-31 11:04 ` [PATCH 21/24] xen-scsiback: stop using DRIVER_ERROR Hannes Reinecke
2019-10-31 11:04 ` [PATCH 22/24] scsi: " Hannes Reinecke
2019-10-31 11:04 ` [PATCH 23/24] scsi: Kill DRIVER_MEDIA, DRIVER_SOFT, and DRIVER_BUSY Hannes Reinecke
2019-10-31 11:04 ` [PATCH 24/24] scsi: Drop the now obsolete driver_byte definitions Hannes Reinecke
  -- strict thread matches above, loose matches on Subject: below --
2019-10-21  9:52 [PATCH RFC 00/24] scsi: Revamp result values Hannes Reinecke
2019-10-21  9:53 ` [PATCH 05/24] scsi: use standard SAM status codes Hannes Reinecke
2019-10-21 23:17   ` Finn Thain
2019-10-22  6:00     ` Hannes Reinecke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8c3245df-97e3-95aa-498f-4ed47db96132@acm.org \
    --to=bvanassche@acm.org \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=james.bottomley@hansenpartnership.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.