]> rtime.felk.cvut.cz Git - frescor/fwp.git/commitdiff
Removed FWP_VF_CHANGED flag
authorMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 5 Nov 2009 14:59:48 +0000 (15:59 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 5 Nov 2009 14:59:48 +0000 (15:59 +0100)
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

index 32a9eff4f0f75ef0e4d91e5b9184d62c69cd1614..9a203e224f7d6d71bb8826260af1e09f842296ca 100644 (file)
@@ -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; 
 }
 
 /**