tty: make char_buf_ptr()/flag_buf_ptr()'s offset unsigned
authorJiri Slaby (SUSE) <jirislaby@kernel.org>
Thu, 10 Aug 2023 09:14:53 +0000 (11:14 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Aug 2023 19:12:45 +0000 (21:12 +0200)
The offset is meant from the beginning of data, so unsigned. Make it as
such for clarity. All struct tty_buffer's members should be unsigned
too -- see the next patch.

Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20230810091510.13006-20-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/tty_buffer.h

index b11cc8c749d23fda0c7c3e346236921ce27ebba8..391a875be20c4cbd6305f26fd8f933842a8eba56 100644 (file)
@@ -22,12 +22,12 @@ struct tty_buffer {
        unsigned long data[];
 };
 
-static inline u8 *char_buf_ptr(struct tty_buffer *b, int ofs)
+static inline u8 *char_buf_ptr(struct tty_buffer *b, unsigned int ofs)
 {
        return ((u8 *)b->data) + ofs;
 }
 
-static inline u8 *flag_buf_ptr(struct tty_buffer *b, int ofs)
+static inline u8 *flag_buf_ptr(struct tty_buffer *b, unsigned int ofs)
 {
        return char_buf_ptr(b, ofs) + b->size;
 }