Skip to contentSkip to conversation

s390/3215: simplify the return expression of tty3215_open()

PATCH Applied Qinglang Miao 2 participants 2 messages Sep 21, 2020 – Sep 26, 2020 s390

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 s390/3215: simplify the return expression of tty3215_open()

Simplify the return expression.

---
 drivers/s390/char/con3215.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/s390/char/con3215.c +1 -6
index 92757f9bd..d8acabbb1 100644
@@ -978,7 +978,6 @@ static int tty3215_install(struct tty_driver *driver, struct tty_struct *tty)
 static int tty3215_open(struct tty_struct *tty, struct file * filp)
 {
 	struct raw3215_info *raw = tty->driver_data;
-	int retval;
 
 	tty_port_tty_set(&raw->port, tty);
 
@@ -986,11 +985,7 @@ static int tty3215_open(struct tty_struct *tty, struct file * filp)
 	/*
 	 * Start up 3215 device
 	 */
-	retval = raw3215_startup(raw);
-	if (retval)
-		return retval;
-
-	return 0;
+	return raw3215_startup(raw);
 }
 
 /*
Signature · 1 line
2.23.0
maintainer Applied
#1 lore raw
Quoted 20 lines · Qinglang Miao

Simplify the return expression.

---
 drivers/s390/char/con3215.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/s390/char/con3215.c +0 -1
index 92757f9bd..d8acabbb1 100644
@@ -978,7 +978,6 @@ static int tty3215_install(struct tty_driver *driver, struct tty_struct *tty)
 static int tty3215_open(struct tty_struct *tty, struct file * filp)
 {
 	struct raw3215_info *raw = tty->driver_data;
-	int retval;
 
 	tty_port_tty_set(&raw->port, tty);
 

drivers/s390/char/con3215.c static int tty3215_open(struct tty_struct *tty, struct file * filp) · line 989

Quoted 10 lines
drivers/s390/char/con3215.c +1 -5
@@ -986,11 +985,7 @@ static int tty3215_open(struct tty_struct *tty, struct file * filp)
 	/*
 	 * Start up 3215 device
 	 */
-	retval = raw3215_startup(raw);
-	if (retval)
-		return retval;
-
-	return 0;
+	return raw3215_startup(raw);
 }

Applied, thank you.