* [PATCH v2] Staging: ft1000-usb: fixed a few code style issues
@ 2014-03-31 6:26 Anders Darander
2014-03-31 22:55 ` Greg KH
0 siblings, 1 reply; 3+ messages in thread
From: Anders Darander @ 2014-03-31 6:26 UTC (permalink / raw)
To: gregkh; +Cc: marek.belisko, devel, linux-kernel, Anders Darander
Fixed a few code style issues, particularly:
Add do {} while (0) wrapper around seq_* macros.
Change printk(KERN_WARN...) to netdev_warn(...).
Signed-off-by: Anders Darander <anders.darander@gmail.com>
---
Changes:
v2: * Fix syntax errors (adding missing ; and }).
drivers/staging/ft1000/ft1000-usb/ft1000_proc.c | 25 ++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_proc.c b/drivers/staging/ft1000/ft1000-usb/ft1000_proc.c
index 2575d0d..e89b5d2 100644
--- a/drivers/staging/ft1000/ft1000-usb/ft1000_proc.c
+++ b/drivers/staging/ft1000/ft1000-usb/ft1000_proc.c
@@ -32,17 +32,20 @@
#define seq_putx(m, message, size, var) \
- seq_printf(m, message); \
- for (i = 0; i < (size - 1); i++) \
- seq_printf(m, "%02x:", var[i]); \
- seq_printf(m, "%02x\n", var[i])
+ do { \
+ seq_printf(m, message); \
+ for (i = 0; i < (size - 1); i++) \
+ seq_printf(m, "%02x:", var[i]); \
+ seq_printf(m, "%02x\n", var[i]); \
+ } while (0)
#define seq_putd(m, message, size, var) \
- seq_printf(m, message); \
- for (i = 0; i < (size - 1); i++) \
- seq_printf(m, "%d.", var[i]); \
- seq_printf(m, "%d\n", var[i])
-
+ do { \
+ seq_printf(m, message); \
+ for (i = 0; i < (size - 1); i++) \
+ seq_printf(m, "%d.", var[i]); \
+ seq_printf(m, "%d\n", var[i]); \
+ } while (0)
#define FTNET_PROC init_net.proc_net
@@ -200,7 +203,7 @@ int ft1000_init_proc(struct net_device *dev)
info->ft1000_proc_dir = proc_mkdir(FT1000_PROC_DIR, FTNET_PROC);
if (info->ft1000_proc_dir == NULL) {
- printk(KERN_WARNING "Unable to create %s dir.\n",
+ netdev_warn(dev, "Unable to create %s dir.\n",
FT1000_PROC_DIR);
goto fail;
}
@@ -210,7 +213,7 @@ int ft1000_init_proc(struct net_device *dev)
&ft1000_proc_fops, dev);
if (!ft1000_proc_file) {
- printk(KERN_WARNING "Unable to create /proc entry.\n");
+ netdev_warn(dev, "Unable to create /proc entry.\n");
goto fail_entry;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH v2] Staging: ft1000-usb: fixed a few code style issues
2014-03-31 6:26 [PATCH v2] Staging: ft1000-usb: fixed a few code style issues Anders Darander
@ 2014-03-31 22:55 ` Greg KH
2014-04-01 6:34 ` Anders Darander
0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2014-03-31 22:55 UTC (permalink / raw)
To: Anders Darander; +Cc: devel, linux-kernel
On Mon, Mar 31, 2014 at 08:26:28AM +0200, Anders Darander wrote:
> Fixed a few code style issues, particularly:
>
> Add do {} while (0) wrapper around seq_* macros.
> Change printk(KERN_WARN...) to netdev_warn(...).
That's 2 different things, please split this up into 2 different
patches.
Remember, one patch does one thing.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH v2] Staging: ft1000-usb: fixed a few code style issues
2014-03-31 22:55 ` Greg KH
@ 2014-04-01 6:34 ` Anders Darander
0 siblings, 0 replies; 3+ messages in thread
From: Anders Darander @ 2014-04-01 6:34 UTC (permalink / raw)
To: Greg KH; +Cc: devel, linux-kernel
* Greg KH <gregkh@linuxfoundation.org> [140401 00:53]:
> On Mon, Mar 31, 2014 at 08:26:28AM +0200, Anders Darander wrote:
> > Fixed a few code style issues, particularly:
> > Add do {} while (0) wrapper around seq_* macros.
> > Change printk(KERN_WARN...) to netdev_warn(...).
> That's 2 different things, please split this up into 2 different
> patches.
Split up patches on their way.
> Remember, one patch does one thing.
Sure.
In this case I deemed them to be small and though not the same, but
still mosly coding style issues. Though, I can certainly see that the
printk to netdev_warn actually adds more than just a coding style
clean-up.
Cheers,
Anders
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-04-01 6:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-31 6:26 [PATCH v2] Staging: ft1000-usb: fixed a few code style issues Anders Darander
2014-03-31 22:55 ` Greg KH
2014-04-01 6:34 ` Anders Darander
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.