summaryrefslogtreecommitdiffstats
path: root/drivers/video/console
diff options
context:
space:
mode:
authorPeilin Ye <yepeilin.cs@gmail.com>2020-09-24 15:40:53 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2020-09-25 10:28:18 +0200
commitbb0890b4cd7f8203e3aa99c6d0f062d6acdaad27 (patch)
tree9f769a1e4121c4592a37e896c7a4e7fdbf1d5395 /drivers/video/console
parentdmabuf: fix NULL pointer dereference in dma_buf_release() (diff)
downloadlinux-bb0890b4cd7f8203e3aa99c6d0f062d6acdaad27.tar.xz
linux-bb0890b4cd7f8203e3aa99c6d0f062d6acdaad27.zip
fbdev, newport_con: Move FONT_EXTRA_WORDS macros into linux/font.h
drivers/video/console/newport_con.c is borrowing FONT_EXTRA_WORDS macros from drivers/video/fbdev/core/fbcon.h. To keep things simple, move all definitions into <linux/font.h>. Since newport_con now uses four extra words, initialize the fourth word in newport_set_font() properly. Cc: stable@vger.kernel.org Signed-off-by: Peilin Ye <yepeilin.cs@gmail.com> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/7fb8bc9b0abc676ada6b7ac0e0bd443499357267.1600953813.git.yepeilin.cs@gmail.com
Diffstat (limited to 'drivers/video/console')
-rw-r--r--drivers/video/console/newport_con.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/video/console/newport_con.c b/drivers/video/console/newport_con.c
index 72f146d047d9..cd51b7a17a21 100644
--- a/drivers/video/console/newport_con.c
+++ b/drivers/video/console/newport_con.c
@@ -35,12 +35,6 @@
#define FONT_DATA ((unsigned char *)font_vga_8x16.data)
-/* borrowed from fbcon.c */
-#define REFCOUNT(fd) (((int *)(fd))[-1])
-#define FNTSIZE(fd) (((int *)(fd))[-2])
-#define FNTCHARCNT(fd) (((int *)(fd))[-3])
-#define FONT_EXTRA_WORDS 3
-
static unsigned char *font_data[MAX_NR_CONSOLES];
static struct newport_regs *npregs;
@@ -522,6 +516,7 @@ static int newport_set_font(int unit, struct console_font *op)
FNTSIZE(new_data) = size;
FNTCHARCNT(new_data) = op->charcount;
REFCOUNT(new_data) = 0; /* usage counter */
+ FNTSUM(new_data) = 0;
p = new_data;
for (i = 0; i < op->charcount; i++) {