LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] usb: gadget: f_mass_storage: fixed a macro coding style issue
@ 2011-02-11 15:36 ycwang
  2011-02-11 17:39 ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: ycwang @ 2011-02-11 15:36 UTC (permalink / raw)
  To: dbrownell, gregkh, linux-kernel; +Cc: ycwang

Fixed a macro coding style issue.

Signed-off-by: YenCheng Wang <yenchengwang@gmail.com>
---
 drivers/usb/gadget/f_mass_storage.c |   44 +++++++++++++++++++---------------
 1 files changed, 25 insertions(+), 19 deletions(-)

diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c
index b5dbb23..eccdf10 100644
--- a/drivers/usb/gadget/f_mass_storage.c
+++ b/drivers/usb/gadget/f_mass_storage.c
@@ -3122,31 +3122,37 @@ struct fsg_module_parameters {
 };
 
 #define _FSG_MODULE_PARAM_ARRAY(prefix, params, name, type, desc)	\
-	module_param_array_named(prefix ## name, params.name, type,	\
-				 &prefix ## params.name ## _count,	\
-				 S_IRUGO);				\
-	MODULE_PARM_DESC(prefix ## name, desc)
+	do {								\
+		module_param_array_named(prefix ## name, params.name, type,\
+					 &prefix ## params.name ## _count,\
+					 S_IRUGO);			\
+		MODULE_PARM_DESC(prefix ## name, desc)			\
+	} while (0)
 
 #define _FSG_MODULE_PARAM(prefix, params, name, type, desc)		\
-	module_param_named(prefix ## name, params.name, type,		\
-			   S_IRUGO);					\
-	MODULE_PARM_DESC(prefix ## name, desc)
+	do {								\
+		module_param_named(prefix ## name, params.name, type,	\
+				   S_IRUGO);				\
+		MODULE_PARM_DESC(prefix ## name, desc)			\
+	} while (0)
 
 #define FSG_MODULE_PARAMETERS(prefix, params)				\
-	_FSG_MODULE_PARAM_ARRAY(prefix, params, file, charp,		\
-				"names of backing files or devices");	\
-	_FSG_MODULE_PARAM_ARRAY(prefix, params, ro, bool,		\
-				"true to force read-only");		\
-	_FSG_MODULE_PARAM_ARRAY(prefix, params, removable, bool,	\
-				"true to simulate removable media");	\
-	_FSG_MODULE_PARAM_ARRAY(prefix, params, cdrom, bool,		\
+	do {								\
+		_FSG_MODULE_PARAM_ARRAY(prefix, params, file, charp,	\
+					"names of backing files or devices");\
+		_FSG_MODULE_PARAM_ARRAY(prefix, params, ro, bool,	\
+					"true to force read-only");	\
+		_FSG_MODULE_PARAM_ARRAY(prefix, params, removable, bool,\
+					"true to simulate removable media");\
+		_FSG_MODULE_PARAM_ARRAY(prefix, params, cdrom, bool,	\
 				"true to simulate CD-ROM instead of disk"); \
-	_FSG_MODULE_PARAM_ARRAY(prefix, params, nofua, bool,		\
+		_FSG_MODULE_PARAM_ARRAY(prefix, params, nofua, bool,	\
 				"true to ignore SCSI WRITE(10,12) FUA bit"); \
-	_FSG_MODULE_PARAM(prefix, params, luns, uint,			\
-			  "number of LUNs");				\
-	_FSG_MODULE_PARAM(prefix, params, stall, bool,			\
-			  "false to prevent bulk stalls")
+		_FSG_MODULE_PARAM(prefix, params, luns, uint,		\
+				  "number of LUNs");			\
+		_FSG_MODULE_PARAM(prefix, params, stall, bool,		\
+				  "false to prevent bulk stalls")	\
+	} while (0)
 
 static void
 fsg_config_from_params(struct fsg_config *cfg,
-- 
1.7.0.4


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

* Re: [PATCH] usb: gadget: f_mass_storage: fixed a macro coding style issue
  2011-02-11 15:36 [PATCH] usb: gadget: f_mass_storage: fixed a macro coding style issue ycwang
@ 2011-02-11 17:39 ` Greg KH
  2011-02-11 18:57   ` Dmitry Torokhov
  0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2011-02-11 17:39 UTC (permalink / raw)
  To: ycwang; +Cc: dbrownell, linux-kernel

On Fri, Feb 11, 2011 at 11:36:32PM +0800, ycwang wrote:
> Fixed a macro coding style issue.

What macro coding style issue did you fix?  Please be more specific and
resend the patch with a more complete changelog entry.

thanks,

greg k-h

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

* Re: [PATCH] usb: gadget: f_mass_storage: fixed a macro coding style issue
  2011-02-11 17:39 ` Greg KH
@ 2011-02-11 18:57   ` Dmitry Torokhov
  2011-02-11 19:13     ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Torokhov @ 2011-02-11 18:57 UTC (permalink / raw)
  To: Greg KH; +Cc: ycwang, dbrownell, linux-kernel

On Fri, Feb 11, 2011 at 09:39:18AM -0800, Greg KH wrote:
> On Fri, Feb 11, 2011 at 11:36:32PM +0800, ycwang wrote:
> > Fixed a macro coding style issue.
> 
> What macro coding style issue did you fix?  Please be more specific and
> resend the patch with a more complete changelog entry.
> 

It is simply incorrect as it adds do {} while (0) to the module
parameter constructors which are used outside of functions.

The change was never compiled.

-- 
Dmitry

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

* Re: [PATCH] usb: gadget: f_mass_storage: fixed a macro coding style issue
  2011-02-11 18:57   ` Dmitry Torokhov
@ 2011-02-11 19:13     ` Greg KH
       [not found]       ` <AANLkTim_ZiR_GuD3e6KixxtX+r9z0+y2D66VJBRpp1ab@mail.gmail.com>
  0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2011-02-11 19:13 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: ycwang, dbrownell, linux-kernel

On Fri, Feb 11, 2011 at 10:57:10AM -0800, Dmitry Torokhov wrote:
> On Fri, Feb 11, 2011 at 09:39:18AM -0800, Greg KH wrote:
> > On Fri, Feb 11, 2011 at 11:36:32PM +0800, ycwang wrote:
> > > Fixed a macro coding style issue.
> > 
> > What macro coding style issue did you fix?  Please be more specific and
> > resend the patch with a more complete changelog entry.
> > 
> 
> It is simply incorrect as it adds do {} while (0) to the module
> parameter constructors which are used outside of functions.
> 
> The change was never compiled.

Well, I was going to wait until the next iteration of the patch to let
the submitter know that, you just spoiled my fun of watching someone
send a obviously broken patch twice :)

It's the little things in life we live for...

thanks,

greg k-h

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

* Re: [PATCH] usb: gadget: f_mass_storage: fixed a macro coding style issue
       [not found]       ` <AANLkTim_ZiR_GuD3e6KixxtX+r9z0+y2D66VJBRpp1ab@mail.gmail.com>
@ 2011-02-12 16:04         ` Greg KH
  0 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2011-02-12 16:04 UTC (permalink / raw)
  To: yenchengwang; +Cc: Dmitry Torokhov, dbrownell, linux-kernel

On Sat, Feb 12, 2011 at 04:15:21PM +0800, yenchengwang wrote:
> ah, I think I made a mistake...
> I watched this video
> http://archive.fosdem.org/2010/schedule/events/linuxkernelpatch,
> then tried the ./scripts/checkpatch.pl and see two ERROR:...
> so ... sent this patch, I apologize for my mistake, :(

That's great to do that, but you forgot the part of that talk that
showed you had to build your patch to verify that you did not break
anything.  Please do that in the future.

thanks,

greg k-h

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

end of thread, other threads:[~2011-02-12 16:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-11 15:36 [PATCH] usb: gadget: f_mass_storage: fixed a macro coding style issue ycwang
2011-02-11 17:39 ` Greg KH
2011-02-11 18:57   ` Dmitry Torokhov
2011-02-11 19:13     ` Greg KH
     [not found]       ` <AANLkTim_ZiR_GuD3e6KixxtX+r9z0+y2D66VJBRpp1ab@mail.gmail.com>
2011-02-12 16:04         ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).