Date: Tue, 8 Oct 2013 19:39:22 +0000 (UTC) From: Dimitry Andric <dim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256164 - head/usr.sbin/bhyve Message-ID: <201310081939.r98JdM0Z020738@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dim Date: Tue Oct 8 19:39:21 2013 New Revision: 256164 URL: http://svnweb.freebsd.org/changeset/base/256164 Log: 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 Modified: head/usr.sbin/bhyve/pci_ahci.c Modified: head/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- head/usr.sbin/bhyve/pci_ahci.c Tue Oct 8 19:18:02 2013 (r256163) +++ head/usr.sbin/bhyve/pci_ahci.c Tue Oct 8 19:39:21 2013 (r256164) @@ -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 { 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 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 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 { 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 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 } 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, in 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 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, i 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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201310081939.r98JdM0Z020738>