All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Peterson <jwp.linux@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Cc: Joe Peterson <jwp.linux@gmail.com>
Subject: [PATCH] staging: board: Remove control flow from macro
Date: Fri,  2 Dec 2022 21:05:44 -0600	[thread overview]
Message-ID: <20221203030544.11543-1-jwp.linux@gmail.com> (raw)

Adhere to Linux coding style

Reported by checkpatch:

WARNING: Macros with flow control statements should be avoided

There is only one return value possible. Remove the checkpatch warning
without effecting functionality.

Signed-off-by: Joe Peterson <jwp.linux@gmail.com>
---
 drivers/staging/board/board.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/board/board.h b/drivers/staging/board/board.h
index 5609daf4d869..94823d3ffbe9 100644
--- a/drivers/staging/board/board.h
+++ b/drivers/staging/board/board.h
@@ -33,12 +33,10 @@ 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)	\
+static void __init runtime_board_check(void)	\
 {						\
 	if (of_machine_is_compatible(str))	\
 		fn();				\
-						\
-	return 0;				\
 }						\
 						\
 device_initcall(runtime_board_check)
-- 
2.20.1


             reply	other threads:[~2022-12-03  3:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-03  3:05 Joe Peterson [this message]
2022-12-03  8:37 ` [PATCH] staging: board: Remove control flow from macro Dan Carpenter
2022-12-03 10:46 ` kernel test robot
2022-12-05  8:52 ` Geert Uytterhoeven

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=20221203030544.11543-1-jwp.linux@gmail.com \
    --to=jwp.linux@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.