Message ID | 20221209061325.705999-4-michael.christie@oracle.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | scsi: Add struct for args to execution functions | expand |
On 09/12/2022 06:13, Mike Christie wrote: > scsi_execute_req is going to be removed. Convert drivetemp to > scsi_execute_cmd. > > Signed-off-by: Mike Christie<michael.christie@oracle.com> FWIW, Reviewed-by: John Garry <john.g.garry@oracle.com> > --- > drivers/hwmon/drivetemp.c | 11 +++++------ > 1 file changed, 5 insertions(+), 6 deletions(-) > > diff --git a/drivers/hwmon/drivetemp.c b/drivers/hwmon/drivetemp.c > index 5bac2b0fc7bb..2434ddb000f0 100644 > --- a/drivers/hwmon/drivetemp.c > +++ b/drivers/hwmon/drivetemp.c > @@ -164,7 +164,7 @@ static int drivetemp_scsi_command(struct drivetemp_data *st, > u8 lba_low, u8 lba_mid, u8 lba_high) > { > u8 scsi_cmd[MAX_COMMAND_SIZE]; > - int data_dir; > + enum req_op op; > > memset(scsi_cmd, 0, sizeof(scsi_cmd)); > scsi_cmd[0] = ATA_16; > @@ -175,7 +175,7 @@ static int drivetemp_scsi_command(struct drivetemp_data *st, > * field. > */ > scsi_cmd[2] = 0x06; > - data_dir = DMA_TO_DEVICE; > + op = REQ_OP_DRV_OUT; > } else { > scsi_cmd[1] = (4 << 1); /* PIO Data-in */ > /* > @@ -183,7 +183,7 @@ static int drivetemp_scsi_command(struct drivetemp_data *st, > * field. > */ > scsi_cmd[2] = 0x0e; > - data_dir = DMA_FROM_DEVICE; > + op = REQ_OP_DRV_IN; I was thinking that it could be good to have a small helper to convert dma_dir -> REQ_OP_DRV_* at some stage > } > scsi_cmd[4] = feature; > scsi_cmd[6] = 1; /* 1 sector */ > @@ -192,9 +192,8 @@ static int drivetemp_scsi_command(struct drivetemp_data *st, > scsi_cmd[12] = lba_high; > scsi_cmd[14] = ata_command; > > - return scsi_execute_req(st->sdev, scsi_cmd, data_dir, > - st->smartdata, ATA_SECT_SIZE, NULL, HZ, 5, > - NULL); > + return scsi_execute_cmd(st->sdev, scsi_cmd, op, st->smartdata, > + ATA_SECT_SIZE, HZ, 5); > } > > static int drivetemp_ata_command(struct drivetemp_data *st, u8 feature, > --
On 12/8/22 22:13, Mike Christie wrote: > scsi_execute_req is going to be removed. Convert drivetemp to > scsi_execute_cmd. Reviewed-by: Bart Van Assche <bvanassche@acm.org>
diff --git a/drivers/hwmon/drivetemp.c b/drivers/hwmon/drivetemp.c index 5bac2b0fc7bb..2434ddb000f0 100644 --- a/drivers/hwmon/drivetemp.c +++ b/drivers/hwmon/drivetemp.c @@ -164,7 +164,7 @@ static int drivetemp_scsi_command(struct drivetemp_data *st, u8 lba_low, u8 lba_mid, u8 lba_high) { u8 scsi_cmd[MAX_COMMAND_SIZE]; - int data_dir; + enum req_op op; memset(scsi_cmd, 0, sizeof(scsi_cmd)); scsi_cmd[0] = ATA_16; @@ -175,7 +175,7 @@ static int drivetemp_scsi_command(struct drivetemp_data *st, * field. */ scsi_cmd[2] = 0x06; - data_dir = DMA_TO_DEVICE; + op = REQ_OP_DRV_OUT; } else { scsi_cmd[1] = (4 << 1); /* PIO Data-in */ /* @@ -183,7 +183,7 @@ static int drivetemp_scsi_command(struct drivetemp_data *st, * field. */ scsi_cmd[2] = 0x0e; - data_dir = DMA_FROM_DEVICE; + op = REQ_OP_DRV_IN; } scsi_cmd[4] = feature; scsi_cmd[6] = 1; /* 1 sector */ @@ -192,9 +192,8 @@ static int drivetemp_scsi_command(struct drivetemp_data *st, scsi_cmd[12] = lba_high; scsi_cmd[14] = ata_command; - return scsi_execute_req(st->sdev, scsi_cmd, data_dir, - st->smartdata, ATA_SECT_SIZE, NULL, HZ, 5, - NULL); + return scsi_execute_cmd(st->sdev, scsi_cmd, op, st->smartdata, + ATA_SECT_SIZE, HZ, 5); } static int drivetemp_ata_command(struct drivetemp_data *st, u8 feature,
scsi_execute_req is going to be removed. Convert drivetemp to scsi_execute_cmd. Signed-off-by: Mike Christie <michael.christie@oracle.com> --- drivers/hwmon/drivetemp.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)