Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm/marvell Constify sysclktbl and use __arraycount...
details: https://anonhg.NetBSD.org/src/rev/5bbdbc50d47b
branches: trunk
changeset: 773113:5bbdbc50d47b
user: jakllsch <jakllsch%NetBSD.org@localhost>
date: Sat Jan 28 03:09:28 2012 +0000
description:
Constify sysclktbl and use __arraycount thereon.
diffstat:
sys/arch/arm/marvell/orion.c | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
diffs (45 lines):
diff -r d2c64870263f -r 5bbdbc50d47b sys/arch/arm/marvell/orion.c
--- a/sys/arch/arm/marvell/orion.c Sat Jan 28 03:05:53 2012 +0000
+++ b/sys/arch/arm/marvell/orion.c Sat Jan 28 03:09:28 2012 +0000
@@ -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 <sys/cdefs.h>
-__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 @@
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_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 @@
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;
Home |
Main Index |
Thread Index |
Old Index