From 550a4ae300170741fc1185103d61f4845877aa64 Mon Sep 17 00:00:00 2001 From: Michael Shalayeff Date: Thu, 30 Nov 2006 11:25:12 +0000 Subject: replace a bunch of ifs w/ an array scan and add a few more --- sys/arch/hppa/dev/sti_sgc.c | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) (limited to 'sys') diff --git a/sys/arch/hppa/dev/sti_sgc.c b/sys/arch/hppa/dev/sti_sgc.c index 67ea930de98..ed70920aa16 100644 --- a/sys/arch/hppa/dev/sti_sgc.c +++ b/sys/arch/hppa/dev/sti_sgc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sti_sgc.c,v 1.32 2006/04/16 21:03:45 miod Exp $ */ +/* $OpenBSD: sti_sgc.c,v 1.33 2006/11/30 11:25:11 mickey Exp $ */ /* * Copyright (c) 2000-2003 Michael Shalayeff @@ -54,12 +54,8 @@ #define STI_ROMSIZE (sizeof(struct sti_dd) * 4) #define STI_ID_FDDI 0x280b31af /* Medusa FDDI ROM id */ -/* gecko optional graphics */ -#define STI_GOPT1_REV 0x17 -#define STI_GOPT2_REV 0x70 -#define STI_GOPT3_REV 0xd0 -#define STI_GOPT4_REV 0x20 -#define STI_GOPT5_REV 0x40 +/* gecko optional graphics (these share the onboard's prom) */ +char sti_sgc_opt[] = { 0x17, 0x20, 0x30, 0x40, 0x70, 0xc0, 0xd0 }; /* internal EG */ #define STI_INEG_REV 0x60 @@ -82,16 +78,15 @@ paddr_t sti_sgc_getrom(int unit, struct confargs *ca) { paddr_t rom = PAGE0->pd_resv2[1]; + int i; if (unit) { - if (ca->ca_type.iodc_sv_model == HPPA_FIO_GSGC && - (ca->ca_type.iodc_revision == STI_GOPT1_REV || - ca->ca_type.iodc_revision == STI_GOPT2_REV || - ca->ca_type.iodc_revision == STI_GOPT3_REV || - ca->ca_type.iodc_revision == STI_GOPT4_REV || - ca->ca_type.iodc_revision == STI_GOPT5_REV)) - /* these share the onboard's prom */ ; - else + i = -1; + if (ca->ca_type.iodc_sv_model == HPPA_FIO_GSGC) + for (i = sizeof(sti_sgc_opt); i-- && + sti_sgc_opt[i] != ca->ca_type.iodc_revision; ) + ; + if (i < 0) rom = 0; } -- cgit v1.2.3