From: Jaejoong Kim <hidden> Date: 2018-09-04 02:45:05
Many drivers with tty use the tty_stand_install(). But, there is no
need to handle the error, since it always returns 0. So, change the
return type of tty_standard_install() and tty_port_install() to void
type and remove unnecessary exception handling where we use these
functions.
Change return type for tty functions. Patch No.01
tty: Change return type to void
Apply tty_port_install() changes. Patch No.02~14
isdn: i4l: isdn_tty: Change return type to void
...
Bluetooth: Change return type to void
Apply tty_standard_install() changes. Patch No.15~25
um: Change return type to void
...
usb: usb-serial: Change return type to void
Jaejoong Kim (25):
tty: Change return type to void
isdn: i4l: isdn_tty: Change return type to void
s390: char: con3215: Change return type to void
s390: char: tty3270: Change return type to void
tty: hvc: hvc_console: Change return type to void
tty: hvc: hvcs: Change return type to void
tty: mips_ejtag_fdc: Change return type to void
tty: n_gsm: Change return type to void
tty: serial: kgdb_nmi: Change return type to void
tty: synclink: Change return type to void
tty: synclinkmp: Change return type to void
tty: vt: Change return type to void
usb: xhci: dbc: Change return type to void
Bluetooth: Change return type to void
um: Change return type to void
isdn: capi: Change return type to void
misc: pti: Change return type to void
mmc: core: sdio_uart: Change return type to void
staging: fwserial: Change return type to void
staging: gdm724x: gdm_tty: Change return type to void
staging: greybus: uart: Change return type to void
tty: nozomi: Change return type to void
tty: vcc: Change return type to void
usb: cdc-acm: Change return type to void
usb: usb-serial: Change return type to void
arch/um/drivers/line.c | 7 +------
drivers/isdn/capi/capi.c | 10 ++++------
drivers/isdn/i4l/isdn_tty.c | 3 ++-
drivers/misc/pti.c | 28 +++++++++++++---------------
drivers/mmc/core/sdio_uart.c | 11 ++++-------
drivers/s390/char/con3215.c | 3 ++-
drivers/s390/char/tty3270.c | 7 +------
drivers/staging/fwserial/fwserial.c | 22 ++++++++--------------
drivers/staging/gdm724x/gdm_tty.c | 11 +++--------
drivers/staging/greybus/uart.c | 10 ++--------
drivers/tty/hvc/hvc_console.c | 7 ++-----
drivers/tty/hvc/hvcs.c | 10 ++--------
drivers/tty/mips_ejtag_fdc.c | 4 +++-
drivers/tty/n_gsm.c | 9 +--------
drivers/tty/nozomi.c | 8 +++-----
drivers/tty/serial/kgdb_nmi.c | 11 +----------
drivers/tty/synclink.c | 3 ++-
drivers/tty/synclinkmp.c | 3 ++-
drivers/tty/tty_io.c | 10 ++++++----
drivers/tty/tty_port.c | 4 ++--
drivers/tty/vcc.c | 5 +----
drivers/tty/vt/vt.c | 5 +----
drivers/usb/class/cdc-acm.c | 10 +---------
drivers/usb/host/xhci-dbgtty.c | 3 ++-
drivers/usb/serial/usb-serial.c | 6 +-----
include/linux/tty.h | 4 ++--
net/bluetooth/rfcomm/tty.c | 7 +------
27 files changed, 73 insertions(+), 148 deletions(-)
--
2.7.4
From: Jaejoong Kim <hidden> Date: 2018-09-04 02:45:17
Since tty_port_install() always returns 0, the return type has changed
to void. Now apply this and remove the obsolete error check.
Signed-off-by: Jaejoong Kim <redacted>
---
drivers/isdn/i4l/isdn_tty.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
From: Jaejoong Kim <hidden> Date: 2018-09-04 02:45:18
Since tty_port_install() always returns 0, the return type has changed
to void. Now apply this and remove the obsolete error check.
Signed-off-by: Jaejoong Kim <redacted>
---
drivers/s390/char/con3215.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
From: Jaejoong Kim <hidden> Date: 2018-09-04 02:45:24
Since tty_port_install() always returns 0, the return type has changed
to void. Now apply this and remove the obsolete error check.
Signed-off-by: Jaejoong Kim <redacted>
---
drivers/s390/char/tty3270.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
From: Jaejoong Kim <hidden> Date: 2018-09-04 02:45:27
Since tty_port_install() always returns 0, the return type has changed
to void. Now apply this and remove the obsolete error check.
Signed-off-by: Jaejoong Kim <redacted>
---
drivers/tty/hvc/hvc_console.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
From: Jaejoong Kim <hidden> Date: 2018-09-04 02:45:31
Since tty_port_install() always returns 0, the return type has changed
to void. Now apply this and remove the obsolete error check.
Signed-off-by: Jaejoong Kim <redacted>
---
drivers/tty/hvc/hvcs.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
From: Jaejoong Kim <hidden> Date: 2018-09-04 02:45:35
Since tty_port_install() always returns 0, the return type has changed
to void. Now apply this and remove the obsolete error check.
Signed-off-by: Jaejoong Kim <redacted>
---
drivers/tty/mips_ejtag_fdc.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
From: Jaejoong Kim <hidden> Date: 2018-09-04 02:45:39
Since tty_port_install() always returns 0, the return type has changed
to void. Now apply this and remove the obsolete error check.
Signed-off-by: Jaejoong Kim <redacted>
---
drivers/tty/n_gsm.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
From: Jaejoong Kim <hidden> Date: 2018-09-04 02:45:45
Since tty_port_install() always returns 0, the return type has changed
to void. Now apply this and remove the obsolete error check.
Signed-off-by: Jaejoong Kim <redacted>
---
drivers/tty/serial/kgdb_nmi.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
From: Jaejoong Kim <hidden> Date: 2018-09-04 02:45:51
Since tty_port_install() always returns 0, the return type has changed
to void. Now apply this and remove the obsolete error check.
Signed-off-by: Jaejoong Kim <redacted>
---
drivers/tty/synclink.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
From: Jaejoong Kim <hidden> Date: 2018-09-04 02:45:54
Since tty_port_install() always returns 0, the return type has changed
to void. Now apply this and remove the obsolete error check.
Signed-off-by: Jaejoong Kim <redacted>
---
drivers/tty/synclinkmp.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
@@ -734,8 +734,9 @@ static int install(struct tty_driver *driver, struct tty_struct *tty)}tty->driver_data=info;+tty_port_install(&info->port,driver,tty);-returntty_port_install(&info->port,driver,tty);+return0;}/* Called when a port is opened. Init and enable port.
From: Jaejoong Kim <hidden> Date: 2018-09-04 02:45:58
Since tty_port_install() always returns 0, the return type has changed
to void. Now apply this and remove the obsolete error check.
Signed-off-by: Jaejoong Kim <redacted>
---
drivers/tty/vt/vt.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
From: Jaejoong Kim <hidden> Date: 2018-09-04 02:46:03
Since tty_port_install() always returns 0, the return type has changed
to void. Now apply this and remove the obsolete error check.
Signed-off-by: Jaejoong Kim <redacted>
---
drivers/usb/host/xhci-dbgtty.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
From: Jaejoong Kim <hidden> Date: 2018-09-04 02:46:09
Since tty_port_install() always returns 0, the return type has changed
to void. Now apply this and remove the obsolete error check.
Signed-off-by: Jaejoong Kim <redacted>
---
net/bluetooth/rfcomm/tty.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
@@ -725,11 +724,7 @@ static int rfcomm_tty_install(struct tty_driver *driver, struct tty_struct *tty)set_bit(RFCOMM_TTY_ATTACHED,&dev->flags);/* install the tty_port */-err=tty_port_install(&dev->port,driver,tty);-if(err){-rfcomm_tty_cleanup(tty);-returnerr;-}+tty_port_install(&dev->port,driver,tty);/* take over the tty_port reference if the port was created with the*flagRFCOMM_RELEASE_ONHUP.Thiswillforcethereleaseoftheport
From: Jaejoong Kim <hidden> Date: 2018-09-04 02:46:16
Since tty_standard_install() always returns 0, the return type has changed
to void. Now apply this and remove the obsolete error check.
Signed-off-by: Jaejoong Kim <redacted>
---
drivers/isdn/capi/capi.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
From: Jaejoong Kim <hidden> Date: 2018-09-04 02:46:23
Since tty_standard_install() always returns 0, the return type has changed
to void. Now apply this and remove the obsolete error check.
Signed-off-by: Jaejoong Kim <redacted>
---
drivers/misc/pti.c | 28 +++++++++++++---------------
1 file changed, 13 insertions(+), 15 deletions(-)
From: Jaejoong Kim <hidden> Date: 2018-09-04 02:46:28
Since tty_standard_install() always returns 0, the return type has changed
to void. Now apply this and remove the obsolete error check.
Signed-off-by: Jaejoong Kim <redacted>
---
drivers/mmc/core/sdio_uart.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
@@ -731,14 +731,11 @@ static int sdio_uart_install(struct tty_driver *driver, struct tty_struct *tty){intidx=tty->index;structsdio_uart_port*port=sdio_uart_port_get(idx);-intret=tty_standard_install(driver,tty);-if(ret==0)-/* This is the ref sdio_uart_port get provided */-tty->driver_data=port;-else-sdio_uart_port_put(port);-returnret;+tty_standard_install(driver,tty);+tty->driver_data=port;++return0;}/**
From: Jaejoong Kim <hidden> Date: 2018-09-04 02:46:31
Since tty_standard_install() always returns 0, the return type has changed
to void. Now apply this and remove the obsolete error check.
Signed-off-by: Jaejoong Kim <redacted>
---
drivers/staging/fwserial/fwserial.c | 22 ++++++++--------------
1 file changed, 8 insertions(+), 14 deletions(-)
From: Jaejoong Kim <hidden> Date: 2018-09-04 02:46:36
Since tty_standard_install() always returns 0, the return type has changed
to void. Now apply this and remove the obsolete error check.
Signed-off-by: Jaejoong Kim <redacted>
---
drivers/staging/gdm724x/gdm_tty.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
From: Jaejoong Kim <hidden> Date: 2018-09-04 02:46:42
Since tty_standard_install() always returns 0, the return type has changed
to void. Now apply this and remove the obsolete error check.
Signed-off-by: Jaejoong Kim <redacted>
---
drivers/staging/greybus/uart.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
From: Jaejoong Kim <hidden> Date: 2018-09-04 02:46:45
Since tty_standard_install() always returns 0, the return type has changed
to void. Now apply this and remove the obsolete error check.
Signed-off-by: Jaejoong Kim <redacted>
---
drivers/tty/nozomi.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
From: Jaejoong Kim <hidden> Date: 2018-09-04 02:46:50
Since tty_standard_install() always returns 0, the return type has changed
to void. Now apply this and remove the obsolete error check.
Signed-off-by: Jaejoong Kim <redacted>
---
drivers/tty/vcc.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
From: Jaejoong Kim <hidden> Date: 2018-09-04 02:46:53
Since tty_standard_install() always returns 0, the return type has changed
to void. Now apply this and remove the obsolete error check.
Signed-off-by: Jaejoong Kim <redacted>
---
drivers/usb/class/cdc-acm.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
From: Jaejoong Kim <hidden> Date: 2018-09-04 02:47:02
Since tty_standard_install() always returns 0, the return type has changed
to void. Now apply this and remove the obsolete error check.
Signed-off-by: Jaejoong Kim <redacted>
---
drivers/usb/serial/usb-serial.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
From: Jaejoong Kim <hidden> Date: 2018-09-04 02:48:01
Since tty_standard_install() always returns 0, the return type has changed
to void. Now apply this and remove the obsolete error check.
Signed-off-by: Jaejoong Kim <redacted>
---
arch/um/drivers/line.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
From: Jaejoong Kim <hidden> Date: 2018-09-04 02:49:31
Many drivers with tty use the tty_stand_install(). But, there is no
need to handle the error, since it always returns 0. So, change the
return type of tty_standard_install() and tty_port_install() to void
type and remove unnecessary exception handling where we use these
functions.
Signed-off-by: Jaejoong Kim <redacted>
---
drivers/tty/tty_io.c | 10 ++++++----
drivers/tty/tty_port.c | 4 ++--
include/linux/tty.h | 4 ++--
3 files changed, 10 insertions(+), 8 deletions(-)
From: Sam Ravnborg <hidden> Date: 2018-09-04 04:42:50
Hi Jaejoong.
Change return type for tty functions. Patch No.01
tty: Change return type to void
Adding this patch first will generate a lot of warnings
until all users are updated.
It is usual practice to prepare all users
and then apply the infrastructure changes as the
last patch.
Then people will not see a lot of warnings when
they build something in the middle,
and I guess current stack set may also generate
a few mails from the 0-day build infrastructure.
isdn: i4l: isdn_tty: Change return type to void
And a nitpick on the patch description.
This patch do not change any return type, but
it ignore the return value og tty_part_install().
Same goes for all ramaining patches.
Sam
From: Sergei Shtylyov <hidden> Date: 2018-09-04 10:45:20
Hello!
On 9/4/2018 5:44 AM, Jaejoong Kim wrote:
Many drivers with tty use the tty_stand_install(). But, there is no
need to handle the error, since it always returns 0. So, change the
return type of tty_standard_install() and tty_port_install() to void
type and remove unnecessary exception handling where we use these
functions.
Signed-off-by: Jaejoong Kim <redacted>
---
drivers/tty/tty_io.c | 10 ++++++----
drivers/tty/tty_port.c | 4 ++--
include/linux/tty.h | 4 ++--
3 files changed, 10 insertions(+), 8 deletions(-)
@@ -688,7 +688,7 @@ extern int tty_port_close_start(struct tty_port *port,externvoidtty_port_close_end(structtty_port*port,structtty_struct*tty);externvoidtty_port_close(structtty_port*port,structtty_struct*tty,structfile*filp);-externinttty_port_install(structtty_port*port,structtty_driver*driver,+externvoidtty_port_install(structtty_port*port,structtty_driver*driver,structtty_struct*tty);
You need to update all the callers in the same patch -- the kernel must
remain buildable after each patch but you seem to have spread that update
among a lot of patches..
[...]
MBR, Sergei
On Tue, 4 Sep 2018 11:44:26 +0900
Jaejoong Kim [off-list ref] wrote:
Many drivers with tty use the tty_stand_install(). But, there is no
need to handle the error, since it always returns 0.
And what happens if another change means it can fail again. It's just a
property of the current implementation that it can't. It used to fail.
This seems to be a ton of unneccessary churn that will end up just having
to be reversed again some day in the future.
Alan