From owner-svn-src-head@FreeBSD.ORG Tue Oct 8 19:39:22 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7FE913E3; Tue, 8 Oct 2013 19:39:22 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6C9CB2B89; Tue, 8 Oct 2013 19:39:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r98JdMI3020739; Tue, 8 Oct 2013 19:39:22 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r98JdM0Z020738; Tue, 8 Oct 2013 19:39:22 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201310081939.r98JdM0Z020738@svn.freebsd.org> From: Dimitry Andric Date: Tue, 8 Oct 2013 19:39:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256164 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Oct 2013 19:39:22 -0000 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);