Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 May 2020 17:59:18 +0000 (UTC)
From:      Jessica Clarke <jrtc27@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r360789 - head/sys/dev/virtio/mmio
Message-ID:  <202005071759.047HxIKB071247@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jrtc27
Date: Thu May  7 17:59:17 2020
New Revision: 360789
URL: https://svnweb.freebsd.org/changeset/base/360789

Log:
  virtio_mmio: Add casts missing from r360722
  
  This fixes -Wshift-count-overflow warnings/errors on architectures using
  32-bit physical addresses.
  
  Reported by:	lwhsu

Modified:
  head/sys/dev/virtio/mmio/virtio_mmio.c

Modified: head/sys/dev/virtio/mmio/virtio_mmio.c
==============================================================================
--- head/sys/dev/virtio/mmio/virtio_mmio.c	Thu May  7 17:58:07 2020	(r360788)
+++ head/sys/dev/virtio/mmio/virtio_mmio.c	Thu May  7 17:59:17 2020	(r360789)
@@ -439,19 +439,19 @@ vtmmio_set_virtqueue(struct vtmmio_softc *sc, struct v
 		vtmmio_write_config_4(sc, VIRTIO_MMIO_QUEUE_DESC_LOW,
 		    paddr);
 		vtmmio_write_config_4(sc, VIRTIO_MMIO_QUEUE_DESC_HIGH,
-		    paddr >> 32);
+		    ((uint64_t)paddr) >> 32);
 
 		paddr = virtqueue_avail_paddr(vq);
 		vtmmio_write_config_4(sc, VIRTIO_MMIO_QUEUE_AVAIL_LOW,
 		    paddr);
 		vtmmio_write_config_4(sc, VIRTIO_MMIO_QUEUE_AVAIL_HIGH,
-		    paddr >> 32);
+		    ((uint64_t)paddr) >> 32);
 
 		paddr = virtqueue_used_paddr(vq);
 		vtmmio_write_config_4(sc, VIRTIO_MMIO_QUEUE_USED_LOW,
 		    paddr);
 		vtmmio_write_config_4(sc, VIRTIO_MMIO_QUEUE_USED_HIGH,
-		    paddr >> 32);
+		    ((uint64_t)paddr) >> 32);
 
 		vtmmio_write_config_4(sc, VIRTIO_MMIO_QUEUE_READY, 1);
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202005071759.047HxIKB071247>