public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Valentin Huebner <valentin.huebner@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: [PATCH] Staging: board: Fix macro code style error
Date: Mon, 20 Feb 2017 17:44:50 +0000	[thread overview]
Message-ID: <20170220174450.GA106887@ubuntu> (raw)

Fixes a 'macro with flow control statement' checkpatch code style
error by removing the board_staging() macro and replacing its two
calls

Signed-off-by: Valentin Hübner <valentin.huebner@gmail.com>
---
 drivers/staging/board/armadillo800eva.c | 10 +++++++++-
 drivers/staging/board/board.h           | 11 -----------
 drivers/staging/board/kzm9d.c           | 10 +++++++++-
 3 files changed, 18 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/board/armadillo800eva.c b/drivers/staging/board/armadillo800eva.c
index 4de4fd0..2f1613a 100644
--- a/drivers/staging/board/armadillo800eva.c
+++ b/drivers/staging/board/armadillo800eva.c
@@ -101,4 +101,12 @@ static void __init armadillo800eva_init(void)
 				       ARRAY_SIZE(armadillo800eva_devices));
 }
 
-board_staging("renesas,armadillo800eva", armadillo800eva_init);
+static int __init runtime_board_check(void)
+{
+	if (of_machine_is_compatible("renesas,armadillo800eva"))
+		armadillo800eva_init();
+
+	return 0;
+}
+
+device_initcall(runtime_board_check)
diff --git a/drivers/staging/board/board.h b/drivers/staging/board/board.h
index 42ed125..0fa1197 100644
--- a/drivers/staging/board/board.h
+++ b/drivers/staging/board/board.h
@@ -31,15 +31,4 @@ int board_staging_register_device(const struct board_staging_dev *dev);
 void board_staging_register_devices(const struct board_staging_dev *devs,
 				    unsigned int ndevs);
 
-#define board_staging(str, fn)			\
-static int __init runtime_board_check(void)	\
-{						\
-	if (of_machine_is_compatible(str))	\
-		fn();				\
-						\
-	return 0;				\
-}						\
-						\
-device_initcall(runtime_board_check)
-
 #endif /* __BOARD_H__ */
diff --git a/drivers/staging/board/kzm9d.c b/drivers/staging/board/kzm9d.c
index 05a6d43..662501c 100644
--- a/drivers/staging/board/kzm9d.c
+++ b/drivers/staging/board/kzm9d.c
@@ -22,4 +22,12 @@ static void __init kzm9d_init(void)
 	}
 }
 
-board_staging("renesas,kzm9d", kzm9d_init);
+static int __init runtime_board_check(void)
+{
+	if (of_machine_is_compatible("renesas,kzm9d"))
+		kzm9d_init();
+
+	return 0;
+}
+
+device_initcall(runtime_board_check)
-- 
2.7.4

             reply	other threads:[~2017-02-20 17:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-20 17:44 Valentin Huebner [this message]
2017-02-20 17:55 ` [PATCH] Staging: board: Fix macro code style error Greg Kroah-Hartman
2017-02-21 15:21   ` Valentin Hübner

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=20170220174450.GA106887@ubuntu \
    --to=valentin.huebner@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /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