* [PATCH] Staging: frontier: alphatrack: Fixed coding style issues
@ 2010-11-02 9:43 Audun Hoem
2010-11-02 13:32 ` Greg KH
2010-11-02 13:39 ` Greg KH
0 siblings, 2 replies; 7+ messages in thread
From: Audun Hoem @ 2010-11-02 9:43 UTC (permalink / raw)
To: gregkh; +Cc: devel, linux-kernel, audun
From: audun <audun.hoem@gmail.com>
I cleaned up the coding style.
Signed-off-by: Audun Hoem <audun.hoem@gmail.com>
---
drivers/staging/frontier/alphatrack.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/frontier/alphatrack.c b/drivers/staging/frontier/alphatrack.c
index ef7fbf8..9d439fa 100644
--- a/drivers/staging/frontier/alphatrack.c
+++ b/drivers/staging/frontier/alphatrack.c
@@ -88,8 +88,11 @@ MODULE_SUPPORTED_DEVICE("Frontier Designs Alphatrack Control Surface");
static int debug = ALPHATRACK_DEBUG;
/* Use our own dbg macro */
-#define dbg_info(dev, format, arg...) do \
- { if (debug) dev_info(dev , format , ## arg); } while (0)
+#define dbg_info(dev, format, arg...) \
+do {
+ if (debug)
+ dev_info(dev , format , ## arg);
+} while (0)
#define alphatrack_ocmd_info(dev, cmd, format, arg...)
@@ -769,7 +772,7 @@ static int usb_alphatrack_probe(struct usb_interface *intf,
}
dev->write_buffer =
- kmalloc(sizeof(struct alphatrack_ocmd) * true_size, GFP_KERNEL);
+ kmalloc(sizeof(struct alphatrack_ocmd) *true_size, GFP_KERNEL);
if (!dev->write_buffer) {
dev_err(&intf->dev, "Couldn't allocate write_buffer\n");
--
1.7.0.4
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH] Staging: frontier: alphatrack: Fixed coding style issues
2010-11-02 9:43 [PATCH] Staging: frontier: alphatrack: Fixed coding style issues Audun Hoem
@ 2010-11-02 13:32 ` Greg KH
2010-11-02 13:39 ` Greg KH
1 sibling, 0 replies; 7+ messages in thread
From: Greg KH @ 2010-11-02 13:32 UTC (permalink / raw)
To: Audun Hoem; +Cc: gregkh, devel, linux-kernel
On Tue, Nov 02, 2010 at 10:43:44AM +0100, Audun Hoem wrote:
> From: audun <audun.hoem@gmail.com>
Minor nit, use your full name here in the From: line.
>
> I cleaned up the coding style.
>
> Signed-off-by: Audun Hoem <audun.hoem@gmail.com>
Like you used here, that's the correct thing to put here.
> ---
> drivers/staging/frontier/alphatrack.c | 9 ++++++---
> 1 files changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/frontier/alphatrack.c b/drivers/staging/frontier/alphatrack.c
> index ef7fbf8..9d439fa 100644
> --- a/drivers/staging/frontier/alphatrack.c
> +++ b/drivers/staging/frontier/alphatrack.c
> @@ -88,8 +88,11 @@ MODULE_SUPPORTED_DEVICE("Frontier Designs Alphatrack Control Surface");
> static int debug = ALPHATRACK_DEBUG;
>
> /* Use our own dbg macro */
> -#define dbg_info(dev, format, arg...) do \
> - { if (debug) dev_info(dev , format , ## arg); } while (0)
> +#define dbg_info(dev, format, arg...) \
> +do {
> + if (debug)
> + dev_info(dev , format , ## arg);
> +} while (0)
In the future, you can probably just remove this macro and switch the
dev_info() users in the driver to use dev_dbg() as it handles the debug
toggle already. Then you can remove the debug variable as well as the
debugging is handled by the dynamic debug core code in the kernel.
Thanks for the patch, I'll queue it up later and you will get an
automated email when it goes into my tree.
greg k-h
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] Staging: frontier: alphatrack: Fixed coding style issues
2010-11-02 9:43 [PATCH] Staging: frontier: alphatrack: Fixed coding style issues Audun Hoem
2010-11-02 13:32 ` Greg KH
@ 2010-11-02 13:39 ` Greg KH
1 sibling, 0 replies; 7+ messages in thread
From: Greg KH @ 2010-11-02 13:39 UTC (permalink / raw)
To: Audun Hoem; +Cc: gregkh, devel, linux-kernel
On Tue, Nov 02, 2010 at 10:43:44AM +0100, Audun Hoem wrote:
> From: Audun Hoem <audun.hoem@gmail.com>
>
> I cleaned up the coding style.
>
> Signed-off-by: Audun Hoem <audun.hoem@gmail.com>
> ---
> drivers/staging/frontier/alphatrack.c | 9 ++++++---
> 1 files changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/frontier/alphatrack.c b/drivers/staging/frontier/alphatrack.c
> index ef7fbf8..9d439fa 100644
> --- a/drivers/staging/frontier/alphatrack.c
> +++ b/drivers/staging/frontier/alphatrack.c
> @@ -88,8 +88,11 @@ MODULE_SUPPORTED_DEVICE("Frontier Designs Alphatrack Control Surface");
> static int debug = ALPHATRACK_DEBUG;
>
> /* Use our own dbg macro */
> -#define dbg_info(dev, format, arg...) do \
> - { if (debug) dev_info(dev , format , ## arg); } while (0)
> +#define dbg_info(dev, format, arg...) \
> +do {
> + if (debug)
> + dev_info(dev , format , ## arg);
> +} while (0)
Oops, no, this doesn't work, and it breaks the build. Did you test your
patch after you made it?
(hint, you need to add a few more '\' characters...)
Care to redo this and resend it?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] staging: frontier: alphatrack: fixed coding style issues
@ 2010-11-02 15:31 Audun Hoem
2010-11-02 15:37 ` Joe Perches
0 siblings, 1 reply; 7+ messages in thread
From: Audun Hoem @ 2010-11-02 15:31 UTC (permalink / raw)
To: gregkh; +Cc: devel, linux-kernel, Audun Hoem
Cleaned up a macro definition and another simple style warning.
Signed-off-by: Audun Hoem <audun.hoem@gmail.com>
---
drivers/staging/frontier/alphatrack.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/frontier/alphatrack.c b/drivers/staging/frontier/alphatrack.c
index ef7fbf8..6e3bd73 100644
--- a/drivers/staging/frontier/alphatrack.c
+++ b/drivers/staging/frontier/alphatrack.c
@@ -88,8 +88,11 @@ MODULE_SUPPORTED_DEVICE("Frontier Designs Alphatrack Control Surface");
static int debug = ALPHATRACK_DEBUG;
/* Use our own dbg macro */
-#define dbg_info(dev, format, arg...) do \
- { if (debug) dev_info(dev , format , ## arg); } while (0)
+#define dbg_info(dev, format, arg...) \
+do { \
+ if (debug) \
+ dev_info(dev , format , ## arg); \
+} while (0)
#define alphatrack_ocmd_info(dev, cmd, format, arg...)
@@ -769,7 +772,7 @@ static int usb_alphatrack_probe(struct usb_interface *intf,
}
dev->write_buffer =
- kmalloc(sizeof(struct alphatrack_ocmd) * true_size, GFP_KERNEL);
+ kmalloc(sizeof(struct alphatrack_ocmd) *true_size, GFP_KERNEL);
if (!dev->write_buffer) {
dev_err(&intf->dev, "Couldn't allocate write_buffer\n");
--
1.7.0.4
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH] staging: frontier: alphatrack: fixed coding style issues
2010-11-02 15:31 [PATCH] staging: frontier: alphatrack: fixed " Audun Hoem
@ 2010-11-02 15:37 ` Joe Perches
2010-11-02 16:06 ` Audun Hoem
0 siblings, 1 reply; 7+ messages in thread
From: Joe Perches @ 2010-11-02 15:37 UTC (permalink / raw)
To: Audun Hoem; +Cc: gregkh, devel, linux-kernel
On Tue, 2010-11-02 at 16:31 +0100, Audun Hoem wrote:
> Cleaned up a macro definition and another simple style warning.
> Signed-off-by: Audun Hoem <audun.hoem@gmail.com>
> ---
> drivers/staging/frontier/alphatrack.c | 9 ++++++---
> 1 files changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/frontier/alphatrack.c b/drivers/staging/frontier/alphatrack.c
> index ef7fbf8..6e3bd73 100644
> --- a/drivers/staging/frontier/alphatrack.c
> +++ b/drivers/staging/frontier/alphatrack.c
> @@ -88,8 +88,11 @@ MODULE_SUPPORTED_DEVICE("Frontier Designs Alphatrack Control Surface");
> static int debug = ALPHATRACK_DEBUG;
>
> /* Use our own dbg macro */
> -#define dbg_info(dev, format, arg...) do \
> - { if (debug) dev_info(dev , format , ## arg); } while (0)
> +#define dbg_info(dev, format, arg...) \
> +do { \
> + if (debug) \
> + dev_info(dev , format , ## arg); \
There is no need for the spaces before commas.
gcc 2.xx required a space before a comma with a trailing ##arg,
but that compiler version is no longer supported.
This should be:
dev_info(dev, format, ##arg);
though I think using dev_dbg and getting rid of the dbg_info
macro is better.
> +} while (0)
>
> #define alphatrack_ocmd_info(dev, cmd, format, arg...)
>
> @@ -769,7 +772,7 @@ static int usb_alphatrack_probe(struct usb_interface *intf,
> }
>
> dev->write_buffer =
> - kmalloc(sizeof(struct alphatrack_ocmd) * true_size, GFP_KERNEL);
> + kmalloc(sizeof(struct alphatrack_ocmd) *true_size, GFP_KERNEL);
Not an improvement.
If checkpatch warns about this, it's a checkpatch defect.
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] staging: frontier: alphatrack: fixed coding style issues
2010-11-02 15:37 ` Joe Perches
@ 2010-11-02 16:06 ` Audun Hoem
2010-11-02 16:10 ` Audun Hoem
0 siblings, 1 reply; 7+ messages in thread
From: Audun Hoem @ 2010-11-02 16:06 UTC (permalink / raw)
To: Joe Perches; +Cc: gregkh, devel, linux-kernel
On 11/2/10, Joe Perches <joe@perches.com> wrote:
> On Tue, 2010-11-02 at 16:31 +0100, Audun Hoem wrote:
>> Cleaned up a macro definition and another simple style warning.
>> Signed-off-by: Audun Hoem <audun.hoem@gmail.com>
>> ---
>> drivers/staging/frontier/alphatrack.c | 9 ++++++---
>> 1 files changed, 6 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/staging/frontier/alphatrack.c
>> b/drivers/staging/frontier/alphatrack.c
>> index ef7fbf8..6e3bd73 100644
>> --- a/drivers/staging/frontier/alphatrack.c
>> +++ b/drivers/staging/frontier/alphatrack.c
>> @@ -88,8 +88,11 @@ MODULE_SUPPORTED_DEVICE("Frontier Designs Alphatrack
>> Control Surface");
>> static int debug = ALPHATRACK_DEBUG;
>>
>> /* Use our own dbg macro */
>> -#define dbg_info(dev, format, arg...) do \
>> - { if (debug) dev_info(dev , format , ## arg); } while (0)
>> +#define dbg_info(dev, format, arg...) \
>> +do { \
>> + if (debug) \
>> + dev_info(dev , format , ## arg); \
>
> There is no need for the spaces before commas.
>
> gcc 2.xx required a space before a comma with a trailing ##arg,
> but that compiler version is no longer supported.
>
> This should be:
> dev_info(dev, format, ##arg);
>
> though I think using dev_dbg and getting rid of the dbg_info
> macro is better.
>
I was planning to remove the patch in a later patch, which I at the
time thought was necessary, but in light of this checkpatch fault, I
guess I could have just pushed it in this one.
>> +} while (0)
>>
>> #define alphatrack_ocmd_info(dev, cmd, format, arg...)
>>
>> @@ -769,7 +772,7 @@ static int usb_alphatrack_probe(struct usb_interface
>> *intf,
>> }
>>
>> dev->write_buffer =
>> - kmalloc(sizeof(struct alphatrack_ocmd) * true_size, GFP_KERNEL);
>> + kmalloc(sizeof(struct alphatrack_ocmd) *true_size, GFP_KERNEL);
>
> Not an improvement.
>
> If checkpatch warns about this, it's a checkpatch defect.
Interesting. Apparently it mistook the multiplication operator for the
unary * operator. May take a look at that perl script later.
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] staging: frontier: alphatrack: fixed coding style issues
2010-11-02 16:06 ` Audun Hoem
@ 2010-11-02 16:10 ` Audun Hoem
0 siblings, 0 replies; 7+ messages in thread
From: Audun Hoem @ 2010-11-02 16:10 UTC (permalink / raw)
To: Joe Perches; +Cc: Audun Hoem, gregkh, devel, linux-kernel
> I was planning to remove the patch in a later patch, which I at the
> time thought was necessary, but in light of this checkpatch fault, I
> guess I could have just pushed it in this one.
Sorry, meant to say "remove the macro," of course.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2010-11-02 16:10 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-02 9:43 [PATCH] Staging: frontier: alphatrack: Fixed coding style issues Audun Hoem
2010-11-02 13:32 ` Greg KH
2010-11-02 13:39 ` Greg KH
-- strict thread matches above, loose matches on Subject: below --
2010-11-02 15:31 [PATCH] staging: frontier: alphatrack: fixed " Audun Hoem
2010-11-02 15:37 ` Joe Perches
2010-11-02 16:06 ` Audun Hoem
2010-11-02 16:10 ` Audun Hoem
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox