Skip to contentSkip to conversation

UML: Fix inconsistence due to tty_operation change

PATCH In review WANG Cong 3 participants 3 messages May 2, 2008 User-mode Linux (UML)

lore
Share & tools
lore

WANG Cong

author
#0 lore raw

PATCH 1/1 UML: Fix inconsistence due to tty_operation change

'put_char' of 'struct tty_operations' has changed from 'void' into 'int'. This can also shut up comipler warnings.

---

arch/um/drivers/line.c +2 -2
index 10b86e1..5047490 100644
@@ -191,9 +191,9 @@ void line_flush_chars(struct tty_struct *tty)
 	line_flush_buffer(tty);
 }
 
-void line_put_char(struct tty_struct *tty, unsigned char ch)
+int line_put_char(struct tty_struct *tty, unsigned char ch)
 {
-	line_write(tty, &ch, sizeof(ch));
+	return line_write(tty, &ch, sizeof(ch));
 }
 
 int line_write(struct tty_struct *tty, const unsigned char *buf, int len)
arch/um/include/line.h +1 -1
index 1223f2c..979b73e 100644
@@ -71,7 +71,7 @@ extern int line_setup(struct line *lines, unsigned int sizeof_lines,
 		      char *init, char **error_out);
 extern int line_write(struct tty_struct *tty, const unsigned char *buf,
 		      int len);
-extern void line_put_char(struct tty_struct *tty, unsigned char ch);
+extern int line_put_char(struct tty_struct *tty, unsigned char ch);
 extern void line_set_termios(struct tty_struct *tty, struct ktermios * old);
 extern int line_chars_in_buffer(struct tty_struct *tty);
 extern void line_flush_buffer(struct tty_struct *tty);
#1 lore raw

[ Alan as tty maintainer added to Cc ]

Quoted 3 lines · WANG Cong

'put_char' of 'struct tty_operations' has changed from 'void' into 'int'. This can also shut up comipler warnings.

Not only, this could also be a runtime error.

Quoted 26 lines

---

arch/um/drivers/line.c +2 -2
index 10b86e1..5047490 100644
@@ -191,9 +191,9 @@ void line_flush_chars(struct tty_struct *tty)
 	line_flush_buffer(tty);
 }
 
-void line_put_char(struct tty_struct *tty, unsigned char ch)
+int line_put_char(struct tty_struct *tty, unsigned char ch)
 {
-	line_write(tty, &ch, sizeof(ch));
+	return line_write(tty, &ch, sizeof(ch));
 }
 
 int line_write(struct tty_struct *tty, const unsigned char *buf, int len)
arch/um/include/line.h +0 -0
index 1223f2c..979b73e 100644

arch/um/include/line.h extern int line_setup(struct line *lines, unsigned int sizeof_lines, · line 77

Quoted 8 lines
arch/um/include/line.h +1 -1
@@ -71,7 +71,7 @@ extern int line_setup(struct line *lines, unsigned int sizeof_lines,
 		      char *init, char **error_out);
 extern int line_write(struct tty_struct *tty, const unsigned char *buf,
 		      int len);
-extern void line_put_char(struct tty_struct *tty, unsigned char ch);
+extern int line_put_char(struct tty_struct *tty, unsigned char ch);
 extern void line_set_termios(struct tty_struct *tty, struct ktermios * old);
 extern int line_chars_in_buffer(struct tty_struct *tty);
 extern void line_flush_buffer(struct tty_struct *tty);

cu
Adrian

Signature · 15 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Acked-by on v1 1/1
#2 lore raw
In reply to WANG Cong
Quoted 6 lines · On Fri, 2 May 2008 14:59:46 +0800 (CST) WANG Cong <[email protected]>…

'put_char' of 'struct tty_operations' has changed from 'void' into 'int'. This can also shut up comipler warnings.

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel