Skip to content

Commit dfae398

Browse files
bvanasschemartinkpetersen
authored andcommitted
scsi: esp_scsi: Stop using the SCSI pointer
Set .cmd_size in the SCSI host template instead of using the SCSI pointer from struct scsi_cmnd. This patch prepares for removal of the SCSI pointer from struct scsi_cmnd. Link: https://lore.kernel.org/r/20220218195117.25689-20-bvanassche@acm.org Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 9804db1 commit dfae398

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

drivers/scsi/esp_scsi.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2678,6 +2678,7 @@ struct scsi_host_template scsi_esp_template = {
26782678
.sg_tablesize = SG_ALL,
26792679
.max_sectors = 0xffff,
26802680
.skip_settle_delay = 1,
2681+
.cmd_size = sizeof(struct esp_cmd_priv),
26812682
};
26822683
EXPORT_SYMBOL(scsi_esp_template);
26832684

@@ -2739,9 +2740,6 @@ static struct spi_function_template esp_transport_ops = {
27392740

27402741
static int __init esp_init(void)
27412742
{
2742-
BUILD_BUG_ON(sizeof(struct scsi_pointer) <
2743-
sizeof(struct esp_cmd_priv));
2744-
27452743
esp_transport_template = spi_attach_transport(&esp_transport_ops);
27462744
if (!esp_transport_template)
27472745
return -ENODEV;

drivers/scsi/esp_scsi.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,8 @@ struct esp_cmd_priv {
262262
struct scatterlist *cur_sg;
263263
int tot_residue;
264264
};
265-
#define ESP_CMD_PRIV(CMD) ((struct esp_cmd_priv *)(&(CMD)->SCp))
265+
266+
#define ESP_CMD_PRIV(cmd) ((struct esp_cmd_priv *)scsi_cmd_priv(cmd))
266267

267268
/* NOTE: this enum is ordered based on chip features! */
268269
enum esp_rev {

0 commit comments

Comments
 (0)