Changeset 04552324 in mainline


Ignore:
Timestamp:
2012-12-03T14:54:05Z (11 years ago)
Author:
Adam Hraska <adam.hraska+hos@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a440a0f
Parents:
69146b93
Message:

cht, workq: Got rid of warnings in release builds.

Location:
kernel/generic/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/adt/cht.c

    r69146b93 r04552324  
    298298#include <synch/rcu.h>
    299299
     300#ifdef CONFIG_DEBUG
     301/* Do not enclose in parentheses. */
     302#define DBG(x) x
     303#else
     304#define DBG(x)
     305#endif
    300306
    301307/* Logarithm of the min bucket count. Must be at least 3. 2^6 == 64 buckets. */
     
    17551761       
    17561762        cht_link_t *next = get_next(*psrc_head);
    1757         marked_ptr_t ret;
    1758        
    1759         ret = cas_link(pdest_head, &sentinel, N_INVALID, next, N_NORMAL);
     1763
     1764        DBG(marked_ptr_t ret = )
     1765                cas_link(pdest_head, &sentinel, N_INVALID, next, N_NORMAL);
    17601766        ASSERT(ret == make_link(&sentinel, N_INVALID) || (N_NORMAL == get_mark(ret)));
    17611767        cas_order_barrier();
    17621768       
    1763         ret = cas_link(psrc_head, next, N_CONST, next, N_INVALID);     
     1769        DBG(ret = )
     1770                cas_link(psrc_head, next, N_CONST, next, N_INVALID);   
    17641771        ASSERT(ret == make_link(next, N_CONST) || (N_INVALID == get_mark(ret)));
    17651772        cas_order_barrier();
     
    18531860       
    18541861        /* Link the dest head to the second part of the split. */
    1855         marked_ptr_t ret =
     1862        DBG(marked_ptr_t ret = )
    18561863                cas_link(pdest_head, &sentinel, N_INVALID, wnd.cur, N_NORMAL);
    18571864        ASSERT(ret == make_link(&sentinel, N_INVALID) || (N_NORMAL == get_mark(ret)));
     
    20332040        }
    20342041       
    2035         marked_ptr_t ret =
     2042        DBG(marked_ptr_t ret = )
    20362043                cas_link(psrc_head, join_node, N_CONST, join_node, N_INVALID);
    20372044        ASSERT(ret == make_link(join_node, N_CONST) || (N_INVALID == get_mark(ret)));
  • kernel/generic/src/synch/workqueue.c

    r69146b93 r04552324  
    139139static void cv_wait(struct work_queue *workq);
    140140static void nonblock_init(void);
     141
     142#ifdef CONFIG_DEBUG
    141143static bool workq_corrupted(struct work_queue *workq);
    142144static bool work_item_corrupted(work_t *work_item);
    143 
     145#endif
    144146
    145147/** Creates worker thread for the system-wide worker queue. */
     
    204206        irq_spinlock_lock(&workq->lock, true);
    205207        bool stopped = workq->stopping;
     208#ifdef CONFIG_DEBUG
    206209        size_t running_workers = workq->cur_worker_cnt;
     210#endif
    207211        irq_spinlock_unlock(&workq->lock, true);
    208212       
     
    940944}
    941945
     946#ifdef CONFIG_DEBUG
    942947/** Returns true if the workq is definitely corrupted; false if not sure.
    943948 *
     
    946951static bool workq_corrupted(struct work_queue *workq)
    947952{
    948 #ifdef CONFIG_DEBUG
    949953        /*
    950954         * Needed to make the most current cookie value set by workq_preinit()
     
    955959        memory_barrier();
    956960        return NULL == workq || workq->cookie != WORKQ_MAGIC;
    957 #else
    958         return false;
     961}
     962
     963/** Returns true if the work_item is definitely corrupted; false if not sure.
     964 *
     965 * Must be used with the work queue protecting spinlock locked.
     966 */
     967static bool work_item_corrupted(work_t *work_item)
     968{
     969        return NULL == work_item || work_item->cookie != WORK_ITEM_MAGIC;
     970}
    959971#endif
    960 }
    961 
    962 /** Returns true if the work_item is definitely corrupted; false if not sure.
    963  *
    964  * Must be used with the work queue protecting spinlock locked.
    965  */
    966 static bool work_item_corrupted(work_t *work_item)
    967 {
    968 #ifdef CONFIG_DEBUG
    969         return NULL == work_item || work_item->cookie != WORK_ITEM_MAGIC;
    970 #else
    971         return false;
    972 #endif
    973 }
    974972
    975973/** @}
Note: See TracChangeset for help on using the changeset viewer.