Skip to contentSkip to conversation

Fixed most indent issues in tty_io.c

PATCH In review volery 4 participants 6 messages Sep 7, 2019 – Sep 9, 2019 TTY layer and serial drivers

lore
Share & tools
lore

volery

author
#0 lore raw

PATCH 1/1 Fixed most indent issues in tty_io.c

There were a lot of styling problems using space then tab or spaces instead of tabs in that file. Especially the entire function at line 2677.
Also added a space before the : on line 2221.

---
 drivers/tty/tty_io.c | 60 ++++++++++++++++++++++----------------------
 1 file changed, 30 insertions(+), 30 deletions(-)
drivers/tty/tty_io.c +30 -30
index 566728fbaf3c..38c36ff7221b 100644
@@ -33,7 +33,7 @@
  *	-- Nick Holloway <[email protected]>, 27th May 1993.
  *
  * Rewrote canonical mode and added more termios flags.
- * 	-- [email protected] (J. Cowley), 13Jan94
+ *	-- [email protected] (J. Cowley), 13Jan94
  *
  * Reorganized FASYNC support so mouse code can share it.
  *	-- [email protected], 9Sep95
@@ -1026,13 +1026,13 @@ static ssize_t tty_write(struct file *file, const char __user *buf,
 						size_t count, loff_t *ppos)
 {
 	struct tty_struct *tty = file_tty(file);
- 	struct tty_ldisc *ld;
+	struct tty_ldisc *ld;
 	ssize_t ret;
 
 	if (tty_paranoia_check(tty, file_inode(file), "tty_write"))
 		return -EIO;
 	if (!tty || !tty->ops->write ||	tty_io_error(tty))
-			return -EIO;
+		return -EIO;
 	/* Short term debug to catch buggy drivers */
 	if (tty->ops->write_room == NULL)
 		tty_err(tty, "missing write_room method\n");
@@ -1247,8 +1247,8 @@ static void tty_driver_remove_tty(struct tty_driver *driver, struct tty_struct *
 }
 
 /*
- * 	tty_reopen()	- fast re-open of an open tty
- * 	@tty	- the tty to open
+ *	tty_reopen()	- fast re-open of an open tty
+ *	@tty	- the tty to open
  *
  *	Return 0 on success, -errno on error.
  *	Re-opens on master ptys are not allowed and return -EIO.
@@ -1829,8 +1829,8 @@ static struct tty_struct *tty_open_current_tty(dev_t device, struct file *filp)
  *	@index: index for the device in the @return driver
  *	@return: driver for this inode (with increased refcount)
  *
- * 	If @return is not erroneous, the caller is responsible to decrement the
- * 	refcount by tty_driver_kref_put.
+ *	If @return is not erroneous, the caller is responsible to decrement the
+ *	refcount by tty_driver_kref_put.
  *
  *	Locking: tty_mutex protects get_tty_driver
  */
@@ -2218,7 +2218,7 @@ static int tiocgwinsz(struct tty_struct *tty, struct winsize __user *arg)
 	err = copy_to_user(arg, &tty->winsize, sizeof(*arg));
 	mutex_unlock(&tty->winsize_mutex);
 
-	return err ? -EFAULT: 0;
+	return err ? -EFAULT : 0;
 }
 
 /**
@@ -2674,25 +2674,25 @@ long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 #ifdef CONFIG_COMPAT
 
 struct serial_struct32 {
-        compat_int_t    type;
-        compat_int_t    line;
-        compat_uint_t   port;
-        compat_int_t    irq;
-        compat_int_t    flags;
-        compat_int_t    xmit_fifo_size;
-        compat_int_t    custom_divisor;
-        compat_int_t    baud_base;
-        unsigned short  close_delay;
-        char    io_type;
-        char    reserved_char[1];
-        compat_int_t    hub6;
-        unsigned short  closing_wait; /* time to wait before closing */
-        unsigned short  closing_wait2; /* no longer used... */
-        compat_uint_t   iomem_base;
-        unsigned short  iomem_reg_shift;
-        unsigned int    port_high;
+	compat_int_t    type;
+	compat_int_t    line;
+	compat_uint_t   port;
+	compat_int_t    irq;
+	compat_int_t    flags;
+	compat_int_t    xmit_fifo_size;
+	compat_int_t    custom_divisor;
+	compat_int_t    baud_base;
+	unsigned short  close_delay;
+	char    io_type;
+	char    reserved_char[1];
+	compat_int_t    hub6;
+	unsigned short  closing_wait; /* time to wait before closing */
+	unsigned short  closing_wait2; /* no longer used... */
+	compat_uint_t   iomem_base;
+	unsigned short  iomem_reg_shift;
+	unsigned int    port_high;
      /* compat_ulong_t  iomap_base FIXME */
-        compat_int_t    reserved[1];
+	compat_int_t    reserved[1];
 };
 
 static int compat_tty_tiocsserial(struct tty_struct *tty,
@@ -3176,11 +3176,11 @@ struct device *tty_register_device_attr(struct tty_driver *driver,
 EXPORT_SYMBOL_GPL(tty_register_device_attr);
 
 /**
- * 	tty_unregister_device - unregister a tty device
- * 	@driver: the tty driver that describes the tty device
- * 	@index: the index in the tty driver for this tty device
+ *	tty_unregister_device - unregister a tty device
+ *	@driver: the tty driver that describes the tty device
+ *	@index: the index in the tty driver for this tty device
  *
- * 	If a tty device is registered with a call to tty_register_device() then
+ *	If a tty device is registered with a call to tty_register_device() then
  *	this function must be called when the tty device is gone.
  *
  *	Locking: ??
Signature · 1 line
2.23.0
maintainer
#1 lore raw
Quoted 9 lines · volery

There were a lot of styling problems using space then tab or spaces instead of tabs in that file. Especially the entire function at line 2677.
Also added a space before the : on line 2221.

---
 drivers/tty/tty_io.c | 60 ++++++++++++++++++++++----------------------
 1 file changed, 30 insertions(+), 30 deletions(-)

Hi,

This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him a patch that has triggered this response. He used to manually respond to these common problems, but in order to save his sanity (he kept writing the same thing over and over, yet to different people), I was created. Hopefully you will not take offence and will fix the problem in your patch and resubmit it so that it can be accepted into the Linux kernel tree.

You are receiving this message because of the following common error(s) as indicated below:

- Your patch breaks the build.

- Your patch did many different things all at once, making it difficult to review. All Linux kernel patches need to only do one thing at a time. If you need to do multiple things (such as clean up all coding style issues in a file/driver), do it in a sequence of patches, each one doing only one thing. This will make it easier to review the patches to ensure that they are correct, and to help alleviate any merge issues that larger patches can cause.

- You did not specify a description of why the patch is needed, or possibly, any description at all, in the email body. Please read the section entitled "The canonical patch format" in the kernel file, Documentation/SubmittingPatches for what is needed in order to properly describe the change.

- You did not write a descriptive Subject: for the patch, allowing Greg, and everyone else, to know what this patch is all about. Please read the section entitled "The canonical patch format" in the kernel file, Documentation/SubmittingPatches for what a proper Subject: line should look like.

- It looks like you did not use your "real" name for the patch on either the Signed-off-by: line, or the From: line (both of which have to match). Please read the kernel file, Documentation/SubmittingPatches for how to do this correctly.

If you wish to discuss this problem further, or you have questions about how to resolve this issue, please feel free to respond to this email and Greg will reply once he has dug out from the pending patches received from other developers.

thanks,

greg k-h's patch email bot

#2 lore raw
In reply to volery
Quoted 4 lines · volery

There were a lot of styling problems using space then tab or spaces instead of tabs in that file. Especially the entire function at line 2677.
Also added a space before the : on line 2221.

You do not have an appropriate subject line.

This subject should probably be something like:

[PATCH] tty: tty_io: Use normal indentation

Please make changes only in drivers/staging until you are really familiar with the linux kernel patch process.

#3 lore raw

Sandro V

Quoted 8 lines
Quoted 7 lines · Joe Perches

On Sat, 2019-09-07 at 11:09 +0200, volery wrote:
There were a lot of styling problems using space then tab or spaces instead of tabs in that file. Especially the entire function at line 2677.
Also added a space before the : on line 2221.

Quoted 8 lines

You do not have an appropriate subject line.

This subject should probably be something like:

[PATCH] tty: tty_io: Use normal indentation

Please make changes only in drivers/staging until you are really familiar with the linux kernel patch process.

Yep, noticed that I had the subject line wrong on this one too after Dan told me about that today.
I'll take that drivers/staging thing into account :)

Thanks again
Sandro

#4 lore raw

Hi Sandro,

It's not mentioned in the process documentation (but maybe we should add this), is that it's up to individual maintainers about whether or not whitespace cleanups are accepted outside of the staging tree.

That's because whitespace cleanups are a great "training wheel" for newbies who are learning the ropes, but they do have some costs. For example, for actively developed portions of the kernel whitespace cleans can often break other pending changes. Also, trivial cleanups (e.g., spelling and whitespace cleanups) makes it more likely that future bug fixes in that portion of the kernel will fail to be automatically backported to the stable kernel, thus requiring a manual backport effort.

As a result, some maintainers will reject trivial cleanups unless they are part of a patch series that is making some kind of substantive improvement to the kernel (beyond trivial cleanups).

There are some good aspects of fixing whitespace issues, of course, which is why they are encouraged in the staging tree, but there is not consensus amongst maintainers about whether it is a net benefit to do clean up patches just for the sake of doing cleanup patches.

(And of course, sometimes the checkpatch rules change over time --- at one point, checkpatch would warn if *any* line was longer than 80 characters, and so there were tons and tons of trivial cleanups to "fix" this, including breaking up strings. When enough people complained that this actually made it harder to find kernel messages that got split, checkpatch changed to complain when strings were split across lines, and more trivial patches got sent out undoing previous trivial patches. And this caused all of the same downsides of breaking automated stable backports, *twice*. As such, newbies are strongly encouraged to restrict their checkpatch cleanups to the staging tree, since when such cleanup patches are considered welcome very much depends on the kernel subsystem and the maintainers involved.)

Cheers,

- Ted

#5 lore raw
Quoted 5 lines

strongly encouraged to restrict their checkpatch cleanups to the staging tree, since when such cleanup patches are considered welcome very much depends on the kernel subsystem and the maintainers involved.)

Should I still send the ones I tried to submit in this thread again as separate patches? Since Greg said I should do it that way so I'm not sure if I should do that quick or just stick to staging.

Thanks,
Sandro V.