summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2013-10-08 19:39:21 +0000
committerdim <dim@FreeBSD.org>2013-10-08 19:39:21 +0000
commit6e282147f30e0a4379b5e3a5e06ce4395722dfc7 (patch)
tree63097b83d4cc868e7533f64e4419b8e23e292d2e /usr.sbin
parent4d9730d87ebcc393e8d10b3ba4efa2799db67896 (diff)
downloadFreeBSD-src-6e282147f30e0a4379b5e3a5e06ce4395722dfc7.zip
FreeBSD-src-6e282147f30e0a4379b5e3a5e06ce4395722dfc7.tar.gz
In usr.sbin/bhyve/pci_ahci.c, fix several gcc warnings of the form
"assignment makes pointer from integer without a cast", by changing the cmd_lst and rbis members of struct ahci_port from integers to pointers. Also surround a pow-of-2 test expression with parentheses to clarify it, and avoid another gcc warning. Approved by: re (glebius) Reviewed by: grehan, mav
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/bhyve/pci_ahci.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/usr.sbin/bhyve/pci_ahci.c b/usr.sbin/bhyve/pci_ahci.c
index d50d8f4..f69f127 100644
--- a/usr.sbin/bhyve/pci_ahci.c
+++ b/usr.sbin/bhyve/pci_ahci.c
@@ -119,8 +119,8 @@ struct ahci_ioreq {
struct ahci_port {
struct blockif_ctxt *bctx;
struct pci_ahci_softc *pr_sc;
- uint64_t cmd_lst;
- uint64_t rfis;
+ uint8_t *cmd_lst;
+ uint8_t *rfis;
int atapi;
int reset;
int mult_sectors;
@@ -222,7 +222,7 @@ ahci_write_fis(struct ahci_port *p, enum sata_fis_type ft, uint8_t *fis)
{
int offset, len, irq;
- if (p->rfis == 0 || !(p->cmd & AHCI_P_CMD_FRE))
+ if (p->rfis == NULL || !(p->cmd & AHCI_P_CMD_FRE))
return;
switch (ft) {
@@ -396,7 +396,7 @@ ahci_handle_dma(struct ahci_port *p, int slot, uint8_t *cfis, uint32_t done,
sc = p->pr_sc;
prdt = (struct ahci_prdt_entry *)(cfis + 0x80);
- hdr = p->cmd_lst + slot * AHCI_CL_SIZE;
+ hdr = (struct ahci_cmd_hdr *)(p->cmd_lst + slot * AHCI_CL_SIZE);
ncq = 0;
readop = 1;
@@ -508,7 +508,7 @@ write_prdt(struct ahci_port *p, int slot, uint8_t *cfis,
void *from;
int i, len;
- hdr = p->cmd_lst + slot * AHCI_CL_SIZE;
+ hdr = (struct ahci_cmd_hdr *)(p->cmd_lst + slot * AHCI_CL_SIZE);
len = size;
from = buf;
prdt = (struct ahci_prdt_entry *)(cfis + 0x80);
@@ -528,7 +528,7 @@ handle_identify(struct ahci_port *p, int slot, uint8_t *cfis)
{
struct ahci_cmd_hdr *hdr;
- hdr = p->cmd_lst + slot * AHCI_CL_SIZE;
+ hdr = (struct ahci_cmd_hdr *)(p->cmd_lst + slot * AHCI_CL_SIZE);
if (p->atapi || hdr->prdtl == 0) {
p->tfd = (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR;
p->is |= AHCI_P_IX_TFE;
@@ -869,7 +869,7 @@ atapi_read(struct ahci_port *p, int slot, uint8_t *cfis,
sc = p->pr_sc;
acmd = cfis + 0x40;
- hdr = p->cmd_lst + slot * AHCI_CL_SIZE;
+ hdr = (struct ahci_cmd_hdr *)(p->cmd_lst + slot * AHCI_CL_SIZE);
prdt = (struct ahci_prdt_entry *)(cfis + 0x80);
prdt += seek;
@@ -1178,7 +1178,7 @@ ahci_handle_cmd(struct ahci_port *p, int slot, uint8_t *cfis)
}
case ATA_SET_MULTI:
if (cfis[12] != 0 &&
- (cfis[12] > 128 || (cfis[12] & cfis[12] - 1))) {
+ (cfis[12] > 128 || (cfis[12] & (cfis[12] - 1)))) {
p->tfd = ATA_S_ERROR | ATA_S_READY;
p->tfd |= (ATA_ERROR_ABORT << 8);
} else {
@@ -1241,7 +1241,7 @@ ahci_handle_slot(struct ahci_port *p, int slot)
int cfl;
sc = p->pr_sc;
- hdr = p->cmd_lst + slot * AHCI_CL_SIZE;
+ hdr = (struct ahci_cmd_hdr *)(p->cmd_lst + slot * AHCI_CL_SIZE);
cfl = (hdr->flags & 0x1f) * 4;
cfis = paddr_guest2host(ahci_ctx(sc), hdr->ctba,
0x80 + hdr->prdtl * sizeof(struct ahci_prdt_entry));
@@ -1318,7 +1318,7 @@ ata_ioreq_cb(struct blockif_req *br, int err)
slot = aior->slot;
pending = aior->prdtl;
sc = p->pr_sc;
- hdr = p->cmd_lst + slot * AHCI_CL_SIZE;
+ hdr = (struct ahci_cmd_hdr *)(p->cmd_lst + slot * AHCI_CL_SIZE);
if (cfis[2] == ATA_WRITE_FPDMA_QUEUED ||
cfis[2] == ATA_READ_FPDMA_QUEUED)
@@ -1380,7 +1380,7 @@ atapi_ioreq_cb(struct blockif_req *br, int err)
slot = aior->slot;
pending = aior->prdtl;
sc = p->pr_sc;
- hdr = p->cmd_lst + aior->slot * AHCI_CL_SIZE;
+ hdr = (struct ahci_cmd_hdr *)(p->cmd_lst + aior->slot * AHCI_CL_SIZE);
pthread_mutex_lock(&sc->mtx);
OpenPOWER on IntegriCloud