From 568ef85d5ec328a2b12d44cc7831c862b436eab4 Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Thu, 5 Nov 2009 15:59:48 +0100 Subject: [PATCH] Removed FWP_VF_CHANGED flag This flag is not necessary and was really used only for printing debugging messages, which can be done in a more simple way. --- fwp/lib/fwp/fwp_vres.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/fwp/lib/fwp/fwp_vres.c b/fwp/lib/fwp/fwp_vres.c index 32a9eff..9a203e2 100644 --- a/fwp/lib/fwp/fwp_vres.c +++ b/fwp/lib/fwp/fwp_vres.c @@ -59,7 +59,6 @@ static void* fwp_vres_tx_thread(void *_vres); typedef enum { FWP_VF_USED = 0, FWP_VF_BOUND = 1, - FWP_VF_CHANGED = 2, } fwp_vres_flag_t; fwp_vres_params_t fwp_vres_params_default = { @@ -299,7 +298,6 @@ inline int _fwp_vres_set_params(fwp_vres_t *vres, fwp_vres_params_t *params) if (!rv) return rv; memcpy(&vres->params, params, sizeof(struct fwp_vres_params)); - fwp_vres_set_flag(vres, FWP_VF_CHANGED); return 0; } @@ -348,7 +346,6 @@ int fwp_vres_create(fwp_vres_params_t *params, fwp_vres_t **vresp) fwp_msgq_init(&vres->tx_queue); memcpy(&vres->params, params, sizeof(struct fwp_vres_params)); - fwp_vres_set_flag(vres, FWP_VF_CHANGED); pthread_attr_init(&vres->tx_thread_attr); if ((rv = pthread_create(&vres->tx_thread, &vres->tx_thread_attr, fwp_vres_tx_thread, (void*) vres)) != 0){ @@ -396,16 +393,8 @@ static inline void fwp_vres_sched_update(fwp_vres_t *vres, struct timespec *period, fwp_budget_t *budget) { - if (fwp_vres_get_flag(vres, FWP_VF_CHANGED)) { - /*period->tv_nsec = vres->params.period % SEC_TO_USEC; - period->tv_sec = vres->params.period / SEC_TO_USEC;*/ - *period = vres->params.period; - *budget = vres->params.budget; - FWP_DEBUG("Vres tx thread with budget=%ld period_sec=%ld " - "period_nsec=%ld.\n",vres->params.budget, - period->tv_sec, period->tv_nsec); - fwp_vres_clear_flag(vres, FWP_VF_CHANGED); - } + *period = vres->params.period; + *budget = vres->params.budget; } /** -- 2.39.2