Commit 86117d7f authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Martin K. Petersen

scsi: esp_scsi: remove union in esp_cmd_priv

The dma_addr_t member is unused ever since we switched the SCSI
layer to send down single-segement command using a scatterlist
as well many years ago.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Tested-by: default avatarFinn Thain <fthain@telegraphics.com.au>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 3f9295b6
...@@ -379,14 +379,14 @@ static void esp_map_dma(struct esp *esp, struct scsi_cmnd *cmd) ...@@ -379,14 +379,14 @@ static void esp_map_dma(struct esp *esp, struct scsi_cmnd *cmd)
* For pseudo DMA and PIO we need the virtual address instead of * For pseudo DMA and PIO we need the virtual address instead of
* a dma address, so perform an identity mapping. * a dma address, so perform an identity mapping.
*/ */
spriv->u.num_sg = scsi_sg_count(cmd); spriv->num_sg = scsi_sg_count(cmd);
for (i = 0; i < spriv->u.num_sg; i++) { for (i = 0; i < spriv->num_sg; i++) {
sg[i].dma_address = (uintptr_t)sg_virt(&sg[i]); sg[i].dma_address = (uintptr_t)sg_virt(&sg[i]);
total += sg_dma_len(&sg[i]); total += sg_dma_len(&sg[i]);
} }
} else { } else {
spriv->u.num_sg = scsi_dma_map(cmd); spriv->num_sg = scsi_dma_map(cmd);
for (i = 0; i < spriv->u.num_sg; i++) for (i = 0; i < spriv->num_sg; i++)
total += sg_dma_len(&sg[i]); total += sg_dma_len(&sg[i]);
} }
spriv->cur_residue = sg_dma_len(sg); spriv->cur_residue = sg_dma_len(sg);
...@@ -982,7 +982,7 @@ static int esp_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_ ...@@ -982,7 +982,7 @@ static int esp_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_
cmd->scsi_done = done; cmd->scsi_done = done;
spriv = ESP_CMD_PRIV(cmd); spriv = ESP_CMD_PRIV(cmd);
spriv->u.dma_addr = ~(dma_addr_t)0x0; spriv->num_sg = 0;
list_add_tail(&ent->list, &esp->queued_cmds); list_add_tail(&ent->list, &esp->queued_cmds);
...@@ -1372,7 +1372,7 @@ static int esp_data_bytes_sent(struct esp *esp, struct esp_cmd_entry *ent, ...@@ -1372,7 +1372,7 @@ static int esp_data_bytes_sent(struct esp *esp, struct esp_cmd_entry *ent,
struct esp_cmd_priv *p = ESP_CMD_PRIV(cmd); struct esp_cmd_priv *p = ESP_CMD_PRIV(cmd);
u8 *ptr; u8 *ptr;
ptr = scsi_kmap_atomic_sg(p->cur_sg, p->u.num_sg, ptr = scsi_kmap_atomic_sg(p->cur_sg, p->num_sg,
&offset, &count); &offset, &count);
if (likely(ptr)) { if (likely(ptr)) {
*(ptr + offset) = bval; *(ptr + offset) = bval;
......
...@@ -249,11 +249,7 @@ ...@@ -249,11 +249,7 @@
#define SYNC_DEFP_FAST 0x19 /* 10mb/s */ #define SYNC_DEFP_FAST 0x19 /* 10mb/s */
struct esp_cmd_priv { struct esp_cmd_priv {
union { int num_sg;
dma_addr_t dma_addr;
int num_sg;
} u;
int cur_residue; int cur_residue;
struct scatterlist *cur_sg; struct scatterlist *cur_sg;
int tot_residue; int tot_residue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment