Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 89ea2dc in mainline


Ignore:
Timestamp:
2017-12-19T17:35:28Z (4 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master
Children:
d0c2beb
Parents:
7565a4b
Message:

Functions that return true/false should have bool as a return type.

Location:
kernel/generic
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/adt/bitmap.h

    r7565a4b r89ea2dc  
    3737
    3838#include <stddef.h>
     39#include <stdbool.h>
    3940
    4041#define BITMAP_ELEMENT   8
     
    8182extern void bitmap_clear_range(bitmap_t *, size_t, size_t);
    8283
    83 extern int bitmap_allocate_range(bitmap_t *, size_t, size_t, size_t, size_t,
     84extern bool bitmap_allocate_range(bitmap_t *, size_t, size_t, size_t, size_t,
    8485    size_t *);
    8586extern void bitmap_copy(bitmap_t *, bitmap_t *, size_t);
  • kernel/generic/include/synch/spinlock.h

    r7565a4b r89ea2dc  
    112112
    113113extern void spinlock_initialize(spinlock_t *, const char *);
    114 extern int spinlock_trylock(spinlock_t *);
     114extern bool spinlock_trylock(spinlock_t *);
    115115extern void spinlock_lock_debug(spinlock_t *);
    116116extern void spinlock_unlock_debug(spinlock_t *);
     
    287287extern void irq_spinlock_lock(irq_spinlock_t *, bool);
    288288extern void irq_spinlock_unlock(irq_spinlock_t *, bool);
    289 extern int irq_spinlock_trylock(irq_spinlock_t *);
     289extern bool irq_spinlock_trylock(irq_spinlock_t *);
    290290extern void irq_spinlock_pass(irq_spinlock_t *, irq_spinlock_t *);
    291291extern void irq_spinlock_exchange(irq_spinlock_t *, irq_spinlock_t *);
  • kernel/generic/include/synch/workqueue.h

    r7565a4b r89ea2dc  
    6161extern void workq_global_worker_init(void);
    6262extern void workq_global_stop(void);
    63 extern int workq_global_enqueue_noblock(work_t *, work_func_t);
    64 extern int workq_global_enqueue(work_t *, work_func_t);
     63extern bool workq_global_enqueue_noblock(work_t *, work_func_t);
     64extern bool workq_global_enqueue(work_t *, work_func_t);
    6565
    6666extern struct work_queue * workq_create(const char *);
    6767extern void workq_destroy(struct work_queue *);
    68 extern int workq_init(struct work_queue *, const char *);
     68extern bool workq_init(struct work_queue *, const char *);
    6969extern void workq_stop(struct work_queue *);
    70 extern int workq_enqueue_noblock(struct work_queue *, work_t *, work_func_t);
    71 extern int workq_enqueue(struct work_queue *, work_t *, work_func_t);
     70extern bool workq_enqueue_noblock(struct work_queue *, work_t *, work_func_t);
     71extern bool workq_enqueue(struct work_queue *, work_t *, work_func_t);
    7272
    7373extern void workq_print_info(struct work_queue *);
  • kernel/generic/src/adt/bitmap.c

    r7565a4b r89ea2dc  
    269269 *
    270270 */
    271 int bitmap_allocate_range(bitmap_t *bitmap, size_t count, size_t base,
     271bool bitmap_allocate_range(bitmap_t *bitmap, size_t count, size_t base,
    272272    size_t prefered, size_t constraint, size_t *index)
    273273{
  • kernel/generic/src/synch/spinlock.c

    r7565a4b r89ea2dc  
    153153 *
    154154 */
    155 int spinlock_trylock(spinlock_t *lock)
     155bool spinlock_trylock(spinlock_t *lock)
    156156{
    157157        preemption_disable();
    158         int rc = !test_and_set(&lock->val);
     158        bool ret = !test_and_set(&lock->val);
    159159       
    160160        /*
     
    163163        CS_ENTER_BARRIER();
    164164       
    165         if (!rc)
     165        if (!ret)
    166166                preemption_enable();
    167167       
    168         return rc;
     168        return ret;
    169169}
    170170
     
    257257 *
    258258 */
    259 int irq_spinlock_trylock(irq_spinlock_t *lock)
     259bool irq_spinlock_trylock(irq_spinlock_t *lock)
    260260{
    261261        ASSERT_IRQ_SPINLOCK(interrupts_disabled(), lock);
    262         int rc = spinlock_trylock(&(lock->lock));
    263        
    264         ASSERT_IRQ_SPINLOCK((!rc) || (!lock->guard), lock);
    265         return rc;
     262        bool ret = spinlock_trylock(&(lock->lock));
     263       
     264        ASSERT_IRQ_SPINLOCK((!ret) || (!lock->guard), lock);
     265        return ret;
    266266}
    267267
  • kernel/generic/src/synch/workqueue.c

    r7565a4b r89ea2dc  
    256256 * workq_stop().
    257257 */
    258 int workq_init(struct work_queue *workq, const char *name)
     258bool workq_init(struct work_queue *workq, const char *name)
    259259{
    260260        workq_preinit(workq, name);
     
    394394 * See workq_enqueue_noblock() for more details.
    395395 */
    396 int workq_global_enqueue_noblock(work_t *work_item, work_func_t func)
     396bool workq_global_enqueue_noblock(work_t *work_item, work_func_t func)
    397397{
    398398        return workq_enqueue_noblock(&g_work_queue, work_item, func);
     
    403403 * See workq_enqueue() for more details.
    404404 */
    405 int workq_global_enqueue(work_t *work_item, work_func_t func)
     405bool workq_global_enqueue(work_t *work_item, work_func_t func)
    406406{
    407407        return workq_enqueue(&g_work_queue, work_item, func);
     
    426426 * @return true  Otherwise. func() will be invoked in a separate thread.
    427427 */
    428 int workq_enqueue_noblock(struct work_queue *workq, work_t *work_item,
     428bool workq_enqueue_noblock(struct work_queue *workq, work_t *work_item,
    429429        work_func_t func)
    430430{
     
    446446 * @return true  Otherwise. func() will be invoked in a separate thread.
    447447 */
    448 int workq_enqueue(struct work_queue *workq, work_t *work_item, work_func_t func)
     448bool workq_enqueue(struct work_queue *workq, work_t *work_item, work_func_t func)
    449449{
    450450        return _workq_enqueue(workq, work_item, func, true);
Note: See TracChangeset for help on using the changeset viewer.