* [PATCH] drivers: hid: hid-wiimote-modules: fixed code style errors
@ 2014-02-04 23:54 Sebastian Keller
2014-02-05 0:18 ` David Herrmann
0 siblings, 1 reply; 3+ messages in thread
From: Sebastian Keller @ 2014-02-04 23:54 UTC (permalink / raw)
To: dh.herrmann; +Cc: linux-input, Sebastian Keller
Realigned the switch case blocks
Added a space to an (void *) cast
Signed-off-by: Sebastian Keller <sebastiankeller@fastmail.net>
---
drivers/hid/hid-wiimote-modules.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/hid/hid-wiimote-modules.c b/drivers/hid/hid-wiimote-modules.c
index 6b61f01..1882bce 100644
--- a/drivers/hid/hid-wiimote-modules.c
+++ b/drivers/hid/hid-wiimote-modules.c
@@ -353,7 +353,7 @@ static int wiimod_led_probe(const struct wiimod_ops *ops,
if (!led)
return -ENOMEM;
- name = (void*)&led[1];
+ name = (void *)&led[1];
snprintf(name, namesz, "%s:blue:p%lu", dev_name(dev), ops->arg);
led->name = name;
led->brightness = 0;
@@ -689,15 +689,15 @@ static int wiimod_ir_change(struct wiimote_data *wdata, __u16 mode)
/* put IR cam into desired state */
switch (mode) {
- case WIIPROTO_FLAG_IR_FULL:
- format = 5;
- break;
- case WIIPROTO_FLAG_IR_EXT:
- format = 3;
- break;
- case WIIPROTO_FLAG_IR_BASIC:
- format = 1;
- break;
+ case WIIPROTO_FLAG_IR_FULL:
+ format = 5;
+ break;
+ case WIIPROTO_FLAG_IR_EXT:
+ format = 3;
+ break;
+ case WIIPROTO_FLAG_IR_BASIC:
+ format = 1;
+ break;
}
ret = wiimote_cmd_write(wdata, 0xb00033, &format, sizeof(format));
if (ret)
--
1.8.5.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drivers: hid: hid-wiimote-modules: fixed code style errors
2014-02-04 23:54 [PATCH] drivers: hid: hid-wiimote-modules: fixed code style errors Sebastian Keller
@ 2014-02-05 0:18 ` David Herrmann
0 siblings, 0 replies; 3+ messages in thread
From: David Herrmann @ 2014-02-05 0:18 UTC (permalink / raw)
To: Sebastian Keller; +Cc: David Herrmann, open list:HID CORE LAYER
Hi
On Wed, Feb 5, 2014 at 12:54 AM, Sebastian Keller
<sebastiankeller@fastmail.net> wrote:
> Realigned the switch case blocks
> Added a space to an (void *) cast
>
> Signed-off-by: Sebastian Keller <sebastiankeller@fastmail.net>
> ---
> drivers/hid/hid-wiimote-modules.c | 20 ++++++++++----------
> 1 file changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/hid/hid-wiimote-modules.c b/drivers/hid/hid-wiimote-modules.c
> index 6b61f01..1882bce 100644
> --- a/drivers/hid/hid-wiimote-modules.c
> +++ b/drivers/hid/hid-wiimote-modules.c
> @@ -353,7 +353,7 @@ static int wiimod_led_probe(const struct wiimod_ops *ops,
> if (!led)
> return -ENOMEM;
>
> - name = (void*)&led[1];
> + name = (void *)&led[1];
We don't put spaces there if it's a cast. We only do that for type/var
definitions.
> snprintf(name, namesz, "%s:blue:p%lu", dev_name(dev), ops->arg);
> led->name = name;
> led->brightness = 0;
> @@ -689,15 +689,15 @@ static int wiimod_ir_change(struct wiimote_data *wdata, __u16 mode)
>
> /* put IR cam into desired state */
> switch (mode) {
> - case WIIPROTO_FLAG_IR_FULL:
> - format = 5;
> - break;
> - case WIIPROTO_FLAG_IR_EXT:
> - format = 3;
> - break;
> - case WIIPROTO_FLAG_IR_BASIC:
> - format = 1;
> - break;
> + case WIIPROTO_FLAG_IR_FULL:
> + format = 5;
> + break;
> + case WIIPROTO_FLAG_IR_EXT:
> + format = 3;
> + break;
> + case WIIPROTO_FLAG_IR_BASIC:
> + format = 1;
> + break;
That one looks good. Can you resend without the cast-change? Feel free
to add my "Reviewed-by: David Herrmann <dh.herrmann@gmail.com>".
Thanks
David
> }
> ret = wiimote_cmd_write(wdata, 0xb00033, &format, sizeof(format));
> if (ret)
> --
> 1.8.5.3
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] drivers: hid: hid-wiimote-modules: fixed code style errors
@ 2014-02-05 0:45 Sebastian Keller
0 siblings, 0 replies; 3+ messages in thread
From: Sebastian Keller @ 2014-02-05 0:45 UTC (permalink / raw)
To: dh.herrmann; +Cc: linux-input, Sebastian Keller
realigned case statements
Signed-off-by: Sebastian Keller <sebastiankeller@fastmail.net>
---
drivers/hid/hid-wiimote-modules.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/hid/hid-wiimote-modules.c b/drivers/hid/hid-wiimote-modules.c
index 6b61f01..b8306c2 100644
--- a/drivers/hid/hid-wiimote-modules.c
+++ b/drivers/hid/hid-wiimote-modules.c
@@ -689,15 +689,15 @@ static int wiimod_ir_change(struct wiimote_data *wdata, __u16 mode)
/* put IR cam into desired state */
switch (mode) {
- case WIIPROTO_FLAG_IR_FULL:
- format = 5;
- break;
- case WIIPROTO_FLAG_IR_EXT:
- format = 3;
- break;
- case WIIPROTO_FLAG_IR_BASIC:
- format = 1;
- break;
+ case WIIPROTO_FLAG_IR_FULL:
+ format = 5;
+ break;
+ case WIIPROTO_FLAG_IR_EXT:
+ format = 3;
+ break;
+ case WIIPROTO_FLAG_IR_BASIC:
+ format = 1;
+ break;
}
ret = wiimote_cmd_write(wdata, 0xb00033, &format, sizeof(format));
if (ret)
--
1.8.5.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-02-05 0:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-04 23:54 [PATCH] drivers: hid: hid-wiimote-modules: fixed code style errors Sebastian Keller
2014-02-05 0:18 ` David Herrmann
-- strict thread matches above, loose matches on Subject: below --
2014-02-05 0:45 Sebastian Keller
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).