mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Leonardo Brás" <leobras.c@gmail.com>
To: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: [PATCH 11/11] staging: fbtft: Includes parenthesis around macro parameters and avoids multiple usage of macro parameter - Style
Date: Tue, 7 Aug 2018 01:07:41 -0300	[thread overview]
Message-ID: <3cac26238f63cac9123ad767341daead9aec7717.1533614243.git.leobras.c@gmail.com> (raw)
In-Reply-To: <cover.1533614243.git.leobras.c@gmail.com>

Signed-off-by: Leonardo Brás <leobras.c@gmail.com>
---
 drivers/staging/fbtft/fbtft.h | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/fbtft/fbtft.h b/drivers/staging/fbtft/fbtft.h
index 41ac00239aa3..eb2bdc4870be 100644
--- a/drivers/staging/fbtft/fbtft.h
+++ b/drivers/staging/fbtft/fbtft.h
@@ -411,17 +411,21 @@ module_exit(fbtft_driver_module_exit)
 #define DEBUG_REQUEST_GPIOS_MATCH	BIT(30)
 #define DEBUG_VERIFY_GPIOS		BIT(31)
 
-#define fbtft_init_dbg(dev, format, arg...)                  \
-do {                                                         \
-	if (unlikely((dev)->platform_data &&                 \
-	    (((struct fbtft_platform_data *)(dev)->platform_data)->display.debug & DEBUG_DRIVER_INIT_FUNCTIONS))) \
-		dev_info(dev, format, ##arg);                \
+#define fbtft_init_dbg(dev, format, arg...)				\
+do {									\
+	typeof(dev) _dev = (dev);					\
+	struct fbtft_platform_data *pddev = (void *)_dev->platform_data;\
+	if (unlikely(pddev &&				\
+	    (pddev->display.debug &					\
+	     DEBUG_DRIVER_INIT_FUNCTIONS)))				\
+		dev_info(_dev, (format), ##arg);			\
 } while (0)
 
 #define fbtft_par_dbg(level, par, format, arg...)            \
 do {                                                         \
-	if (unlikely(par->debug & level))                    \
-		dev_info(par->info->device, format, ##arg);  \
+	typeof(par) _par = (par);				     \
+	if (unlikely(_par->debug & (level)))                    \
+		dev_info(_par->info->device, format, ##arg);  \
 } while (0)
 
 #define fbtft_par_dbg_hex(level, par, dev, type, buf, num, format, arg...) \
-- 
2.18.0


  parent reply	other threads:[~2018-08-07  4:07 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-07  4:04 [PATCH 00/11] Style Fixes on fbtft Leonardo Brás
2018-08-07  4:04 ` [PATCH 01/11] staging: fbtft: Changes udelay(n) to usleep_range(n, n + 1). - Style Leonardo Brás
2018-08-07  6:49   ` Dan Carpenter
2018-08-07  4:05 ` [PATCH 02/11] staging: fbtft: Puts macro arguments in parenthesis to avoid precedence issues " Leonardo Brás
2018-08-07  4:05 ` [PATCH 03/11] staging: fbtft: Fixes some alignment and line > 80 char " Leonardo Brás
2018-08-07  8:05   ` Dan Carpenter
2018-08-07  4:05 ` [PATCH 04/11] staging: fbtft: Adjust some empty-line problems " Leonardo Brás
2018-08-07  4:06 ` [PATCH 06/11] staging: fbtft: Fixes some defines styles " Leonardo Brás
2018-08-07  4:06 ` [PATCH 07/11] staging: fbtft: Includes description to mutex and spinlock " Leonardo Brás
2018-08-07  4:07 ` [PATCH 08/11] staging: fbtft: Add spaces around / " Leonardo Brás
2018-08-07  4:07 ` [PATCH 09/11] staging: fbtft: Corrects long index line " Leonardo Brás
2018-08-07  4:07 ` [PATCH 10/11] staging: fbtft: Replaces (1 << n) for macro BIT(n) " Leonardo Brás
2018-08-07  4:07 ` Leonardo Brás [this message]
2018-08-07  7:46   ` [PATCH 11/11] staging: fbtft: Includes parenthesis around macro parameters and avoids multiple usage of macro parameter " Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3cac26238f63cac9123ad767341daead9aec7717.1533614243.git.leobras.c@gmail.com \
    --to=leobras.c@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thomas.petazzoni@free-electrons.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®