Date: Thu, 6 Jul 2017 05:32:22 +0000 (UTC) From: Ryan Libby <rlibby@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320714 - head/sys/dev/hptmv Message-ID: <201707060532.v665WMk8018397@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rlibby Date: Thu Jul 6 05:32:22 2017 New Revision: 320714 URL: https://svnweb.freebsd.org/changeset/base/320714 Log: hptmv: avoid gcc variably-modified warning gcc produces a "variably modified X at file scope" warning for structures that use these size definitions. PR: 211540 Reviewed by: markj Approved by: markj (mentor) Sponsored by: Dell EMC Isilon Differential revision: https://reviews.freebsd.org/D11416 Modified: head/sys/dev/hptmv/vdevice.h Modified: head/sys/dev/hptmv/vdevice.h ============================================================================== --- head/sys/dev/hptmv/vdevice.h Thu Jul 6 05:30:11 2017 (r320713) +++ head/sys/dev/hptmv/vdevice.h Thu Jul 6 05:32:22 2017 (r320714) @@ -77,8 +77,8 @@ typedef struct _VDevice } 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))
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201707060532.v665WMk8018397>