public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Staging: comedi: fix macros do - while loop and spaces before tabs issues in comedidev.h
@ 2010-04-13  6:13 Gustavo Silva
  2010-04-27 22:26 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Gustavo Silva @ 2010-04-13  6:13 UTC (permalink / raw)
  To: gregkh
  Cc: shane.warden, randy.dunlap, mithlesh, devel, linux-kernel,
	Gustavo Silva

This is a patch to the comedidev.h file that fixes up two macros do - while
loop and a space before tabs warnings found by the checkpatch.pl tool.

Signed-off-by: Gustavo Silva <silvagustavo@users.sourceforge.net>
---
 drivers/staging/comedi/comedidev.h |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/comedi/comedidev.h b/drivers/staging/comedi/comedidev.h
index ebdccfd..1b0d84b 100644
--- a/drivers/staging/comedi/comedidev.h
+++ b/drivers/staging/comedi/comedidev.h
@@ -57,14 +57,15 @@
 	static int __init x ## _init_module(void)			\
 		{return comedi_driver_register(&(x)); }			\
 	static void __exit x ## _cleanup_module(void)			\
-		{comedi_driver_unregister(&(x)); } 			\
+		{comedi_driver_unregister(&(x)); }			\
 	module_init(x ## _init_module);					\
 	module_exit(x ## _cleanup_module);
 
-#define COMEDI_MODULE_MACROS						\
-	MODULE_AUTHOR("Comedi http://www.comedi.org");		\
+#define COMEDI_MODULE_MACROS	do {		                        \
+	MODULE_AUTHOR("Comedi http://www.comedi.org");		        \
 	MODULE_DESCRIPTION("Comedi low-level driver");			\
-	MODULE_LICENSE("GPL");
+	MODULE_LICENSE("GPL");                                          \
+} while (0)
 
 #define COMEDI_INITCLEANUP(x)						\
 	COMEDI_MODULE_MACROS		\
@@ -402,7 +403,7 @@ int insn_inval(struct comedi_device *dev, struct comedi_subdevice *s,
 #define RANGE(a, b)		{(a)*1e6, (b)*1e6, 0}
 #define RANGE_ext(a, b)		{(a)*1e6, (b)*1e6, RF_EXTERNAL}
 #define RANGE_mA(a, b)		{(a)*1e6, (b)*1e6, UNIT_mA}
-#define RANGE_unitless(a, b)	{(a)*1e6, (b)*1e6, 0}	/* XXX */
+#define RANGE_unitless(a, b)	do {(a)*1e6, (b)*1e6, 0} while (0) /* XXX */
 #define BIP_RANGE(a)		{-(a)*1e6, (a)*1e6, 0}
 #define UNI_RANGE(a)		{0, (a)*1e6, 0}
 
-- 
1.5.4.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: Staging: comedi: fix macros do - while loop and spaces before tabs issues in comedidev.h
  2010-04-13  6:13 [PATCH] Staging: comedi: fix macros do - while loop and spaces before tabs issues in comedidev.h Gustavo Silva
@ 2010-04-27 22:26 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2010-04-27 22:26 UTC (permalink / raw)
  To: Gustavo Silva
  Cc: gregkh, shane.warden, randy.dunlap, mithlesh, devel, linux-kernel,
	Gustavo Silva

On Tue, Apr 13, 2010 at 01:13:01AM -0500, Gustavo Silva wrote:
> This is a patch to the comedidev.h file that fixes up two macros do - while
> loop and a space before tabs warnings found by the checkpatch.pl tool.
> 
> Signed-off-by: Gustavo Silva <silvagustavo@users.sourceforge.net>
> 
> --- a/drivers/staging/comedi/comedidev.h
> +++ b/drivers/staging/comedi/comedidev.h
> @@ -57,14 +57,15 @@
>  	static int __init x ## _init_module(void)			\
>  		{return comedi_driver_register(&(x)); }			\
>  	static void __exit x ## _cleanup_module(void)			\
> -		{comedi_driver_unregister(&(x)); } 			\
> +		{comedi_driver_unregister(&(x)); }			\
>  	module_init(x ## _init_module);					\
>  	module_exit(x ## _cleanup_module);
>  
> -#define COMEDI_MODULE_MACROS						\
> -	MODULE_AUTHOR("Comedi http://www.comedi.org");		\
> +#define COMEDI_MODULE_MACROS	do {		                        \
> +	MODULE_AUTHOR("Comedi http://www.comedi.org");		        \
>  	MODULE_DESCRIPTION("Comedi low-level driver");			\
> -	MODULE_LICENSE("GPL");
> +	MODULE_LICENSE("GPL");                                          \
> +} while (0)
>  
>  #define COMEDI_INITCLEANUP(x)						\
>  	COMEDI_MODULE_MACROS		\
> @@ -402,7 +403,7 @@ int insn_inval(struct comedi_device *dev, struct comedi_subdevice *s,
>  #define RANGE(a, b)		{(a)*1e6, (b)*1e6, 0}
>  #define RANGE_ext(a, b)		{(a)*1e6, (b)*1e6, RF_EXTERNAL}
>  #define RANGE_mA(a, b)		{(a)*1e6, (b)*1e6, UNIT_mA}
> -#define RANGE_unitless(a, b)	{(a)*1e6, (b)*1e6, 0}	/* XXX */
> +#define RANGE_unitless(a, b)	do {(a)*1e6, (b)*1e6, 0} while (0) /* XXX */

This is not correct, you need to at least build your changes after
making them :(

Care to resend this, without this one change?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-04-27 22:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-13  6:13 [PATCH] Staging: comedi: fix macros do - while loop and spaces before tabs issues in comedidev.h Gustavo Silva
2010-04-27 22:26 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox