summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederic Cambus <fcambus@cvs.openbsd.org>2017-06-17 19:20:31 +0000
committerFrederic Cambus <fcambus@cvs.openbsd.org>2017-06-17 19:20:31 +0000
commita4cb654d4d5b68984cf28a40f93702dfa05a37c6 (patch)
tree3d7d26158825f06faf083f941ac2d9631c62a5a6
parent45915a561fc1d703c6f30486d38093e0c0743c0b (diff)
The fonts we are looping through in vga_selectfont() are the builtin
font which is using the IBM encoding, and some potentially loaded fonts which are either IBM or ISO encoded. Therefore the condition checked by vga_valid_font() is always true, and we can remove it. Thanks to miod@ for pointing this out. OK tb@
-rw-r--r--sys/dev/ic/vga.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/sys/dev/ic/vga.c b/sys/dev/ic/vga.c
index 076b78afe28..74cc3e07bf8 100644
--- a/sys/dev/ic/vga.c
+++ b/sys/dev/ic/vga.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vga.c,v 1.68 2015/09/09 18:23:39 deraadt Exp $ */
+/* $OpenBSD: vga.c,v 1.69 2017/06/17 19:20:30 fcambus Exp $ */
/* $NetBSD: vga.c,v 1.28.2.1 2000/06/30 16:27:47 simonb Exp $ */
/*-
@@ -344,10 +344,6 @@ bad:
* We want at least ASCII 32..127 be present in the
* first font slot.
*/
-#define vga_valid_primary_font(f) \
- (f->encoding == WSDISPLAY_FONTENC_IBM || \
- f->encoding == WSDISPLAY_FONTENC_ISO)
-
int
vga_selectfont(struct vga_config *vc, struct vgascreen *scr, const char *name1,
const char *name2) /* NULL: take first found */
@@ -362,9 +358,7 @@ vga_selectfont(struct vga_config *vc, struct vgascreen *scr, const char *name1,
struct vgafont *f = vc->vc_fonts[i];
if (!f || f->height != type->fontheight)
continue;
- if (!f1 &&
- vga_valid_primary_font(f) &&
- (!name1 || !*name1 ||
+ if (!f1 && (!name1 || !*name1 ||
!strncmp(name1, f->name, WSFONT_NAME_SIZE))) {
f1 = f;
continue;