diff --git a/sys/arch/arm/marvell/orion.c b/sys/arch/arm/marvell/orion.c index 78881bc647db..6fd384f654d1 100644 --- a/sys/arch/arm/marvell/orion.c +++ b/sys/arch/arm/marvell/orion.c @@ -1,4 +1,4 @@ -/* $NetBSD: orion.c,v 1.1 2010/10/03 05:49:24 kiyohara Exp $ */ +/* $NetBSD: orion.c,v 1.2 2012/01/28 03:09:28 jakllsch Exp $ */ /* * Copyright (c) 2010 KIYOHARA Takashi * All rights reserved. @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: orion.c,v 1.1 2010/10/03 05:49:24 kiyohara Exp $"); +__KERNEL_RCSID(0, "$NetBSD: orion.c,v 1.2 2012/01/28 03:09:28 jakllsch Exp $"); #define _INTR_PRIVATE @@ -176,7 +176,7 @@ orion_find_pending_irqs(void) void orion_getclks(bus_addr_t iobase) { - static struct { + static const struct { int armddrclkval; uint32_t pclk; uint32_t sysclk; @@ -206,8 +206,6 @@ orion_getclks(bus_addr_t iobase) { ORION_PMISMPL_ARMDDRCLK_500_125, 500000000, 125000000 }, { ORION_PMISMPL_ARMDDRCLK_500_100, 500000000, 100000000 }, { ORION_PMISMPL_ARMDDRCLK_600_150, 600000000, 150000000 }, - - { 0, 0, 0 }, }; uint32_t reg, armddrclk, tclk; uint16_t model; @@ -229,7 +227,7 @@ orion_getclks(bus_addr_t iobase) if (model == PCI_PRODUCT_MARVELL_88F5281) if (reg & ORION_PMISMPL_ARMDDRCLK_H_MASK) armddrclk |= 0x00000010; /* set to bit4 */ - for (i = 0; sysclktbl[i].pclk != 0; i++) + for (i = 0; i < __arraycount(sysclktbl); i++) if (armddrclk == sysclktbl[i].armddrclkval) { mvPclk = sysclktbl[i].pclk; mvSysclk = sysclktbl[i].sysclk;