From b5ceb3cca02bd46d2a6296631fe607b3edd38e17 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Mon, 14 May 2018 15:08:31 +0200 Subject: Format Change-Id: Ied901f39cd6814e5afd9811248b0a1fb401f3e76 Signed-off-by: Romain Forlot --- ctl-lib/ctl-timer.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'ctl-lib/ctl-timer.c') diff --git a/ctl-lib/ctl-timer.c b/ctl-lib/ctl-timer.c index e1ced46..2139c75 100644 --- a/ctl-lib/ctl-timer.c +++ b/ctl-lib/ctl-timer.c @@ -31,13 +31,16 @@ typedef struct { } AutoTestCtxT; -STATIC int TimerNext (sd_event_source* source, uint64_t timer, void* handle) { +static int TimerNext (sd_event_source* source, uint64_t timer, void* handle) { TimerHandleT *timerHandle = (TimerHandleT*) handle; int done; uint64_t usec; done= timerHandle->callback(timerHandle); - if (!done) goto OnErrorExit; + if (!done) { + AFB_ApiWarning(timerHandle->api, "TimerNext Callback Fail Tag=%s", timerHandle->uid); + return -1; + } // Rearm timer if needed timerHandle->count --; @@ -55,20 +58,16 @@ STATIC int TimerNext (sd_event_source* source, uint64_t timer, void* handle) { } return 0; - -OnErrorExit: - AFB_ApiWarning(timerHandle->api, "TimerNext Callback Fail Tag=%s", timerHandle->uid); - return -1; } -PUBLIC void TimerEvtStop(TimerHandleT *timerHandle) { +void TimerEvtStop(TimerHandleT *timerHandle) { sd_event_source_unref(timerHandle->evtSource); free (timerHandle); } -PUBLIC void TimerEvtStart(AFB_ApiT apiHandle, TimerHandleT *timerHandle, timerCallbackT callback, void *context) { +void TimerEvtStart(AFB_ApiT apiHandle, TimerHandleT *timerHandle, timerCallbackT callback, void *context) { uint64_t usec; // populate CB handle @@ -83,7 +82,7 @@ PUBLIC void TimerEvtStart(AFB_ApiT apiHandle, TimerHandleT *timerHandle, timerCa // Create Binding Event at Init -PUBLIC int TimerEvtInit (AFB_ApiT apiHandle) { +int TimerEvtInit (AFB_ApiT apiHandle) { AFB_ApiDebug (apiHandle, "Timer-Init Done"); return 0; -- cgit 1.2.3-korg