On Tue, Jun 13, 2017 at 11:29:59AM +0000, Miod Vallat wrote:
> 
> > Hi tech@,
> >
> > We do not support iso7 nor pcvt encoding, so remove macro definitions
> > and commented entries.
> 
> If you do that, then you can probably optimize away
> vga_valid_primary_font() in sys/dev/ic/vga.c as well.

Makes sense to me as well, thanks for pointing that out. Diff below.

Comments? OK?

Index: sys/dev/ic/vga.c
===================================================================
RCS file: /cvs/src/sys/dev/ic/vga.c,v
retrieving revision 1.68
diff -u -p -r1.68 vga.c
--- sys/dev/ic/vga.c    9 Sep 2015 18:23:39 -0000       1.68
+++ sys/dev/ic/vga.c    15 Jun 2017 10:47:09 -0000
@@ -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 */
@@ -363,7 +359,8 @@ vga_selectfont(struct vga_config *vc, st
                if (!f || f->height != type->fontheight)
                        continue;
                if (!f1 &&
-                   vga_valid_primary_font(f) &&
+                   (f->encoding == WSDISPLAY_FONTENC_IBM ||
+                    f->encoding == WSDISPLAY_FONTENC_ISO) &&
                    (!name1 || !*name1 ||
                     !strncmp(name1, f->name, WSFONT_NAME_SIZE))) {
                        f1 = f;

Reply via email to