staging: dgnc: DGNC_VERIFY_BOARD macro in do while block

This change “staging: dgnc: DGNC_VERIFY_BOARD macro in do while block” (commit 635c4ef) in Linux kernel is authored by Jeremiah Mahler <jmmahler [at] gmail.com> on Sat Jul 12 18:26:39 2014 -0700.

Description of "staging: dgnc: DGNC_VERIFY_BOARD macro in do while block"

The change “staging: dgnc: DGNC_VERIFY_BOARD macro in do while block” introduces changes as follows.

staging: dgnc: DGNC_VERIFY_BOARD macro in do while block

Enclose the body of the multi-statement DGNC_VERIFY_BOARD macro inside a
do - while block as per Documentation/CodingStyle.  Fixes 1 error found
by checkpatch.pl.

Cc: Lidza Louina <lidza.louina@gmail.com>
Signed-off-by: Jeremiah Mahler <jmmahler@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Linux kernel releases containing commit 635c4ef

The Linux kernel releases containing this commit are as follows.

Linux kernel code changes from "staging: dgnc: DGNC_VERIFY_BOARD macro in do while block"

There are 20 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/staging/dgnc/dgnc_sysfs.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)
 
diff --git a/drivers/staging/dgnc/dgnc_sysfs.c b/drivers/staging/dgnc/dgnc_sysfs.c
index 0f0e8fcb663f..3f321bb2b79d 100644
--- a/drivers/staging/dgnc/dgnc_sysfs.c
+++ b/drivers/staging/dgnc/dgnc_sysfs.c
@@ -150,15 +150,17 @@ void dgnc_remove_driver_sysfiles(struct pci_driver *dgnc_driver)
 }
 
 
-#define DGNC_VERIFY_BOARD(p, bd)			\
-	if (!p)						\
-		return 0;				\
-							\
-	bd = dev_get_drvdata(p);			\
-	if (!bd || bd->magic != DGNC_BOARD_MAGIC)	\
-		return 0;				\
-	if (bd->state != BOARD_READY)			\
-		return 0;				\
+#define DGNC_VERIFY_BOARD(p, bd)				\
+	do {							\
+		if (!p)						\
+			return 0;				\
+								\
+		bd = dev_get_drvdata(p);			\
+		if (!bd || bd->magic != DGNC_BOARD_MAGIC)	\
+			return 0;				\
+		if (bd->state != BOARD_READY)			\
+			return 0;				\
+	} while (0)
 
 
 

The commit for this change in Linux stable tree is 635c4ef (patch).

Last modified: 2020/02/10