blob: e79ea5d91259f4a3fc7d5327f3024863aab6e922 [file] [log] [blame] [raw]
Fix gcc(1) warning 'variably modified ... at file scope'.
Fix for sys/dev/hptmv/vdevice.h is taken from FreeBSD base r320714.
diff -ru --exclude-from freebsd-src-diff-exclude-names /var/tmp/freebsd-10.3-src/usr/src/sys/dev/xen/netfront/netfront.c freebsd-10.3/usr/src/sys/dev/xen/netfront/netfront.c
--- /var/tmp/freebsd-10.3-src/usr/src/sys/dev/xen/netfront/netfront.c 2016-03-25 09:09:33.000000000 +0800
+++ freebsd-10.3/usr/src/sys/dev/xen/netfront/netfront.c 2019-03-11 18:38:49.758201963 +0800
@@ -95,8 +95,8 @@
/* Features supported by all backends. TSO and LRO can be negotiated */
#define XN_CSUM_FEATURES (CSUM_TCP | CSUM_UDP)
-#define NET_TX_RING_SIZE __RING_SIZE((netif_tx_sring_t *)0, PAGE_SIZE)
-#define NET_RX_RING_SIZE __RING_SIZE((netif_rx_sring_t *)0, PAGE_SIZE)
+#define NET_TX_RING_SIZE (__RD32((PAGE_SIZE - offsetof(netif_tx_sring_t, ring)) / sizeof(union netif_tx_sring_entry)))
+#define NET_RX_RING_SIZE (__RD32((PAGE_SIZE - offsetof(netif_rx_sring_t, ring)) / sizeof(union netif_rx_sring_entry)))
#if __FreeBSD_version >= 700000
/*
diff -ru --exclude-from freebsd-src-diff-exclude-names /var/tmp/freebsd-10.3-src/usr/src/sys/ufs/ufs/dir.h freebsd-10.3/usr/src/sys/ufs/ufs/dir.h
--- /var/tmp/freebsd-10.3-src/usr/src/sys/ufs/ufs/dir.h 2016-03-25 09:09:50.000000000 +0800
+++ freebsd-10.3/usr/src/sys/ufs/ufs/dir.h 2019-03-11 21:12:01.132571288 +0800
@@ -110,7 +110,7 @@
*
*/
#define DIRECTSIZ(namlen) \
- (((uintptr_t)&((struct direct *)0)->d_name + \
+ ((offsetof(struct direct, d_name) + \
((namlen)+1)*sizeof(((struct direct *)0)->d_name[0]) + 3) & ~3)
#if (BYTE_ORDER == LITTLE_ENDIAN)
#define DIRSIZ(oldfmt, dp) \
--- head/sys/dev/hptmv/vdevice.h 2017/07/06 05:30:11 320713
+++ head/sys/dev/hptmv/vdevice.h 2017/07/06 05:32:22 320714
@@ -77,8 +77,8 @@
} VDevice;
-#define ARRAY_VDEV_SIZE ((UINT)(ULONG_PTR)&((PVDevice)0)->u+sizeof(RaidArray))
-#define DISK_VDEV_SIZE ((UINT)(ULONG_PTR)&((PVDevice)0)->u+sizeof(Device))
+#define ARRAY_VDEV_SIZE (offsetof(VDevice, u) + sizeof(RaidArray))
+#define DISK_VDEV_SIZE (offsetof(VDevice, u) + sizeof(Device))
#define Map2pVDevice(pDev) ((PVDevice)((UINT_PTR)pDev - (UINT)(UINT_PTR)&((PVDevice)0)->u.disk))