summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2024-11-10 11:13:06 -0800
committerMarge Bot <emma+marge@anholt.net>2024-11-16 22:09:35 +0000
commitd55a8f77abf72bf3f971e68d319dd60bb4242b3a (patch)
treeff227751f4dfc1f6eac3af4fa0c81dc43b48fa9c /src
parent3b7e42e8b1c65fec79d68c9b6dc3b132195421d4 (diff)
WAITFIFO: add do { ... } while (0) to avoid -Wextra-semi-stmt warnings
Clears 17 warnings from clang of the form: mga_video.c:739:17: warning: empty expression statement has no effect; remove unnecessary ';' to silence this warning [-Wextra-semi-stmt] WAITFIFO(15); ^ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-mga/-/merge_requests/15>
Diffstat (limited to 'src')
-rw-r--r--src/mga_macros.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mga_macros.h b/src/mga_macros.h
index c3a7d62..d44a2ec 100644
--- a/src/mga_macros.h
+++ b/src/mga_macros.h
@@ -29,14 +29,15 @@ while(INREG(MGAREG_DWGSYNC) != MGA_SYNC_XTAG) ; \
#define MGAISBUSY() (INREG8(MGAREG_Status + 2) & 0x01)
-#define WAITFIFO(cnt) \
+#define WAITFIFO(cnt) do { \
if(!pMga->UsePCIRetry) {\
register int n = cnt; \
if(n > pMga->FifoSize) n = pMga->FifoSize; \
while(pMga->fifoCount < (n))\
pMga->fifoCount = INREG8(MGAREG_FIFOSTATUS);\
pMga->fifoCount -= n;\
- }
+ } \
+} while (0)
#define XYADDRESS(x,y) \
((y) * pMga->CurrentLayout.displayWidth + (x) + pMga->YDstOrg)