Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
mptsas: avoid shadowed local variables
Rename the argument so that "addr" is only used inside the for loop.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
bonzini committed Sep 25, 2023
1 parent 477b301 commit 4c18684
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions hw/scsi/mptsas.c
Expand Up @@ -192,7 +192,7 @@ static dma_addr_t mptsas_ld_sg_base(MPTSASState *s, uint32_t flags_and_length,
return addr;
}

static int mptsas_build_sgl(MPTSASState *s, MPTSASRequest *req, hwaddr addr)
static int mptsas_build_sgl(MPTSASState *s, MPTSASRequest *req, hwaddr req_addr)
{
PCIDevice *pci = (PCIDevice *) s;
hwaddr next_chain_addr;
Expand All @@ -201,8 +201,8 @@ static int mptsas_build_sgl(MPTSASState *s, MPTSASRequest *req, hwaddr addr)
uint32_t chain_offset;

chain_offset = req->scsi_io.ChainOffset;
next_chain_addr = addr + chain_offset * sizeof(uint32_t);
sgaddr = addr + sizeof(MPIMsgSCSIIORequest);
next_chain_addr = req_addr + chain_offset * sizeof(uint32_t);
sgaddr = req_addr + sizeof(MPIMsgSCSIIORequest);
pci_dma_sglist_init(&req->qsg, pci, 4);
left = req->scsi_io.DataLength;

Expand Down

0 comments on commit 4c18684

Please sign in to comment.