linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Staging: board: Fix redundant macro
@ 2017-02-20  9:10 =?UTF-8?q?Valentin=20H=C3=BCbner?=
  2017-02-20 12:39 ` kbuild test robot
  2017-02-20 12:47 ` Geert Uytterhoeven
  0 siblings, 2 replies; 3+ messages in thread
From: =?UTF-8?q?Valentin=20H=C3=BCbner?= @ 2017-02-20  9:10 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: devel, linux-kernel

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

Signed-off-by: Valentin Hübner <valentin.huebner@gmail.com>
---
 drivers/staging/board/armadillo800eva.c | 10 +++++++++-
 drivers/staging/board/board.h           | 11 -----------
 2 files changed, 9 insertions(+), 12 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__ */
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Staging: board: Fix redundant macro
  2017-02-20  9:10 [PATCH] Staging: board: Fix redundant macro =?UTF-8?q?Valentin=20H=C3=BCbner?=
@ 2017-02-20 12:39 ` kbuild test robot
  2017-02-20 12:47 ` Geert Uytterhoeven
  1 sibling, 0 replies; 3+ messages in thread
From: kbuild test robot @ 2017-02-20 12:39 UTC (permalink / raw)
  To: =?UTF-8?q?Valentin=20H=C3=BCbner?=
  Cc: kbuild-all, Greg Kroah-Hartman, devel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2954 bytes --]

Hi

[auto build test ERROR on staging/staging-testing]
[also build test ERROR on v4.10 next-20170220]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/UTF-8-q-Valentin-20H-C3-BCbner/Staging-board-Fix-redundant-macro/20170220-175655
config: arm-shmobile_defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=arm 

All errors (new ones prefixed by >>):

>> drivers/staging/board/kzm9d.c:25:15: error: expected declaration specifiers or '...' before string constant
    board_staging("renesas,kzm9d", kzm9d_init);
                  ^~~~~~~~~~~~~~~
>> drivers/staging/board/kzm9d.c:25:32: error: expected declaration specifiers or '...' before 'kzm9d_init'
    board_staging("renesas,kzm9d", kzm9d_init);
                                   ^~~~~~~~~~
   drivers/staging/board/kzm9d.c:12:20: warning: 'kzm9d_init' defined but not used [-Wunused-function]
    static void __init kzm9d_init(void)
                       ^~~~~~~~~~

vim +25 drivers/staging/board/kzm9d.c

f22f4ea5 Magnus Damm        2014-06-06   9  	DEFINE_RES_IRQ(159),
f22f4ea5 Magnus Damm        2014-06-06  10  };
f22f4ea5 Magnus Damm        2014-06-06  11  
f22f4ea5 Magnus Damm        2014-06-06  12  static void __init kzm9d_init(void)
f22f4ea5 Magnus Damm        2014-06-06  13  {
cebbddb6 Geert Uytterhoeven 2015-11-20  14  	board_staging_gic_setup_xlate("arm,pl390", 32);
a8589088 Geert Uytterhoeven 2015-06-17  15  
a8589088 Geert Uytterhoeven 2015-06-17  16  	if (!board_staging_dt_node_available(usbs1_res,
a8589088 Geert Uytterhoeven 2015-06-17  17  					     ARRAY_SIZE(usbs1_res))) {
a8589088 Geert Uytterhoeven 2015-06-17  18  		board_staging_gic_fixup_resources(usbs1_res,
a8589088 Geert Uytterhoeven 2015-06-17  19  						  ARRAY_SIZE(usbs1_res));
f22f4ea5 Magnus Damm        2014-06-06  20  		platform_device_register_simple("emxx_udc", -1, usbs1_res,
f22f4ea5 Magnus Damm        2014-06-06  21  						ARRAY_SIZE(usbs1_res));
f22f4ea5 Magnus Damm        2014-06-06  22  	}
a8589088 Geert Uytterhoeven 2015-06-17  23  }
f22f4ea5 Magnus Damm        2014-06-06  24  
f22f4ea5 Magnus Damm        2014-06-06 @25  board_staging("renesas,kzm9d", kzm9d_init);

:::::: The code at line 25 was first introduced by commit
:::::: f22f4ea5c63fbc6ee7a3f7240c84a276eba96d76 staging: board: kzm9d: Board staging support for emxx_udc

:::::: TO: Magnus Damm <damm+renesas@opensource.se>
:::::: CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 25970 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Staging: board: Fix redundant macro
  2017-02-20  9:10 [PATCH] Staging: board: Fix redundant macro =?UTF-8?q?Valentin=20H=C3=BCbner?=
  2017-02-20 12:39 ` kbuild test robot
@ 2017-02-20 12:47 ` Geert Uytterhoeven
  1 sibling, 0 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2017-02-20 12:47 UTC (permalink / raw)
  To: Valentin Hübner; +Cc: Greg Kroah-Hartman, driverdevel, linux-kernel

On Mon, Feb 20, 2017 at 10:10 AM, =?UTF-8?q?Valentin=20H=C3=BCbner?=
<valentin.huebner@gmail.com> wrote:
> Fixes a 'macro with flow control statement' checkpatch code style
> error by removing the board_staging() macro and replacing its one
> and only call

It's not the only user, as 0day has already told you.

> Signed-off-by: Valentin Hübner <valentin.huebner@gmail.com>

NAKed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-02-20 12:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-20  9:10 [PATCH] Staging: board: Fix redundant macro =?UTF-8?q?Valentin=20H=C3=BCbner?=
2017-02-20 12:39 ` kbuild test robot
2017-02-20 12:47 ` Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).