ahci: resolve Coverity warnings

This commit is contained in:
David van Moolenbroek 2012-07-27 14:46:05 +00:00
parent 85edabcb42
commit d75ef5a05c

View file

@ -242,7 +242,7 @@ static int atapi_exec(struct port_state *ps, int cmd,
/* Execute an ATAPI command. Return OK or error.
*/
cmd_fis_t fis;
prd_t prd;
prd_t prd[1];
int nr_prds = 0;
assert(size <= AHCI_TMP_SIZE);
@ -258,13 +258,13 @@ static int atapi_exec(struct port_state *ps, int cmd,
if (!write && (ps->flags & FLAG_USE_DMADIR))
fis.cf_feat |= ATA_FEAT_PACKET_DMADIR;
prd.vp_addr = ps->tmp_phys;
prd.vp_size = size;
prd[0].vp_addr = ps->tmp_phys;
prd[0].vp_size = size;
nr_prds++;
}
/* Start the command, and wait for it to complete or fail. */
port_set_cmd(ps, cmd, &fis, packet, &prd, nr_prds, write);
port_set_cmd(ps, cmd, &fis, packet, prd, nr_prds, write);
return port_exec(ps, cmd, ahci_command_timeout);
}
@ -2196,7 +2196,7 @@ static void ahci_set_mapping(void)
/* See if the user specified a custom mapping. Unlike all other
* configuration options, this is a per-instance setting.
*/
strcpy(key, "ahci0_map");
strlcpy(key, "ahci0_map", sizeof(key));
key[4] += ahci_instance;
if (env_get_param(key, val, sizeof(val)) == OK) {