mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-04-13 09:59:31 +00:00
tty: tty_buffer: switch data type to u8
There is no reason to have tty_buffer::data typed as unsigned long. Switch to u8, but preserve the ulong alignment using __aligned. This allows for the cast removal from char_buf_ptr(). And for use of struct_size() in the allocation in tty_buffer_alloc() -- in the next patch. Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org> Link: https://lore.kernel.org/r/20230816105530.3335-2-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
2f4926723a
commit
d4d13ff3ac
1 changed files with 2 additions and 2 deletions
|
@ -19,12 +19,12 @@ struct tty_buffer {
|
|||
unsigned int read;
|
||||
bool flags;
|
||||
/* Data points here */
|
||||
unsigned long data[];
|
||||
u8 data[] __aligned(sizeof(unsigned long));
|
||||
};
|
||||
|
||||
static inline u8 *char_buf_ptr(struct tty_buffer *b, unsigned int ofs)
|
||||
{
|
||||
return ((u8 *)b->data) + ofs;
|
||||
return b->data + ofs;
|
||||
}
|
||||
|
||||
static inline u8 *flag_buf_ptr(struct tty_buffer *b, unsigned int ofs)
|
||||
|
|
Loading…
Add table
Reference in a new issue