Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1556952 > unrolled thread

[PATCH] tty_port: checkpatch: Refactored file to linux style guides

Started byFabian Arnold <fabian.arnold@fau.de>
First post2017-01-11 22:40 +0100
Last post2017-01-12 08:50 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] tty_port: checkpatch: Refactored file to linux style guides Fabian Arnold <fabian.arnold@fau.de> - 2017-01-11 22:40 +0100
    Re: [PATCH] tty_port: checkpatch: Refactored file to linux style  guides Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-12 08:50 +0100

#1556952 — [PATCH] tty_port: checkpatch: Refactored file to linux style guides

FromFabian Arnold <fabian.arnold@fau.de>
Date2017-01-11 22:40 +0100
Subject[PATCH] tty_port: checkpatch: Refactored file to linux style guides
Message-ID<sYyMG-3Dx-7@gated-at.bofh.it>
The tty_port.c file is now accordingly to the linux style guidelines.

Signed-off-by: Fabian Arnold <fabian.arnold@fau.de>
Signed-off-by: Philip Thiemann <philip.thiemann@fau.de>
---
 drivers/tty/tty_port.c | 38 +++++++++++++++++++++++---------------
 1 file changed, 23 insertions(+), 15 deletions(-)

diff --git a/drivers/tty/tty_port.c b/drivers/tty/tty_port.c
index c3f9d93..bc931a1 100644
--- a/drivers/tty/tty_port.c
+++ b/drivers/tty/tty_port.c
@@ -44,7 +44,7 @@ EXPORT_SYMBOL(tty_port_init);
  * tty_register_driver.
  */
 void tty_port_link_device(struct tty_port *port,
-		struct tty_driver *driver, unsigned index)
+		struct tty_driver *driver, unsigned int index)
 {
 	if (WARN_ON(index >= driver->num))
 		return;
@@ -64,7 +64,7 @@ EXPORT_SYMBOL_GPL(tty_port_link_device);
  * Call tty_port_link_device as a last resort.
  */
 struct device *tty_port_register_device(struct tty_port *port,
-		struct tty_driver *driver, unsigned index,
+		struct tty_driver *driver, unsigned int index,
 		struct device *device)
 {
 	tty_port_link_device(port, driver, index);
@@ -86,7 +86,7 @@ EXPORT_SYMBOL_GPL(tty_port_register_device);
  * (or both). Call tty_port_link_device as a last resort.
  */
 struct device *tty_port_register_device_attr(struct tty_port *port,
-		struct tty_driver *driver, unsigned index,
+		struct tty_driver *driver, unsigned int index,
 		struct device *device, void *drvdata,
 		const struct attribute_group **attr_grp)
 {
@@ -363,8 +363,10 @@ int tty_port_block_til_ready(struct tty_port *port,
 	unsigned long flags;
 	DEFINE_WAIT(wait);
 
-	/* if non-blocking mode is set we can pass directly to open unless
-	   the port has just hung up or is in another error state */
+	/*
+	 * if non-blocking mode is set we can pass directly to open unless
+	 * the port has just hung up or is in another error state
+	 */
 	if (tty_io_error(tty)) {
 		tty_port_set_active(port, 1);
 		return 0;
@@ -380,10 +382,11 @@ int tty_port_block_til_ready(struct tty_port *port,
 	if (C_CLOCAL(tty))
 		do_clocal = 1;
 
-	/* Block waiting until we can proceed. We may need to wait for the
-	   carrier, but we must also wait for any close that is in progress
-	   before the next open may complete */
-
+	/*
+	 * Block waiting until we can proceed. We may need to wait for the
+	 * carrier, but we must also wait for any close that is in progress
+	 * before the next open may complete
+	 */
 	retval = 0;
 
 	/* The port lock protects the port counts */
@@ -398,8 +401,10 @@ int tty_port_block_til_ready(struct tty_port *port,
 			tty_port_raise_dtr_rts(port);
 
 		prepare_to_wait(&port->open_wait, &wait, TASK_INTERRUPTIBLE);
-		/* Check for a hangup or uninitialised port.
-							Return accordingly */
+		/*
+		 * Check for a hangup or uninitialised port.
+		 * Return accordingly
+		 */
 		if (tty_hung_up_p(filp) || !tty_port_initialized(port)) {
 			if (port->flags & ASYNC_HUP_NOTIFY)
 				retval = -EAGAIN;
@@ -425,8 +430,10 @@ int tty_port_block_til_ready(struct tty_port *port,
 	}
 	finish_wait(&port->open_wait, &wait);
 
-	/* Update counts. A parallel hangup will have set count to zero and
-	   we must not mess that up further */
+	/*
+	 * Update counts. A parallel hangup will have set count to zero and
+	 * we must not mess that up further
+	 */
 	spin_lock_irqsave(&port->lock, flags);
 	if (!tty_hung_up_p(filp))
 		port->count++;
@@ -583,6 +591,7 @@ int tty_port_open(struct tty_port *port, struct tty_struct *tty,
 		clear_bit(TTY_IO_ERROR, &tty->flags);
 		if (port->ops->activate) {
 			int retval = port->ops->activate(port, tty);
+
 			if (retval) {
 				mutex_unlock(&port->mutex);
 				return retval;
@@ -593,5 +602,4 @@ int tty_port_open(struct tty_port *port, struct tty_struct *tty,
 	mutex_unlock(&port->mutex);
 	return tty_port_block_til_ready(port, tty, filp);
 }
-
 EXPORT_SYMBOL(tty_port_open);
-- 
2.7.4

[toc] | [next] | [standalone]


#1557155 — Re: [PATCH] tty_port: checkpatch: Refactored file to linux style guides

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-01-12 08:50 +0100
SubjectRe: [PATCH] tty_port: checkpatch: Refactored file to linux style guides
Message-ID<sYIiZ-1dR-15@gated-at.bofh.it>
In reply to#1556952
On Wed, Jan 11, 2017 at 10:39:22PM +0100, Fabian Arnold wrote:
> The tty_port.c file is now accordingly to the linux style guidelines.

That's the vaguest changelog text ever :(

Please describe what you did here, and why you did it.  And if you fixed
more than one "type" of style issue, you need to break this up into
multiple patches.

And finally, why are you doing checkpatch cleanup on core kernel code?
Please start in drivers/staging/ where it's more appreciated and you can
learn how to do it correctly, that's what that code is there for.

thanks,

greg k-h

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web