2014-11-05 17:26:55

by Peter Hurley

[permalink] [raw]
Subject: [PATCH -next 0/9] various tty cleanups

Hi Greg,

These patches are a mixture of dead declaration removals, uapi cleanup,
and other miscellany.

This series depends on the 10-patch 'serial core fixes' series.

Regards,

Peter Hurley (9):
tty: Replace open-coded test with tty_hung_up_p()
tty: Call methods in modern style
tty: Remove defunct pcxe_open() declaration
tty: Remove defunct serial_console_init() declaration
serial: hp300: Remove obsolete comments
cris: Remove obsolete ASYNC_SPLIT_TERMIOS behavior
tty: Document defunct ASYNC_SPLIT_TERMIOS flag in uapi header
vt: Remove vt_get_kmsg_redirect() from uapi header
serial: 8250_em: Remove out-of-memory message

drivers/tty/serial/8250/8250_em.c | 4 +---
drivers/tty/serial/8250/8250_hp300.c | 4 ----
drivers/tty/serial/crisv10.c | 12 ------------
drivers/tty/serial/crisv10.h | 1 -
drivers/tty/tty_io.c | 14 +++++++-------
drivers/tty/tty_ioctl.c | 4 ++--
drivers/tty/vt/vt.c | 2 ++
include/linux/tty.h | 8 --------
include/uapi/linux/tty_flags.h | 2 +-
include/uapi/linux/vt.h | 3 ---
10 files changed, 13 insertions(+), 41 deletions(-)

--
2.1.3


2014-11-05 17:26:59

by Peter Hurley

[permalink] [raw]
Subject: [PATCH -next 8/9] vt: Remove vt_get_kmsg_redirect() from uapi header

vt_get_kmsg_redirect() only has meaning to the console driver as
an alias for calling vt_kmsg_redirect(). Move the macro definition
to the only source file which uses it; remove from uapi/linux/vt.h

Signed-off-by: Peter Hurley <[email protected]>
---
drivers/tty/vt/vt.c | 2 ++
include/uapi/linux/vt.h | 3 ---
2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
index b33b00b..3dc5d56 100644
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -2509,6 +2509,8 @@ int vt_kmsg_redirect(int new)
return kmsg_con;
}

+#define vt_get_kmsg_redirect() vt_kmsg_redirect(-1)
+
/*
* Console on virtual terminal
*
diff --git a/include/uapi/linux/vt.h b/include/uapi/linux/vt.h
index 4b59a26..978578b 100644
--- a/include/uapi/linux/vt.h
+++ b/include/uapi/linux/vt.h
@@ -84,7 +84,4 @@ struct vt_setactivate {

#define VT_SETACTIVATE 0x560F /* Activate and set the mode of a console */

-
-#define vt_get_kmsg_redirect() vt_kmsg_redirect(-1)
-
#endif /* _UAPI_LINUX_VT_H */
--
2.1.3

2014-11-05 17:26:58

by Peter Hurley

[permalink] [raw]
Subject: [PATCH -next 3/9] tty: Remove defunct pcxe_open() declaration

pcxe_open() has no definition in mainline; remove declaration.

Signed-off-by: Peter Hurley <[email protected]>
---
include/linux/tty.h | 4 ----
1 file changed, 4 deletions(-)

diff --git a/include/linux/tty.h b/include/linux/tty.h
index f6835ea..97cfb31 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -621,10 +621,6 @@ extern long n_tty_compat_ioctl_helper(struct tty_struct *tty, struct file *file,

extern void serial_console_init(void);

-/* pcxx.c */
-
-extern int pcxe_open(struct tty_struct *tty, struct file *filp);
-
/* vt.c */

extern int vt_ioctl(struct tty_struct *tty,
--
2.1.3

2014-11-05 17:27:20

by Peter Hurley

[permalink] [raw]
Subject: [PATCH -next 9/9] serial: 8250_em: Remove out-of-memory message

devm_kzalloc() already warns if allocation fails; remove duplicate
message.

Signed-off-by: Peter Hurley <[email protected]>
---
drivers/tty/serial/8250/8250_em.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_em.c b/drivers/tty/serial/8250/8250_em.c
index 56c8723..478599d 100644
--- a/drivers/tty/serial/8250/8250_em.c
+++ b/drivers/tty/serial/8250/8250_em.c
@@ -102,10 +102,8 @@ static int serial8250_em_probe(struct platform_device *pdev)
}

priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
- if (!priv) {
- dev_err(&pdev->dev, "unable to allocate private data\n");
+ if (!priv)
return -ENOMEM;
- }

priv->sclk = devm_clk_get(&pdev->dev, "sclk");
if (IS_ERR(priv->sclk)) {
--
2.1.3

2014-11-05 17:27:44

by Peter Hurley

[permalink] [raw]
Subject: [PATCH -next 7/9] tty: Document defunct ASYNC_SPLIT_TERMIOS flag in uapi header

The last vestige of ASYNC_SPLIT_TERMIOS was removed by commit
'cris: Remove obsolete ASYNC_SPLIT_TERMIOS behavior'. Mark the flag
as defunct in the uapi header.

Signed-off-by: Peter Hurley <[email protected]>
---
include/uapi/linux/tty_flags.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/uapi/linux/tty_flags.h b/include/uapi/linux/tty_flags.h
index 4e021e3..d2bc4ff 100644
--- a/include/uapi/linux/tty_flags.h
+++ b/include/uapi/linux/tty_flags.h
@@ -14,7 +14,7 @@
* on the callout port */
#define ASYNCB_FOURPORT 1 /* Set OU1, OUT2 per AST Fourport settings */
#define ASYNCB_SAK 2 /* Secure Attention Key (Orange book) */
-#define ASYNCB_SPLIT_TERMIOS 3 /* Separate termios for dialin/callout */
+#define ASYNCB_SPLIT_TERMIOS 3 /* [x] Separate termios for dialin/callout */
#define ASYNCB_SPD_HI 4 /* Use 56000 instead of 38400 bps */
#define ASYNCB_SPD_VHI 5 /* Use 115200 instead of 38400 bps */
#define ASYNCB_SKIP_TEST 6 /* Skip UART test during autoconfiguration */
--
2.1.3

2014-11-05 17:28:00

by Peter Hurley

[permalink] [raw]
Subject: [PATCH -next 6/9] cris: Remove obsolete ASYNC_SPLIT_TERMIOS behavior

ASYNC_SPLIT_TERMIOS behavior is a remnant of the long-dead /dev/cuaXX
callout device. Split termios handling was removed tree-wide in v2.5.71 by:

commit 99a21edebbfd8c29e39ee7fcc8a1ffa423657290
Author: Alexander Viro <viro@http://www.linux.org.uk>
Date: Wed Jun 11 07:41:28 2003 -0700

[PATCH] tty_driver refcounting

killed the last remnants of callout stuff - we don't need to mess with
storing termios privately anymore.

which pre-dated the re-introduction into the cris serial driver
in v2.6.7 by:

commit 311a5ffeda8ccb3f1f3840069f37234e043092d4
Author: Andrew Morton <[email protected]>
Date: Mon May 31 18:52:29 2004 -0700

[PATCH] CRIS architecture update

From: "Mikael Starvik" <[email protected]>

- Lots of fixes from 2.4.

- Updated for 2.6.6.

- Added IDE driver

Cc: Mikael Starvik <[email protected]>
Cc: Jesper Nilsson <[email protected]>
Signed-off-by: Peter Hurley <[email protected]>
---
drivers/tty/serial/crisv10.c | 12 ------------
drivers/tty/serial/crisv10.h | 1 -
2 files changed, 13 deletions(-)

diff --git a/drivers/tty/serial/crisv10.c b/drivers/tty/serial/crisv10.c
index 58e6f61..0c1825b 100644
--- a/drivers/tty/serial/crisv10.c
+++ b/drivers/tty/serial/crisv10.c
@@ -3676,12 +3676,6 @@ rs_close(struct tty_struct *tty, struct file * filp)
}
info->port.flags |= ASYNC_CLOSING;
/*
- * Save the termios structure, since this port may have
- * separate termios for callout and dialin.
- */
- if (info->port.flags & ASYNC_NORMAL_ACTIVE)
- info->normal_termios = tty->termios;
- /*
* Now we wait for the transmit buffer to clear; and we notify
* the line discipline to only process XON/XOFF characters.
*/
@@ -4076,11 +4070,6 @@ rs_open(struct tty_struct *tty, struct file * filp)
return retval;
}

- if ((info->port.count == 1) && (info->port.flags & ASYNC_SPLIT_TERMIOS)) {
- tty->termios = info->normal_termios;
- change_speed(info);
- }
-
#ifdef SERIAL_DEBUG_OPEN
printk("rs_open ttyS%d successful...\n", info->line);
#endif
@@ -4327,7 +4316,6 @@ static int __init rs_init(void)
info->custom_divisor = 0;
info->x_char = 0;
info->event = 0;
- info->normal_termios = driver->init_termios;
info->xmit.buf = NULL;
info->xmit.tail = info->xmit.head = 0;
info->first_recv_buffer = info->last_recv_buffer = NULL;
diff --git a/drivers/tty/serial/crisv10.h b/drivers/tty/serial/crisv10.h
index 7599014..15a52ee 100644
--- a/drivers/tty/serial/crisv10.h
+++ b/drivers/tty/serial/crisv10.h
@@ -98,7 +98,6 @@ struct e100_serial {

struct work_struct work;
struct async_icount icount; /* error-statistics etc.*/
- struct ktermios normal_termios;

unsigned long char_time_usec; /* The time for 1 char, in usecs */
unsigned long flush_time_usec; /* How often we should flush */
--
2.1.3

2014-11-05 17:26:56

by Peter Hurley

[permalink] [raw]
Subject: [PATCH -next 4/9] tty: Remove defunct serial_console_init() declaration

serial_console_init() is not defined by the tty core; remove
declaration.

Note that the powerpc arch boot code contains a serial_console_init()
declaration in arch/powerpc/boot/ops.h which is restricted to
the powerpc arch boot.

Signed-off-by: Peter Hurley <[email protected]>
---
include/linux/tty.h | 4 ----
1 file changed, 4 deletions(-)

diff --git a/include/linux/tty.h b/include/linux/tty.h
index 97cfb31..c52a689 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -617,10 +617,6 @@ extern int n_tty_ioctl_helper(struct tty_struct *tty, struct file *file,
extern long n_tty_compat_ioctl_helper(struct tty_struct *tty, struct file *file,
unsigned int cmd, unsigned long arg);

-/* serial.c */
-
-extern void serial_console_init(void);
-
/* vt.c */

extern int vt_ioctl(struct tty_struct *tty,
--
2.1.3

2014-11-05 17:28:31

by Peter Hurley

[permalink] [raw]
Subject: [PATCH -next 5/9] serial: hp300: Remove obsolete comments

setup_serial_console() is obsolete and has been superseded by
early_serial_setup() which is called at the end of the function.

The IA64 arch does not call this function; only the m68k arch setup
calls this function.

Signed-off-by: Peter Hurley <[email protected]>
---
drivers/tty/serial/8250/8250_hp300.c | 4 ----
1 file changed, 4 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_hp300.c b/drivers/tty/serial/8250/8250_hp300.c
index afffe4d..b488208 100644
--- a/drivers/tty/serial/8250/8250_hp300.c
+++ b/drivers/tty/serial/8250/8250_hp300.c
@@ -88,10 +88,6 @@ extern int hp300_uart_scode;
/*
* Parse the bootinfo to find descriptions for headless console and
* debug serial ports and register them with the 8250 driver.
- * This function should be called before serial_console_init() is called
- * to make sure the serial console will be available for use. IA-64 kernel
- * calls this function from setup_arch() after the EFI and ACPI tables have
- * been parsed.
*/
int __init hp300_setup_serial_console(void)
{
--
2.1.3

2014-11-05 17:29:13

by Peter Hurley

[permalink] [raw]
Subject: [PATCH -next 2/9] tty: Call methods in modern style

The use of older function ptr calling style, (*fn)(), makes static
analysis more error-prone; replace with modern fn() style.

Signed-off-by: Peter Hurley <[email protected]>
---
drivers/tty/tty_io.c | 12 ++++++------
drivers/tty/tty_ioctl.c | 4 ++--
2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 1262368..01d45fd 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -981,7 +981,7 @@ void __stop_tty(struct tty_struct *tty)
return;
tty->stopped = 1;
if (tty->ops->stop)
- (tty->ops->stop)(tty);
+ tty->ops->stop(tty);
}

void stop_tty(struct tty_struct *tty)
@@ -1012,7 +1012,7 @@ void __start_tty(struct tty_struct *tty)
return;
tty->stopped = 0;
if (tty->ops->start)
- (tty->ops->start)(tty);
+ tty->ops->start(tty);
tty_wakeup(tty);
}

@@ -1066,7 +1066,7 @@ static ssize_t tty_read(struct file *file, char __user *buf, size_t count,
situation */
ld = tty_ldisc_ref_wait(tty);
if (ld->ops->read)
- i = (ld->ops->read)(tty, file, buf, count);
+ i = ld->ops->read(tty, file, buf, count);
else
i = -EIO;
tty_ldisc_deref(ld);
@@ -2182,7 +2182,7 @@ static unsigned int tty_poll(struct file *filp, poll_table *wait)

ld = tty_ldisc_ref_wait(tty);
if (ld->ops->poll)
- ret = (ld->ops->poll)(tty, filp, wait);
+ ret = ld->ops->poll(tty, filp, wait);
tty_ldisc_deref(ld);
return ret;
}
@@ -2905,7 +2905,7 @@ long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
break;
}
if (tty->ops->ioctl) {
- retval = (tty->ops->ioctl)(tty, cmd, arg);
+ retval = tty->ops->ioctl(tty, cmd, arg);
if (retval != -ENOIOCTLCMD)
return retval;
}
@@ -2932,7 +2932,7 @@ static long tty_compat_ioctl(struct file *file, unsigned int cmd,
return -EINVAL;

if (tty->ops->compat_ioctl) {
- retval = (tty->ops->compat_ioctl)(tty, cmd, arg);
+ retval = tty->ops->compat_ioctl(tty, cmd, arg);
if (retval != -ENOIOCTLCMD)
return retval;
}
diff --git a/drivers/tty/tty_ioctl.c b/drivers/tty/tty_ioctl.c
index 24a1360..1787fa4 100644
--- a/drivers/tty/tty_ioctl.c
+++ b/drivers/tty/tty_ioctl.c
@@ -550,14 +550,14 @@ int tty_set_termios(struct tty_struct *tty, struct ktermios *new_termios)
unset_locked_termios(&tty->termios, &old_termios, &tty->termios_locked);

if (tty->ops->set_termios)
- (*tty->ops->set_termios)(tty, &old_termios);
+ tty->ops->set_termios(tty, &old_termios);
else
tty_termios_copy_hw(&tty->termios, &old_termios);

ld = tty_ldisc_ref(tty);
if (ld != NULL) {
if (ld->ops->set_termios)
- (ld->ops->set_termios)(tty, &old_termios);
+ ld->ops->set_termios(tty, &old_termios);
tty_ldisc_deref(ld);
}
up_write(&tty->termios_rwsem);
--
2.1.3

2014-11-05 17:29:37

by Peter Hurley

[permalink] [raw]
Subject: [PATCH -next 1/9] tty: Replace open-coded test with tty_hung_up_p()

tty_hung_up_p() is equivalent to the open-coded test in tty_open().

Signed-off-by: Peter Hurley <[email protected]>
---
drivers/tty/tty_io.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 4bd48f7..1262368 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -2129,7 +2129,7 @@ retry_open:
/*
* Need to reset f_op in case a hangup happened.
*/
- if (filp->f_op == &hung_up_tty_fops)
+ if (tty_hung_up_p(filp))
filp->f_op = &tty_fops;
goto retry_open;
}
--
2.1.3

2014-11-05 18:36:14

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH -next 5/9] serial: hp300: Remove obsolete comments

On Wed, Nov 5, 2014 at 6:26 PM, Peter Hurley <[email protected]> wrote:
> setup_serial_console() is obsolete and has been superseded by
> early_serial_setup() which is called at the end of the function.
>
> The IA64 arch does not call this function; only the m68k arch setup
> calls this function.
>
> Signed-off-by: Peter Hurley <[email protected]>

Acked-by: Geert Uytterhoeven <[email protected]>

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

2014-11-05 18:42:04

by Joe Perches

[permalink] [raw]
Subject: [PATCH] checkpatch: Add --strict test for function pointer calling style

Peter Hurley wrote:

The use of older function ptr calling style, (*fn)(), makes static
analysis more error-prone; replace with modern fn() style.

So make checkpatch emit a --strict test for that condition.

Update the unnecessary parentheses test for dereferencing
objects at the same time and create a $fix mechanism too.

Signed-off-by: Joe Perches <[email protected]>
---
scripts/checkpatch.pl | 24 +++++++++++++++++++++---
1 file changed, 21 insertions(+), 3 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 24d6702..552e5dd 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3838,9 +3838,27 @@ sub process {
# ie: &(foo->bar) should be &foo->bar and *(foo->bar) should be *foo->bar

while ($line =~ /(?:[^&]&\s*|\*)\(\s*($Ident\s*(?:$Member\s*)+)\s*\)/g) {
- CHK("UNNECESSARY_PARENTHESES",
- "Unnecessary parentheses around $1\n" . $herecurr);
- }
+ my $var = $1;
+ if (CHK("UNNECESSARY_PARENTHESES",
+ "Unnecessary parentheses around $var\n" . $herecurr) &&
+ $fix) {
+ $fixed[$fixlinenr] =~ s/\(\s*\Q$var\E\s*\)/$var/;
+ }
+ }
+
+# check for unnecessary parentheses around function pointer uses
+# ie: (foo->bar)(); should be foo->bar();
+# but not "if (foo->bar) (" to avoid some false positives
+ if ($line =~ /(\bif\s*|)(\(\s*$Ident\s*(?:$Member\s*)+\))[ \t]*\(/ && $1 !~ /^if/) {
+ my $var = $2;
+ if (CHK("UNNECESSARY_PARENTHESES",
+ "Unnecessary parentheses around function pointer $var\n" . $herecurr) &&
+ $fix) {
+ my $var2 = deparenthesize($var);
+ $var2 =~ s/\s//g;
+ $fixed[$fixlinenr] =~ s/\Q$var\E/$var2/;
+ }
+ }

#goto labels aren't indented, allow a single space however
if ($line=~/^.\s+[A-Za-z\d_]+:(?![0-9]+)/ and

2014-11-05 19:13:02

by Peter Hurley

[permalink] [raw]
Subject: Re: [PATCH] checkpatch: Add --strict test for function pointer calling style

On 11/05/2014 01:41 PM, Joe Perches wrote:
> Peter Hurley wrote:
>
> The use of older function ptr calling style, (*fn)(), makes static
> analysis more error-prone; replace with modern fn() style.
>
> So make checkpatch emit a --strict test for that condition.
>
> Update the unnecessary parentheses test for dereferencing
> objects at the same time and create a $fix mechanism too.

Cool.

perl's not my thing; how does it know not to trip up on

initcall_t *call;

(*call)();

[which I verified it properly does not flag in drivers/tty/tty_io.c]

Regards,
Peter Hurley


> Signed-off-by: Joe Perches <[email protected]>
> ---
> scripts/checkpatch.pl | 24 +++++++++++++++++++++---
> 1 file changed, 21 insertions(+), 3 deletions(-)
>
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 24d6702..552e5dd 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -3838,9 +3838,27 @@ sub process {
> # ie: &(foo->bar) should be &foo->bar and *(foo->bar) should be *foo->bar
>
> while ($line =~ /(?:[^&]&\s*|\*)\(\s*($Ident\s*(?:$Member\s*)+)\s*\)/g) {
> - CHK("UNNECESSARY_PARENTHESES",
> - "Unnecessary parentheses around $1\n" . $herecurr);
> - }
> + my $var = $1;
> + if (CHK("UNNECESSARY_PARENTHESES",
> + "Unnecessary parentheses around $var\n" . $herecurr) &&
> + $fix) {
> + $fixed[$fixlinenr] =~ s/\(\s*\Q$var\E\s*\)/$var/;
> + }
> + }
> +
> +# check for unnecessary parentheses around function pointer uses
> +# ie: (foo->bar)(); should be foo->bar();
> +# but not "if (foo->bar) (" to avoid some false positives
> + if ($line =~ /(\bif\s*|)(\(\s*$Ident\s*(?:$Member\s*)+\))[ \t]*\(/ && $1 !~ /^if/) {
> + my $var = $2;
> + if (CHK("UNNECESSARY_PARENTHESES",
> + "Unnecessary parentheses around function pointer $var\n" . $herecurr) &&
> + $fix) {
> + my $var2 = deparenthesize($var);
> + $var2 =~ s/\s//g;
> + $fixed[$fixlinenr] =~ s/\Q$var\E/$var2/;
> + }
> + }
>
> #goto labels aren't indented, allow a single space however
> if ($line=~/^.\s+[A-Za-z\d_]+:(?![0-9]+)/ and
>
>

2014-11-05 19:31:07

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH] checkpatch: Add --strict test for function pointer calling style

On Wed, 2014-11-05 at 14:12 -0500, Peter Hurley wrote:
> On 11/05/2014 01:41 PM, Joe Perches wrote:
> > Peter Hurley wrote:
> >
> > The use of older function ptr calling style, (*fn)(), makes static
> > analysis more error-prone; replace with modern fn() style.
> >
> > So make checkpatch emit a --strict test for that condition.
> >
> > Update the unnecessary parentheses test for dereferencing
> > objects at the same time and create a $fix mechanism too.
>
> Cool.
>
> perl's not my thing; how does it know not to trip up on
>
> initcall_t *call;
>
> (*call)();
>
> [which I verified it properly does not flag in drivers/tty/tty_io.c]

because the regex only matches "(foo->bar)("

It doesn't match (*foo->bar)("

and foo->bar could be any number of -> or . uses like

"(foo->bar.baz)("

or

"( foo -> bar . baz ) ("

2014-11-06 08:23:46

by Jesper Nilsson

[permalink] [raw]
Subject: Re: [PATCH -next 6/9] cris: Remove obsolete ASYNC_SPLIT_TERMIOS behavior

On Wed, Nov 05, 2014 at 06:26:29PM +0100, Peter Hurley wrote:
> ASYNC_SPLIT_TERMIOS behavior is a remnant of the long-dead /dev/cuaXX
> callout device. Split termios handling was removed tree-wide in v2.5.71 by:
>
> commit 99a21edebbfd8c29e39ee7fcc8a1ffa423657290
> Author: Alexander Viro <viro@http://www.linux.org.uk>
> Date: Wed Jun 11 07:41:28 2003 -0700
>
> [PATCH] tty_driver refcounting
>
> killed the last remnants of callout stuff - we don't need to mess with
> storing termios privately anymore.
>
> which pre-dated the re-introduction into the cris serial driver
> in v2.6.7 by:
>
> commit 311a5ffeda8ccb3f1f3840069f37234e043092d4
> Author: Andrew Morton <[email protected]>
> Date: Mon May 31 18:52:29 2004 -0700
>
> [PATCH] CRIS architecture update
>
> From: "Mikael Starvik" <[email protected]>
>
> - Lots of fixes from 2.4.
>
> - Updated for 2.6.6.
>
> - Added IDE driver
>
> Cc: Mikael Starvik <[email protected]>

Agreed.

Acked-by: Jesper Nilsson <[email protected]>

> Signed-off-by: Peter Hurley <[email protected]>
> ---
> drivers/tty/serial/crisv10.c | 12 ------------
> drivers/tty/serial/crisv10.h | 1 -
> 2 files changed, 13 deletions(-)
>
> diff --git a/drivers/tty/serial/crisv10.c b/drivers/tty/serial/crisv10.c
> index 58e6f61..0c1825b 100644
> --- a/drivers/tty/serial/crisv10.c
> +++ b/drivers/tty/serial/crisv10.c
> @@ -3676,12 +3676,6 @@ rs_close(struct tty_struct *tty, struct file * filp)
> }
> info->port.flags |= ASYNC_CLOSING;
> /*
> - * Save the termios structure, since this port may have
> - * separate termios for callout and dialin.
> - */
> - if (info->port.flags & ASYNC_NORMAL_ACTIVE)
> - info->normal_termios = tty->termios;
> - /*
> * Now we wait for the transmit buffer to clear; and we notify
> * the line discipline to only process XON/XOFF characters.
> */
> @@ -4076,11 +4070,6 @@ rs_open(struct tty_struct *tty, struct file * filp)
> return retval;
> }
>
> - if ((info->port.count == 1) && (info->port.flags & ASYNC_SPLIT_TERMIOS)) {
> - tty->termios = info->normal_termios;
> - change_speed(info);
> - }
> -
> #ifdef SERIAL_DEBUG_OPEN
> printk("rs_open ttyS%d successful...\n", info->line);
> #endif
> @@ -4327,7 +4316,6 @@ static int __init rs_init(void)
> info->custom_divisor = 0;
> info->x_char = 0;
> info->event = 0;
> - info->normal_termios = driver->init_termios;
> info->xmit.buf = NULL;
> info->xmit.tail = info->xmit.head = 0;
> info->first_recv_buffer = info->last_recv_buffer = NULL;
> diff --git a/drivers/tty/serial/crisv10.h b/drivers/tty/serial/crisv10.h
> index 7599014..15a52ee 100644
> --- a/drivers/tty/serial/crisv10.h
> +++ b/drivers/tty/serial/crisv10.h
> @@ -98,7 +98,6 @@ struct e100_serial {
>
> struct work_struct work;
> struct async_icount icount; /* error-statistics etc.*/
> - struct ktermios normal_termios;
>
> unsigned long char_time_usec; /* The time for 1 char, in usecs */
> unsigned long flush_time_usec; /* How often we should flush */
> --
> 2.1.3

/^JN - Jesper Nilsson
--
Jesper Nilsson -- [email protected]