Skip to content

Commit 86117d7

Browse files
Christoph Hellwigmartinkpetersen
authored andcommitted
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: Christoph Hellwig <hch@lst.de> Tested-by: Finn Thain <fthain@telegraphics.com.au> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 3f9295b commit 86117d7

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

drivers/scsi/esp_scsi.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -379,14 +379,14 @@ static void esp_map_dma(struct esp *esp, struct scsi_cmnd *cmd)
379379
* For pseudo DMA and PIO we need the virtual address instead of
380380
* a dma address, so perform an identity mapping.
381381
*/
382-
spriv->u.num_sg = scsi_sg_count(cmd);
383-
for (i = 0; i < spriv->u.num_sg; i++) {
382+
spriv->num_sg = scsi_sg_count(cmd);
383+
for (i = 0; i < spriv->num_sg; i++) {
384384
sg[i].dma_address = (uintptr_t)sg_virt(&sg[i]);
385385
total += sg_dma_len(&sg[i]);
386386
}
387387
} else {
388-
spriv->u.num_sg = scsi_dma_map(cmd);
389-
for (i = 0; i < spriv->u.num_sg; i++)
388+
spriv->num_sg = scsi_dma_map(cmd);
389+
for (i = 0; i < spriv->num_sg; i++)
390390
total += sg_dma_len(&sg[i]);
391391
}
392392
spriv->cur_residue = sg_dma_len(sg);
@@ -982,7 +982,7 @@ static int esp_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_
982982
cmd->scsi_done = done;
983983

984984
spriv = ESP_CMD_PRIV(cmd);
985-
spriv->u.dma_addr = ~(dma_addr_t)0x0;
985+
spriv->num_sg = 0;
986986

987987
list_add_tail(&ent->list, &esp->queued_cmds);
988988

@@ -1372,7 +1372,7 @@ static int esp_data_bytes_sent(struct esp *esp, struct esp_cmd_entry *ent,
13721372
struct esp_cmd_priv *p = ESP_CMD_PRIV(cmd);
13731373
u8 *ptr;
13741374

1375-
ptr = scsi_kmap_atomic_sg(p->cur_sg, p->u.num_sg,
1375+
ptr = scsi_kmap_atomic_sg(p->cur_sg, p->num_sg,
13761376
&offset, &count);
13771377
if (likely(ptr)) {
13781378
*(ptr + offset) = bval;

drivers/scsi/esp_scsi.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -249,11 +249,7 @@
249249
#define SYNC_DEFP_FAST 0x19 /* 10mb/s */
250250

251251
struct esp_cmd_priv {
252-
union {
253-
dma_addr_t dma_addr;
254-
int num_sg;
255-
} u;
256-
252+
int num_sg;
257253
int cur_residue;
258254
struct scatterlist *cur_sg;
259255
int tot_residue;

0 commit comments

Comments
 (0)