[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <159caafb-be9c-32d7-9a15-e8593e93ddca@gmail.com>
Date: Mon, 27 Mar 2017 14:52:37 +0300
From: aviyae <aviyae42@...il.com>
To: gregkh@...uxfoundation.org
Cc: devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: [PATCH v2] staging: goldfish: Fix style issues in macros
From: Aviya Erenfeld <aviyae42@...il.com>
staging: goldfish: Fix style issues in macros
Fix coding style issues in macros:
1. Add parenthesis around macros argument
2. Avoid arguments reuse in macros
(For the eudyptula challenge)
Signed-off-by: Aviya Erenfeld <aviyae42@...il.com>
---
drivers/staging/goldfish/goldfish_audio.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/goldfish/goldfish_audio.c b/drivers/staging/goldfish/goldfish_audio.c
index bd55995..f1640ab 100644
--- a/drivers/staging/goldfish/goldfish_audio.c
+++ b/drivers/staging/goldfish/goldfish_audio.c
@@ -61,10 +61,12 @@ struct goldfish_audio {
#define COMBINED_BUFFER_SIZE ((2 * READ_BUFFER_SIZE) + \
(2 * WRITE_BUFFER_SIZE))
-#define AUDIO_READ(data, addr) (readl(data->reg_base + addr))
-#define AUDIO_WRITE(data, addr, x) (writel(x, data->reg_base + addr))
+#define AUDIO_READ(data, addr) (readl((data)->reg_base + (addr)))
+#define AUDIO_WRITE(data, addr, x) (writel(x, (data)->reg_base + (addr)))
#define AUDIO_WRITE64(data, addr, addr2, x) \
- (gf_write_dma_addr((x), data->reg_base + addr, data->reg_base + addr2))
+ ({typeof(data) _data = (data); \
+ gf_write_dma_addr((x), _data->reg_base + (addr), \
+ _data->reg_base + (addr2)); })
/*
* temporary variable used between goldfish_audio_probe() and
--
2.7.4
Powered by blists - more mailing lists