kernel: Convert to generic boolean-functions
Subsystems (3)
PATCH 1/1 kernel: Convert to generic boolean-functions
Signed-off-by Richard Knutsson <[email protected]>
---
include/linux/relay.h +1 -1
@@ -175,7 +175,7 @@ extern void relay_subbufs_consumed(struct rchan *chan,unsigned int cpu, size_t consumed);extern void relay_reset (struct rchan *chan); -extern int relay_buf_full (struct rchan_buf *buf); +extern bool relay_buf_full (struct rchan_buf *buf);extern size_t relay_switch_subbuf (struct rchan_buf *buf,size_t length);
kernel/power/swap.c +3 -3
@@ -357,16 +357,16 @@ static int save_image(struct swap_map_handle *handle,/** * enough_swap - Make sure we have enough swap to save the image. * -* Returns TRUE or FALSE after checking the total amount of swap +* Returns 'true' or 'false' after checking the total amount of swap * space avaiable from the resume partition. */ -static int enough_swap (unsigned int nr_pages) +static bool enough_swap (unsigned int nr_pages) {unsigned int free_swap =count_swap_pages (root_swap,1 );pr_debug ("swsusp: free swap pages: %u\n" , free_swap); -return free_swap > nr_pages +PAGES_FOR_IO ; +return free_swap > (nr_pages +PAGES_FOR_IO ); }/**
kernel/profile.c +2 -2
@@ -125,11 +125,11 @@ void profile_task_exit(struct task_struct * task)blocking_notifier_call_chain (&task_exit_notifier,0 , task); } -int profile_handoff_task (struct task_struct * task) +bool profile_handoff_task (struct task_struct * task) {int ret; ret =atomic_notifier_call_chain (&task_free_notifier,0 , task); -return (ret ==NOTIFY_OK ) ?1 :0 ; +return ret ==NOTIFY_OK ; }void profile_munmap (unsigned long addr)
kernel/relay.c +6 -6
@@ -221,23 +221,23 @@ static void relay_remove_buf(struct kref *kref)* relay_buf_empty - boolean, is the channel buffer empty? * @buf: channel buffer * -* Returns 1 if the buffer is empty, 0 otherwise. +* Returns 'true' if the buffer is empty, 'false' otherwise. */ -static int relay_buf_empty (struct rchan_buf *buf) +static bool relay_buf_empty (struct rchan_buf *buf) { -return (buf->subbufs_produced - buf->subbufs_consumed) ?0 :1 ; +return (buf->subbufs_produced - buf->subbufs_consumed) ==0 ; }/** * relay_buf_full - boolean, is the channel buffer full? * @buf: channel buffer * -* Returns 1 if the buffer is full, 0 otherwise. +* Returns 'true' if the buffer is full, 'false' otherwise. */ -int relay_buf_full (struct rchan_buf *buf) +bool relay_buf_full (struct rchan_buf *buf) {size_t ready = buf->subbufs_produced - buf->subbufs_consumed; -return (ready >= buf->chan->n_subbufs) ?1 :0 ; +return ready >= buf->chan->n_subbufs; }EXPORT_SYMBOL_GPL (relay_buf_full);