* [PATCH v2] tty: moxa: Fix coding style issues
@ 2019-01-21 22:45 Antoine Robertson
2019-01-22 7:15 ` Greg KH
2019-01-22 11:16 ` Jiri Slaby
0 siblings, 2 replies; 4+ messages in thread
From: Antoine Robertson @ 2019-01-21 22:45 UTC (permalink / raw)
To: gregkh; +Cc: jslaby, linux-kernel, Antoine Robertson
Fix coding style issues
Signed-off-by: Antoine Robertson <antoinerbrtsn@gmail.com>
---
drivers/tty/moxa.c | 20 +++++++++-----------
1 file changed, 9 insertions(+), 11 deletions(-)
diff --git a/drivers/tty/moxa.c b/drivers/tty/moxa.c
index 3a1a5e0ee93f..9b6dcb4f7905 100644
--- a/drivers/tty/moxa.c
+++ b/drivers/tty/moxa.c
@@ -42,7 +42,7 @@
#include <linux/slab.h>
#include <linux/ratelimit.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/uaccess.h>
#include "moxa.h"
@@ -74,8 +74,7 @@ enum {
MOXA_BOARD_CP204J,
};
-static char *moxa_brdname[] =
-{
+static const char * const moxa_brdname[] = {
"C218 Turbo PCI series",
"C218 Turbo ISA series",
"C320 Turbo PCI series",
@@ -1159,9 +1158,8 @@ static int moxa_open(struct tty_struct *tty, struct file *filp)
int port;
port = tty->index;
- if (port == MAX_PORTS) {
+ if (port == MAX_PORTS)
return capable(CAP_SYS_ADMIN) ? 0 : -EPERM;
- }
if (mutex_lock_interruptible(&moxa_openlock))
return -ERESTARTSYS;
brd = &moxa_boards[port / MAX_PORTS_PER_BOARD];
@@ -1357,9 +1355,9 @@ static void moxa_new_dcdstate(struct moxa_port *p, u8 dcd)
spin_unlock_irqrestore(&p->port.lock, flags);
if (!dcd)
tty_port_tty_hangup(&p->port, true);
- }
- else
+ } else {
spin_unlock_irqrestore(&p->port.lock, flags);
+ }
}
static int moxa_poll_port(struct moxa_port *p, unsigned int handle,
@@ -1625,10 +1623,10 @@ static void MoxaPortFlushData(struct moxa_port *port, int mode)
* Syntax:
* void MoxaPortFlushData(int port, int mode);
* int port : port number (0 - 127)
- * int mode
- * 0 : flush the Rx buffer
- * 1 : flush the Tx buffer
- * 2 : flush the Rx and Tx buffer
+ * int mode
+ * 0 : flush the Rx buffer
+ * 1 : flush the Tx buffer
+ * 2 : flush the Rx and Tx buffer
*
*
* Function 20: Write data.
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] tty: moxa: Fix coding style issues
2019-01-21 22:45 [PATCH v2] tty: moxa: Fix coding style issues Antoine Robertson
@ 2019-01-22 7:15 ` Greg KH
2019-01-22 11:16 ` Jiri Slaby
1 sibling, 0 replies; 4+ messages in thread
From: Greg KH @ 2019-01-22 7:15 UTC (permalink / raw)
To: Antoine Robertson; +Cc: jslaby, linux-kernel
On Mon, Jan 21, 2019 at 05:45:43PM -0500, Antoine Robertson wrote:
> Fix coding style issues
>
> Signed-off-by: Antoine Robertson <antoinerbrtsn@gmail.com>
> ---
> drivers/tty/moxa.c | 20 +++++++++-----------
> 1 file changed, 9 insertions(+), 11 deletions(-)
What changed from v1?
Always put that below the --- line, as the documentation asks you to do
so.
Please fix up and send a v3.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] tty: moxa: Fix coding style issues
2019-01-21 22:45 [PATCH v2] tty: moxa: Fix coding style issues Antoine Robertson
2019-01-22 7:15 ` Greg KH
@ 2019-01-22 11:16 ` Jiri Slaby
1 sibling, 0 replies; 4+ messages in thread
From: Jiri Slaby @ 2019-01-22 11:16 UTC (permalink / raw)
To: Antoine Robertson, gregkh; +Cc: linux-kernel
On 21. 01. 19, 23:45, Antoine Robertson wrote:
> Fix coding style issues
>
> Signed-off-by: Antoine Robertson <antoinerbrtsn@gmail.com>
> ---
> drivers/tty/moxa.c | 20 +++++++++-----------
> 1 file changed, 9 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/tty/moxa.c b/drivers/tty/moxa.c
> index 3a1a5e0ee93f..9b6dcb4f7905 100644
> --- a/drivers/tty/moxa.c
> +++ b/drivers/tty/moxa.c
...
> @@ -1159,9 +1158,8 @@ static int moxa_open(struct tty_struct *tty, struct file *filp)
> int port;
>
> port = tty->index;
> - if (port == MAX_PORTS) {
> + if (port == MAX_PORTS)
> return capable(CAP_SYS_ADMIN) ? 0 : -EPERM;
> - }
Put a newline instead here, please.
> if (mutex_lock_interruptible(&moxa_openlock))
> return -ERESTARTSYS;
> brd = &moxa_boards[port / MAX_PORTS_PER_BOARD];
--
js
suse labs
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2] tty: moxa: Fix coding style issues
@ 2019-01-19 22:52 Antoine Robertson
0 siblings, 0 replies; 4+ messages in thread
From: Antoine Robertson @ 2019-01-19 22:52 UTC (permalink / raw)
To: gregkh; +Cc: linux-kernel, Antoine Robertson
Fix coding style issues
Signed-off-by: Antoine Robertson <antoinerbrtsn@gmail.com>
---
drivers/tty/moxa.c | 20 +++++++++-----------
1 file changed, 9 insertions(+), 11 deletions(-)
diff --git a/drivers/tty/moxa.c b/drivers/tty/moxa.c
index 3a1a5e0ee93f..9b6dcb4f7905 100644
--- a/drivers/tty/moxa.c
+++ b/drivers/tty/moxa.c
@@ -42,7 +42,7 @@
#include <linux/slab.h>
#include <linux/ratelimit.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/uaccess.h>
#include "moxa.h"
@@ -74,8 +74,7 @@ enum {
MOXA_BOARD_CP204J,
};
-static char *moxa_brdname[] =
-{
+static const char * const moxa_brdname[] = {
"C218 Turbo PCI series",
"C218 Turbo ISA series",
"C320 Turbo PCI series",
@@ -1159,9 +1158,8 @@ static int moxa_open(struct tty_struct *tty, struct file *filp)
int port;
port = tty->index;
- if (port == MAX_PORTS) {
+ if (port == MAX_PORTS)
return capable(CAP_SYS_ADMIN) ? 0 : -EPERM;
- }
if (mutex_lock_interruptible(&moxa_openlock))
return -ERESTARTSYS;
brd = &moxa_boards[port / MAX_PORTS_PER_BOARD];
@@ -1357,9 +1355,9 @@ static void moxa_new_dcdstate(struct moxa_port *p, u8 dcd)
spin_unlock_irqrestore(&p->port.lock, flags);
if (!dcd)
tty_port_tty_hangup(&p->port, true);
- }
- else
+ } else {
spin_unlock_irqrestore(&p->port.lock, flags);
+ }
}
static int moxa_poll_port(struct moxa_port *p, unsigned int handle,
@@ -1625,10 +1623,10 @@ static void MoxaPortFlushData(struct moxa_port *port, int mode)
* Syntax:
* void MoxaPortFlushData(int port, int mode);
* int port : port number (0 - 127)
- * int mode
- * 0 : flush the Rx buffer
- * 1 : flush the Tx buffer
- * 2 : flush the Rx and Tx buffer
+ * int mode
+ * 0 : flush the Rx buffer
+ * 1 : flush the Tx buffer
+ * 2 : flush the Rx and Tx buffer
*
*
* Function 20: Write data.
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-01-22 11:16 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-21 22:45 [PATCH v2] tty: moxa: Fix coding style issues Antoine Robertson
2019-01-22 7:15 ` Greg KH
2019-01-22 11:16 ` Jiri Slaby
-- strict thread matches above, loose matches on Subject: below --
2019-01-19 22:52 Antoine Robertson
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.