blob: cc437dda7c01f19165234de9b3c02b934f9c37d2 [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/archive3/public/freebsd-releng-10.4-src/sys/dev/xen/netfront/netfront.c freebsd-10.4/sys/dev/xen/netfront/netfront.c
--- /var/archive3/public/freebsd-releng-10.4-src/sys/dev/xen/netfront/netfront.c 2017-09-29 08:19:49.000000000 +0800
+++ freebsd-10.4/sys/dev/xen/netfront/netfront.c 2019-08-17 23:36:54.878320704 +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/archive3/public/freebsd-releng-10.4-src/sys/ufs/ufs/dir.h freebsd-10.4/sys/ufs/ufs/dir.h
--- /var/archive3/public/freebsd-releng-10.4-src/sys/ufs/ufs/dir.h 2017-09-29 08:20:02.000000000 +0800
+++ freebsd-10.4/sys/ufs/ufs/dir.h 2019-08-17 23:36:54.879336528 +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))