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

Configure Feed

Select the types of activity you want to include in your feed.

tty: vt: make types of screenpos() more consistent

* parameter offset: it is expected to be non-negative, so switch to
unsigned
* return type: switch from ushort to explicit u16. This is expected on
most places. And fix the remaining two places too.

Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Tested-by: Helge Deller <deller@gmx.de> # parisc STI console
Link: https://lore.kernel.org/r/20240122110401.7289-42-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jiri Slaby (SUSE) and committed by
Greg Kroah-Hartman
fd1ca819 7cf01c92

+5 -6
+5 -6
drivers/tty/vt/vt.c
··· 286 286 return con_is_visible(vc) && !console_blanked; 287 287 } 288 288 289 - static inline unsigned short *screenpos(const struct vc_data *vc, int offset, 290 - bool viewed) 289 + static inline u16 *screenpos(const struct vc_data *vc, unsigned int offset, 290 + bool viewed) 291 291 { 292 292 unsigned long origin = viewed ? vc->vc_visible_origin : vc->vc_origin; 293 293 294 - return (unsigned short *)(origin + offset); 294 + return (u16 *)(origin + offset); 295 295 } 296 296 297 297 static void con_putc(struct vc_data *vc, u16 ca, unsigned int y, unsigned int x) ··· 705 705 /* Note: inverting the screen twice should revert to the original state */ 706 706 void invert_screen(struct vc_data *vc, int offset, int count, bool viewed) 707 707 { 708 - unsigned short *p; 708 + u16 *p; 709 709 710 710 WARN_CONSOLE_UNLOCKED(); 711 711 ··· 773 773 if (offset != -1 && offset >= 0 && 774 774 offset < vc->vc_screenbuf_size) { 775 775 unsigned short new; 776 - unsigned short *p; 777 - p = screenpos(vc, offset, true); 776 + u16 *p = screenpos(vc, offset, true); 778 777 old = scr_readw(p); 779 778 new = old ^ vc->vc_complement_mask; 780 779 scr_writew(new, p);