[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4FD76B95.60708@xenotime.net>
Date: Tue, 12 Jun 2012 09:17:25 -0700
From: Randy Dunlap <rdunlap@...otime.net>
To: Andrzej Pietrasiewicz <andrzej.p@...sung.com>
CC: linux-usb@...r.kernel.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Felipe Balbi <balbi@...com>,
Marek Szyprowski <m.szyprowski@...sung.com>,
Michal Nazarewicz <mnazarewicz@...il.com>,
Benoit Goby <benoit@...roid.com>,
Mike Lockwood <lockwood@...roid.com>,
Kyungmin Park <kyungmin.park@...sung.com>,
Alan Stern <stern@...land.harvard.edu>,
Stephen Rothwell <sfr@...b.auug.org.au>,
linux-next@...r.kernel.org, linux-kernel@...r.kernel.org,
devel@...verdev.osuosl.org
Subject: Re: [PATCH 2/2] drivers: usb: gadget: add multiple definition guards
On 06/11/2012 02:13 AM, Andrzej Pietrasiewicz wrote:
> If f_fs.c and u_serial.c are combined together using #include, which has
> been a common practice so far, the pr_vdebug macro is defined multiple
> times. Define it only once.
>
> Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@...sung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@...sung.com>
Acked-by: Randy Dunlap <rdunlap@...otime.net>
Thanks.
> ---
> drivers/usb/gadget/f_fs.c | 4 ++++
> drivers/usb/gadget/u_serial.c | 4 ++++
> 2 files changed, 8 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/usb/gadget/f_fs.c b/drivers/usb/gadget/f_fs.c
> index dcd1c7f..27c841d 100644
> --- a/drivers/usb/gadget/f_fs.c
> +++ b/drivers/usb/gadget/f_fs.c
> @@ -33,11 +33,15 @@
> /* Debugging ****************************************************************/
>
> #ifdef VERBOSE_DEBUG
> +#ifndef pr_vdebug
> # define pr_vdebug pr_debug
> +#endif /* pr_vdebug */
> # define ffs_dump_mem(prefix, ptr, len) \
> print_hex_dump_bytes(pr_fmt(prefix ": "), DUMP_PREFIX_NONE, ptr, len)
> #else
> +#ifndef pr_vdebug
> # define pr_vdebug(...) do { } while (0)
> +#endif /* pr_vdebug */
> # define ffs_dump_mem(prefix, ptr, len) do { } while (0)
> #endif /* VERBOSE_DEBUG */
>
> diff --git a/drivers/usb/gadget/u_serial.c b/drivers/usb/gadget/u_serial.c
> index 5b3f5ff..da6d479 100644
> --- a/drivers/usb/gadget/u_serial.c
> +++ b/drivers/usb/gadget/u_serial.c
> @@ -132,11 +132,15 @@ static unsigned n_ports;
>
>
> #ifdef VERBOSE_DEBUG
> +#ifndef pr_vdebug
> #define pr_vdebug(fmt, arg...) \
> pr_debug(fmt, ##arg)
> +#endif /* pr_vdebug */
> #else
> +#ifndef pr_vdebig
> #define pr_vdebug(fmt, arg...) \
> ({ if (0) pr_debug(fmt, ##arg); })
> +#endif /* pr_vdebug */
> #endif
>
> /*-------------------------------------------------------------------------*/
--
~Randy
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists