2006-02-23 01:14:27

by Thomas Koeller

[permalink] [raw]
Subject: [PATCH] tty flip buffer handling

Add a couple of 'const' qualifiers to the TTY flip buffer APIs,
where appropriate.

Signed-off-by: Thomas Koeller <[email protected]>

diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index e9bba94..2d041bc 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -354,7 +354,7 @@ int tty_buffer_request_room(struct tty_s

EXPORT_SYMBOL_GPL(tty_buffer_request_room);

-int tty_insert_flip_string(struct tty_struct *tty, unsigned char *chars, size_t size)
+int tty_insert_flip_string(struct tty_struct *tty, const unsigned char *chars, size_t size)
{
int copied = 0;
do {
@@ -378,7 +378,7 @@ int tty_insert_flip_string(struct tty_st

EXPORT_SYMBOL_GPL(tty_insert_flip_string);

-int tty_insert_flip_string_flags(struct tty_struct *tty, unsigned char *chars, char *flags, size_t size)
+int tty_insert_flip_string_flags(struct tty_struct *tty, const unsigned char *chars, const char *flags, size_t size)
{
int copied = 0;
do {
diff --git a/include/linux/tty_flip.h b/include/linux/tty_flip.h
index 222faf9..cbe5ce3 100644
--- a/include/linux/tty_flip.h
+++ b/include/linux/tty_flip.h
@@ -2,8 +2,8 @@
#define _LINUX_TTY_FLIP_H

extern int tty_buffer_request_room(struct tty_struct *tty, size_t size);
-extern int tty_insert_flip_string(struct tty_struct *tty, unsigned char *chars, size_t size);
-extern int tty_insert_flip_string_flags(struct tty_struct *tty, unsigned char *chars, char *flags, size_t size);
+extern int tty_insert_flip_string(struct tty_struct *tty, const unsigned char *chars, size_t size);
+extern int tty_insert_flip_string_flags(struct tty_struct *tty, const unsigned char *chars, const char *flags, size_t size);
extern int tty_prepare_flip_string(struct tty_struct *tty, unsigned char **chars, size_t size);
extern int tty_prepare_flip_string_flags(struct tty_struct *tty, unsigned char **chars, char **flags, size_t size);


--
Thomas Koeller
[email protected]


2006-02-23 13:13:04

by Alan Cox

[permalink] [raw]
Subject: Re: [PATCH] tty flip buffer handling

On Thu, Feb 23, 2006 at 02:14:08AM +0100, Thomas Koeller wrote:
> Add a couple of 'const' qualifiers to the TTY flip buffer APIs,
> where appropriate.
>
> Signed-off-by: Thomas Koeller <[email protected]>

Acked-by: Alan Cox <[email protected]>

--
The Master doesn't talk, he acts.
When his work is done,
the people say, "Amazing:
we did it, all by ourselves!" -- Lao-tzu