staging: vt6655: fix DBG_PRT and PRINT_K macros
authorGuido Martínez <guido@vanguardiasur.com.ar>
Wed, 2 Apr 2014 17:53:01 +0000 (14:53 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 18 Apr 2014 23:09:32 +0000 (16:09 -0700)
Wrap both macros inside a 'do { ... } while(0)' to prevent breakage if
used within another 'if'. Also fix a usage of DBG_PRT with a missing
semicolon.

Signed-off-by: Guido Martínez <guido@vanguardiasur.com.ar>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vt6655/device.h
drivers/staging/vt6655/wpactl.c

index 062c3a374b99f70c985e70b051fdd414cc8f974c..985c3c19a4a7b779a6f7ded62d90b337d850b4e4 100644 (file)
 
 /*---------------------  Export Types  ------------------------------*/
 
-#define DBG_PRT(l, p, args...) { if (l <= msglevel) printk(p, ##args); }
-#define PRINT_K(p, args...) { if (PRIVATE_Message) printk(p, ##args); }
+#define DBG_PRT(l, p, args...)         \
+do {                                   \
+       if (l <= msglevel)              \
+               printk(p, ##args);      \
+} while (0)
+
+#define PRINT_K(p, args...)            \
+do {                                   \
+       if (PRIVATE_Message)            \
+               printk(p, ##args);      \
+} while (0)
 
 //0:11A 1:11B 2:11G
 typedef enum _VIA_BB_TYPE
index 9f0715cc63673aaade191599dcf48829e1ba19dd..a3a663fd7afaa4bce28da4ad468eb31b129c185d 100644 (file)
@@ -680,7 +680,7 @@ static int wpa_get_scan(PSDevice pDevice,
                ret = -EFAULT;
        }
        param->u.scan_results.scan_count = count;
-       DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " param->u.scan_results.scan_count = %d\n", count)
+       DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " param->u.scan_results.scan_count = %d\n", count);
 
                kfree(pBuf);
        return ret;