Re: [PATCH 1/3] staging: dgng: Fix Macros with complex values should be enclosed in parenthesis

From: Joe Perches
Date: Thu Jul 24 2014 - 13:52:44 EST


On Fri, 2014-07-25 at 00:26 +0900, Seunghun Lee wrote:
> This patch fixes a checkpatch errors
> "Macros with complex values should be enclosed in parenthesis"
[]
> diff --git a/drivers/staging/dgnc/dgnc_driver.h b/drivers/staging/dgnc/dgnc_driver.h

> @@ -111,32 +111,32 @@
> #endif
>
> #if defined TRC_TO_KMEM
> -#define PRINTF_TO_KMEM(args) dgnc_tracef args
> +#define PRINTF_TO_KMEM(args) do { dgnc_tracef args } while (0)

All this _TO_KMEM code is #if 0 in dgnc_trace.h

It'd be good to change the dgnc_tracef prototype to use
__printf(1, 2)

and this code in drivers/staging/dgnc/dgnc_driver.h:

#if defined TRC_TO_CONSOLE
#define PRINTF_TO_CONSOLE(args) { printk(DRVSTR": "); printk args; }
#else /* !defined TRACE_TO_CONSOLE */
#define PRINTF_TO_CONSOLE(args)
#endif

should really consolidate the printk to something like:

#define PRINTF_TO_CONSOLE(fmt, ...) \
printk(KERN_INFO DRVSTR ": " fmt, ##__VA_ARGS__)


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/