Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1637003

[PATCH 3/3] staging: ccree: resolve possible macro issue in cc_hal.h

From Matthew Giassa <matthew@giassa.net>
Newsgroups linux.kernel
Subject [PATCH 3/3] staging: ccree: resolve possible macro issue in cc_hal.h
Date 2017-05-07 00:50 +0200
Message-ID <tEgGu-5vo-23@gated-at.bofh.it> (permalink)
References <tEgGt-5vo-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Wrapping "offset" in macro definition to resolve checkpatch issue, ie:
CHECK: Macro argument 'offset' may be better as '(offset)' to avoid
precedence issues

Signed-off-by: Matthew Giassa <matthew@giassa.net>
---
 drivers/staging/ccree/cc_hal.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/ccree/cc_hal.h b/drivers/staging/ccree/cc_hal.h
index 9b54c80..eecc866 100644
--- a/drivers/staging/ccree/cc_hal.h
+++ b/drivers/staging/ccree/cc_hal.h
@@ -26,7 +26,8 @@
 #define READ_REGISTER(_addr) ioread32((_addr))
 #define WRITE_REGISTER(_addr, _data)  iowrite32((_data), (_addr))
 
-#define CC_HAL_WRITE_REGISTER(offset, val) WRITE_REGISTER(cc_base + offset, val)
-#define CC_HAL_READ_REGISTER(offset) READ_REGISTER(cc_base + offset)
+#define CC_HAL_WRITE_REGISTER(offset, val) \
+	WRITE_REGISTER(cc_base + (offset), val)
+#define CC_HAL_READ_REGISTER(offset) READ_REGISTER(cc_base + (offset))
 
 #endif
-- 
2.7.4

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/3] staging: ccree: resolve checkpatch issues. Matthew Giassa <matthew@giassa.net> - 2017-05-07 00:50 +0200
  [PATCH 1/3] staging: ccree: resolve training whitespace in cc_hal.h Matthew Giassa <matthew@giassa.net> - 2017-05-07 00:50 +0200
  [PATCH 2/3] staging: ccree: resolve columns over 80 chars in cc_hal.h Matthew Giassa <matthew@giassa.net> - 2017-05-07 00:50 +0200
  [PATCH 3/3] staging: ccree: resolve possible macro issue in cc_hal.h Matthew Giassa <matthew@giassa.net> - 2017-05-07 00:50 +0200
  Re: [PATCH 0/3] staging: ccree: resolve checkpatch issues. Matthew Giassa <matthew@giassa.net> - 2017-05-07 01:00 +0200
    Re: [PATCH 0/3] staging: ccree: resolve checkpatch issues. Gilad Ben-Yossef <gilad@benyossef.com> - 2017-05-10 09:20 +0200

csiph-web