Staging: board: Fix macro code style error
PATCH 1/1 Staging: board: Fix macro code style error
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 <[email protected]>
--- 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(-)
drivers/staging/board/armadillo800eva.c +9 -1
@@ -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)
drivers/staging/board/board.h +0 -11
@@ -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__ */
drivers/staging/board/kzm9d.c +9 -1
@@ -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)
Signature · 1 line
2.7.4
Greg Kroah-Hartman
maintainerQuoted 3 lines · Valentin Huebner
Fixes a 'macro with flow control statement' checkpatch code style error by removing the
board_staging()macro and replacing its two calls
checkpatch is wrong here, you are now adding more lines than you remove:
Quoted 6 lines
Signed-off-by Valentin Hübner <[email protected]>--- 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(-)
See?
There's nothing wrong with the macro as-is, it's like many other macros we have for module init sequences. checkpatch is just a hint, you still have to use your brain :)
sorry,
greg k-h
Quoted 1 line · Greg Kroah-Hartman
checkpatch is wrong here, you are now adding more lines than you remove:
I see, thank you!
Valentin