From 8a7e63e880ee552029f70fc2bca956890ac35d72 Mon Sep 17 00:00:00 2001 From: ian Date: Fri, 14 Aug 2015 16:48:07 +0000 Subject: [PATCH] Use simple fixed name strings for these timecounters and eventimers which are tied to fixed pieces of hardware; dynamic string formatting isn't needed. --- sys/arm/broadcom/bcm2835/bcm2835_systimer.c | 6 +++--- sys/arm/versatile/sp804.c | 6 ++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/sys/arm/broadcom/bcm2835/bcm2835_systimer.c b/sys/arm/broadcom/bcm2835/bcm2835_systimer.c index 93bf6762e62b..731c7d069bd8 100644 --- a/sys/arm/broadcom/bcm2835/bcm2835_systimer.c +++ b/sys/arm/broadcom/bcm2835/bcm2835_systimer.c @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #define BCM2835_NUM_TIMERS 4 #define DEFAULT_TIMER 3 +#define DEFAULT_TIMER_NAME "BCM2835-3" #define DEFAULT_FREQUENCY 1000000 #define MIN_PERIOD 5LLU @@ -101,7 +102,7 @@ static struct bcm_systimer_softc *bcm_systimer_sc = NULL; static unsigned bcm_systimer_tc_get_timecount(struct timecounter *); static struct timecounter bcm_systimer_tc = { - .tc_name = "BCM2835 Timecounter", + .tc_name = DEFAULT_TIMER_NAME, .tc_get_timecount = bcm_systimer_tc_get_timecount, .tc_poll_pps = NULL, .tc_counter_mask = ~0u, @@ -238,8 +239,7 @@ bcm_systimer_attach(device_t dev) sc->st[DEFAULT_TIMER].index = DEFAULT_TIMER; sc->st[DEFAULT_TIMER].enabled = 0; - sc->st[DEFAULT_TIMER].et.et_name = malloc(64, M_DEVBUF, M_NOWAIT | M_ZERO); - sprintf(sc->st[DEFAULT_TIMER].et.et_name, "BCM2835 Event Timer %d", DEFAULT_TIMER); + sc->st[DEFAULT_TIMER].et.et_name = DEFAULT_TIMER_NAME; sc->st[DEFAULT_TIMER].et.et_flags = ET_FLAGS_ONESHOT; sc->st[DEFAULT_TIMER].et.et_quality = 1000; sc->st[DEFAULT_TIMER].et.et_frequency = sc->sysclk_freq; diff --git a/sys/arm/versatile/sp804.c b/sys/arm/versatile/sp804.c index a69c0185f66f..de05700dd1c6 100644 --- a/sys/arm/versatile/sp804.c +++ b/sys/arm/versatile/sp804.c @@ -244,7 +244,7 @@ sp804_timer_attach(device_t dev) * Timer 1, timecounter */ sc->tc.tc_frequency = sc->sysclk_freq; - sc->tc.tc_name = "SP804 Time Counter"; + sc->tc.tc_name = "SP804-1"; sc->tc.tc_get_timecount = sp804_timer_tc_get_timecount; sc->tc.tc_poll_pps = NULL; sc->tc.tc_counter_mask = ~0u; @@ -263,9 +263,7 @@ sp804_timer_attach(device_t dev) * Timer 2, event timer */ sc->et_enabled = 0; - sc->et.et_name = malloc(64, M_DEVBUF, M_NOWAIT | M_ZERO); - sprintf(sc->et.et_name, "SP804 Event Timer %d", - device_get_unit(dev)); + sc->et.et_name = "SP804-2"; sc->et.et_flags = ET_FLAGS_PERIODIC | ET_FLAGS_ONESHOT; sc->et.et_quality = 1000; sc->et.et_frequency = sc->sysclk_freq / DEFAULT_DIVISOR;