linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tty_port: checkpatch: Refactored file to linux style guides
@ 2017-01-11 21:39 Fabian Arnold
  2017-01-12  7:49 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 2+ messages in thread
From: Fabian Arnold @ 2017-01-11 21:39 UTC (permalink / raw)
  To: devel
  Cc: Fabian Arnold, Greg Kroah-Hartman, Jiri Slaby, linux-kernel,
	linux-kernel, Philip Thiemann

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] tty_port: checkpatch: Refactored file to linux style guides
  2017-01-11 21:39 [PATCH] tty_port: checkpatch: Refactored file to linux style guides Fabian Arnold
@ 2017-01-12  7:49 ` Greg Kroah-Hartman
  0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2017-01-12  7:49 UTC (permalink / raw)
  To: Fabian Arnold
  Cc: devel, Philip Thiemann, linux-kernel, linux-kernel, Jiri Slaby

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-01-12  7:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-11 21:39 [PATCH] tty_port: checkpatch: Refactored file to linux style guides Fabian Arnold
2017-01-12  7:49 ` Greg Kroah-Hartman

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).