ahci: resolve Coverity warnings
This commit is contained in:
parent
85edabcb42
commit
d75ef5a05c
1 changed files with 5 additions and 5 deletions
|
@ -242,7 +242,7 @@ static int atapi_exec(struct port_state *ps, int cmd,
|
||||||
/* Execute an ATAPI command. Return OK or error.
|
/* Execute an ATAPI command. Return OK or error.
|
||||||
*/
|
*/
|
||||||
cmd_fis_t fis;
|
cmd_fis_t fis;
|
||||||
prd_t prd;
|
prd_t prd[1];
|
||||||
int nr_prds = 0;
|
int nr_prds = 0;
|
||||||
|
|
||||||
assert(size <= AHCI_TMP_SIZE);
|
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))
|
if (!write && (ps->flags & FLAG_USE_DMADIR))
|
||||||
fis.cf_feat |= ATA_FEAT_PACKET_DMADIR;
|
fis.cf_feat |= ATA_FEAT_PACKET_DMADIR;
|
||||||
|
|
||||||
prd.vp_addr = ps->tmp_phys;
|
prd[0].vp_addr = ps->tmp_phys;
|
||||||
prd.vp_size = size;
|
prd[0].vp_size = size;
|
||||||
nr_prds++;
|
nr_prds++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Start the command, and wait for it to complete or fail. */
|
/* 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);
|
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
|
/* See if the user specified a custom mapping. Unlike all other
|
||||||
* configuration options, this is a per-instance setting.
|
* configuration options, this is a per-instance setting.
|
||||||
*/
|
*/
|
||||||
strcpy(key, "ahci0_map");
|
strlcpy(key, "ahci0_map", sizeof(key));
|
||||||
key[4] += ahci_instance;
|
key[4] += ahci_instance;
|
||||||
|
|
||||||
if (env_get_param(key, val, sizeof(val)) == OK) {
|
if (env_get_param(key, val, sizeof(val)) == OK) {
|
||||||
|
|
Loading…
Reference in a new issue