mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: <laurentiu.tudor@nxp.com>
To: <gregkh@linuxfoundation.org>, <stuyoder@gmail.com>
Cc: <devel@driverdev.osuosl.org>, <linux-kernel@vger.kernel.org>,
	<agraf@suse.de>, <arnd@arndb.de>, <ioana.ciornei@nxp.com>,
	<ruxandra.radulescu@nxp.com>, <bharat.bhushan@nxp.com>,
	<catalin.horghidan@nxp.com>, <leoyang.li@nxp.com>,
	<roy.pledge@nxp.com>, <linux-arm-kernel@lists.infradead.org>,
	Laurentiu Tudor <laurentiu.tudor@nxp.com>
Subject: [PATCH 01/10] staging: fsl-mc: enclose macro params in parens
Date: Wed, 31 May 2017 13:58:43 +0300	[thread overview]
Message-ID: <20170531105852.22304-2-laurentiu.tudor@nxp.com> (raw)
In-Reply-To: <20170531105852.22304-1-laurentiu.tudor@nxp.com>

From: Laurentiu Tudor <laurentiu.tudor@nxp.com>

Several macros didn't had macro params enclosed
in parens. Fix them to avoid precedence issues.

Found with checkpatch.pl who was issuing this
message:
  "Macro argument 'id' may be better as '(id)'
   to avoid precedence issues"

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
---
 drivers/staging/fsl-mc/bus/dpbp-cmd.h  | 2 +-
 drivers/staging/fsl-mc/bus/dpmcp-cmd.h | 2 +-
 drivers/staging/fsl-mc/bus/dpmng-cmd.h | 2 +-
 drivers/staging/fsl-mc/bus/dprc-cmd.h  | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/fsl-mc/bus/dpbp-cmd.h b/drivers/staging/fsl-mc/bus/dpbp-cmd.h
index 8aa6545..5904836 100644
--- a/drivers/staging/fsl-mc/bus/dpbp-cmd.h
+++ b/drivers/staging/fsl-mc/bus/dpbp-cmd.h
@@ -40,7 +40,7 @@
 #define DPBP_CMD_BASE_VERSION			1
 #define DPBP_CMD_ID_OFFSET			4
 
-#define DPBP_CMD(id)	((id << DPBP_CMD_ID_OFFSET) | DPBP_CMD_BASE_VERSION)
+#define DPBP_CMD(id)	(((id) << DPBP_CMD_ID_OFFSET) | DPBP_CMD_BASE_VERSION)
 
 /* Command IDs */
 #define DPBP_CMDID_CLOSE		DPBP_CMD(0x800)
diff --git a/drivers/staging/fsl-mc/bus/dpmcp-cmd.h b/drivers/staging/fsl-mc/bus/dpmcp-cmd.h
index 384a13d..861b2a7 100644
--- a/drivers/staging/fsl-mc/bus/dpmcp-cmd.h
+++ b/drivers/staging/fsl-mc/bus/dpmcp-cmd.h
@@ -40,7 +40,7 @@
 #define DPMCP_CMD_BASE_VERSION		1
 #define DPMCP_CMD_ID_OFFSET		4
 
-#define DPMCP_CMD(id)	((id << DPMCP_CMD_ID_OFFSET) | DPMCP_CMD_BASE_VERSION)
+#define DPMCP_CMD(id)	(((id) << DPMCP_CMD_ID_OFFSET) | DPMCP_CMD_BASE_VERSION)
 
 /* Command IDs */
 #define DPMCP_CMDID_CLOSE		DPMCP_CMD(0x800)
diff --git a/drivers/staging/fsl-mc/bus/dpmng-cmd.h b/drivers/staging/fsl-mc/bus/dpmng-cmd.h
index cdddfb8..d1f04ac 100644
--- a/drivers/staging/fsl-mc/bus/dpmng-cmd.h
+++ b/drivers/staging/fsl-mc/bus/dpmng-cmd.h
@@ -44,7 +44,7 @@
 #define DPMNG_CMD_BASE_VERSION		1
 #define DPMNG_CMD_ID_OFFSET		4
 
-#define DPMNG_CMD(id)	((id << DPMNG_CMD_ID_OFFSET) | DPMNG_CMD_BASE_VERSION)
+#define DPMNG_CMD(id)	(((id) << DPMNG_CMD_ID_OFFSET) | DPMNG_CMD_BASE_VERSION)
 
 /* Command IDs */
 #define DPMNG_CMDID_GET_VERSION		DPMNG_CMD(0x831)
diff --git a/drivers/staging/fsl-mc/bus/dprc-cmd.h b/drivers/staging/fsl-mc/bus/dprc-cmd.h
index e9fdca4..d9b2dcd 100644
--- a/drivers/staging/fsl-mc/bus/dprc-cmd.h
+++ b/drivers/staging/fsl-mc/bus/dprc-cmd.h
@@ -48,7 +48,7 @@
 #define DPRC_CMD_BASE_VERSION			1
 #define DPRC_CMD_ID_OFFSET			4
 
-#define DPRC_CMD(id)	((id << DPRC_CMD_ID_OFFSET) | DPRC_CMD_BASE_VERSION)
+#define DPRC_CMD(id)	(((id) << DPRC_CMD_ID_OFFSET) | DPRC_CMD_BASE_VERSION)
 
 /* Command IDs */
 #define DPRC_CMDID_CLOSE                        DPRC_CMD(0x800)
-- 
2.9.4

  reply	other threads:[~2017-05-31 10:59 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-31 10:58 [PATCH v6 00/10] staging: fsl-mc: move bus driver out of staging laurentiu.tudor
2017-05-31 10:58 ` laurentiu.tudor [this message]
2017-06-03  8:41   ` [PATCH 01/10] staging: fsl-mc: enclose macro params in parens Greg KH
2017-06-06 12:03     ` Laurentiu Tudor
2017-05-31 10:58 ` [PATCH 02/10] staging: fsl-mc: fix macros with possible side effects laurentiu.tudor
2017-05-31 10:58 ` [PATCH 03/10] staging: fsl-mc: simplify couple of deallocations laurentiu.tudor
2017-05-31 10:58 ` [PATCH 04/10] staging: fsl-mc: drop a few useless #includes laurentiu.tudor
2017-05-31 10:58 ` [PATCH 05/10] staging: fsl-mc: remove extra blank line laurentiu.tudor
2017-05-31 10:58 ` [PATCH 06/10] staging: fsl-mc: drop unused forward declaration laurentiu.tudor
2017-05-31 10:58 ` [PATCH v2 07/10] staging: fsl-mc: add binding path to MAINTAINERS laurentiu.tudor
2017-05-31 10:58 ` [PATCH 08/10] staging: fsl-mc: drop reference to restool laurentiu.tudor
2017-05-31 10:58 ` [PATCH 09/10] staging: fsl-mc: add reference to mc-bus DT binding laurentiu.tudor
2017-05-31 10:58 ` [PATCH v4 10/10] staging: fsl-mc: move bus driver out of staging laurentiu.tudor
2017-05-31 11:15   ` Marc Zyngier
2017-05-31 11:31     ` Laurentiu Tudor
2017-06-03  8:40   ` Greg KH
2017-06-06 14:03     ` Laurentiu Tudor
2017-06-06 14:20       ` Greg KH
2017-06-06 14:23         ` Laurentiu Tudor

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=20170531105852.22304-2-laurentiu.tudor@nxp.com \
    --to=laurentiu.tudor@nxp.com \
    --cc=agraf@suse.de \
    --cc=arnd@arndb.de \
    --cc=bharat.bhushan@nxp.com \
    --cc=catalin.horghidan@nxp.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=ioana.ciornei@nxp.com \
    --cc=leoyang.li@nxp.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=roy.pledge@nxp.com \
    --cc=ruxandra.radulescu@nxp.com \
    --cc=stuyoder@gmail.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®