Skip to contentSkip to conversation

dgnc: DGNC_VERIFY_BOARD macro in do while block

PATCH New Jeremiah Mahler 1 participant 1 message Jul 13, 2014 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/staging/dgnc/dgnc_sysfs.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)
drivers/staging/dgnc/dgnc_sysfs.c +11 -9
index 0f0e8fc..3f321bb 100644
@@ -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)
 
 
 
Signature · 1 line
2.0.1