Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] constify tty flip buffer handling

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

Signed-off-by: Thomas Koeller <thomas@koeller.dyndns.org>
Acked-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Thomas Koeller and committed by
Linus Torvalds
1aef821a c41a24ce

+4 -4
+2 -2
drivers/char/tty_io.c
··· 354 354 355 355 EXPORT_SYMBOL_GPL(tty_buffer_request_room); 356 356 357 - int tty_insert_flip_string(struct tty_struct *tty, unsigned char *chars, size_t size) 357 + int tty_insert_flip_string(struct tty_struct *tty, const unsigned char *chars, size_t size) 358 358 { 359 359 int copied = 0; 360 360 do { ··· 378 378 379 379 EXPORT_SYMBOL_GPL(tty_insert_flip_string); 380 380 381 - int tty_insert_flip_string_flags(struct tty_struct *tty, unsigned char *chars, char *flags, size_t size) 381 + int tty_insert_flip_string_flags(struct tty_struct *tty, const unsigned char *chars, const char *flags, size_t size) 382 382 { 383 383 int copied = 0; 384 384 do {
+2 -2
include/linux/tty_flip.h
··· 2 2 #define _LINUX_TTY_FLIP_H 3 3 4 4 extern int tty_buffer_request_room(struct tty_struct *tty, size_t size); 5 - extern int tty_insert_flip_string(struct tty_struct *tty, unsigned char *chars, size_t size); 6 - extern int tty_insert_flip_string_flags(struct tty_struct *tty, unsigned char *chars, char *flags, size_t size); 5 + extern int tty_insert_flip_string(struct tty_struct *tty, const unsigned char *chars, size_t size); 6 + extern int tty_insert_flip_string_flags(struct tty_struct *tty, const unsigned char *chars, const char *flags, size_t size); 7 7 extern int tty_prepare_flip_string(struct tty_struct *tty, unsigned char **chars, size_t size); 8 8 extern int tty_prepare_flip_string_flags(struct tty_struct *tty, unsigned char **chars, char **flags, size_t size); 9 9