treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / arch / sparc / include / asm / vga.h
blob2952d667d936340edf851c85d93ccae051bf05a0
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3 * Access to VGA videoram
5 * (c) 1998 Martin Mares <mj@ucw.cz>
6 */
8 #ifndef _LINUX_ASM_VGA_H_
9 #define _LINUX_ASM_VGA_H_
11 #include <linux/bug.h>
12 #include <linux/string.h>
13 #include <asm/types.h>
15 #define VT_BUF_HAVE_RW
16 #define VT_BUF_HAVE_MEMSETW
17 #define VT_BUF_HAVE_MEMCPYW
18 #define VT_BUF_HAVE_MEMMOVEW
20 #undef scr_writew
21 #undef scr_readw
23 static inline void scr_writew(u16 val, u16 *addr)
25 BUG_ON((long) addr >= 0);
27 *addr = val;
30 static inline u16 scr_readw(const u16 *addr)
32 BUG_ON((long) addr >= 0);
34 return *addr;
37 static inline void scr_memsetw(u16 *p, u16 v, unsigned int n)
39 BUG_ON((long) p >= 0);
41 memset16(p, cpu_to_le16(v), n / 2);
44 static inline void scr_memcpyw(u16 *d, u16 *s, unsigned int n)
46 BUG_ON((long) d >= 0);
48 memcpy(d, s, n);
51 static inline void scr_memmovew(u16 *d, u16 *s, unsigned int n)
53 BUG_ON((long) d >= 0);
55 memmove(d, s, n);
58 #define VGA_MAP_MEM(x,s) (x)
60 #endif