* [PATCH] Change return type of obvious Boolean list fns to "bool".
@ 2010-11-21 13:35 Robert P. J. Day
2010-11-22 4:59 ` Rakib Mullick
2010-11-23 19:16 ` Randy Dunlap
0 siblings, 2 replies; 3+ messages in thread
From: Robert P. J. Day @ 2010-11-21 13:35 UTC (permalink / raw)
To: Linux Kernel Mailing List
It's clear that a number of basic list routines return simply a
Boolean value, so change their return type from "int" to "bool".
Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
---
Compile-tested with defconfig on x86_64. Not sure who should
be CCed when a patch touches something this basic. Andrew?
diff --git a/include/linux/list.h b/include/linux/list.h
index 9a5f8a7..1d6ed55 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -167,7 +167,7 @@ static inline void list_move_tail(struct list_head *list,
* @list: the entry to test
* @head: the head of the list
*/
-static inline int list_is_last(const struct list_head *list,
+static inline bool list_is_last(const struct list_head *list,
const struct list_head *head)
{
return list->next == head;
@@ -177,7 +177,7 @@ static inline int list_is_last(const struct list_head *list,
* list_empty - tests whether a list is empty
* @head: the list to test.
*/
-static inline int list_empty(const struct list_head *head)
+static inline bool list_empty(const struct list_head *head)
{
return head->next == head;
}
@@ -195,7 +195,7 @@ static inline int list_empty(const struct list_head *head)
* to the list entry is list_del_init(). Eg. it cannot be used
* if another CPU could re-list_add() it.
*/
-static inline int list_empty_careful(const struct list_head *head)
+static inline bool list_empty_careful(const struct list_head *head)
{
struct list_head *next = head->next;
return (next == head) && (next == head->prev);
@@ -219,7 +219,7 @@ static inline void list_rotate_left(struct list_head *head)
* list_is_singular - tests whether a list has just one entry.
* @head: the list to test.
*/
-static inline int list_is_singular(const struct list_head *head)
+static inline bool list_is_singular(const struct list_head *head)
{
return !list_empty(head) && (head->next == head->prev);
}
rday
--
========================================================================
Robert P. J. Day Waterloo, Ontario, CANADA
http://crashcourse.ca
Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
========================================================================
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Change return type of obvious Boolean list fns to "bool".
2010-11-21 13:35 [PATCH] Change return type of obvious Boolean list fns to "bool" Robert P. J. Day
@ 2010-11-22 4:59 ` Rakib Mullick
2010-11-23 19:16 ` Randy Dunlap
1 sibling, 0 replies; 3+ messages in thread
From: Rakib Mullick @ 2010-11-22 4:59 UTC (permalink / raw)
To: Robert P. J. Day; +Cc: Linux Kernel Mailing List
On Sun, Nov 21, 2010 at 7:35 PM, Robert P. J. Day <rpjday@crashcourse.ca> wrote:
>
> Compile-tested with defconfig on x86_64. Not sure who should
> be CCed when a patch touches something this basic. Andrew?
>
You can use scripts/get_maintainer.pl to find out who should be cc'ed.
thanks,
rakib
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Change return type of obvious Boolean list fns to "bool".
2010-11-21 13:35 [PATCH] Change return type of obvious Boolean list fns to "bool" Robert P. J. Day
2010-11-22 4:59 ` Rakib Mullick
@ 2010-11-23 19:16 ` Randy Dunlap
1 sibling, 0 replies; 3+ messages in thread
From: Randy Dunlap @ 2010-11-23 19:16 UTC (permalink / raw)
To: Robert P. J. Day; +Cc: Linux Kernel Mailing List
On Sun, 21 Nov 2010 08:35:04 -0500 (EST) Robert P. J. Day wrote:
>
> It's clear that a number of basic list routines return simply a
> Boolean value, so change their return type from "int" to "bool".
>
> Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
with allmodconfig on i386 and x86_64.
> ---
>
> Compile-tested with defconfig on x86_64. Not sure who should
> be CCed when a patch touches something this basic. Andrew?
>
>
> diff --git a/include/linux/list.h b/include/linux/list.h
> index 9a5f8a7..1d6ed55 100644
> --- a/include/linux/list.h
> +++ b/include/linux/list.h
> @@ -167,7 +167,7 @@ static inline void list_move_tail(struct list_head *list,
> * @list: the entry to test
> * @head: the head of the list
> */
> -static inline int list_is_last(const struct list_head *list,
> +static inline bool list_is_last(const struct list_head *list,
> const struct list_head *head)
> {
> return list->next == head;
> @@ -177,7 +177,7 @@ static inline int list_is_last(const struct list_head *list,
> * list_empty - tests whether a list is empty
> * @head: the list to test.
> */
> -static inline int list_empty(const struct list_head *head)
> +static inline bool list_empty(const struct list_head *head)
> {
> return head->next == head;
> }
> @@ -195,7 +195,7 @@ static inline int list_empty(const struct list_head *head)
> * to the list entry is list_del_init(). Eg. it cannot be used
> * if another CPU could re-list_add() it.
> */
> -static inline int list_empty_careful(const struct list_head *head)
> +static inline bool list_empty_careful(const struct list_head *head)
> {
> struct list_head *next = head->next;
> return (next == head) && (next == head->prev);
> @@ -219,7 +219,7 @@ static inline void list_rotate_left(struct list_head *head)
> * list_is_singular - tests whether a list has just one entry.
> * @head: the list to test.
> */
> -static inline int list_is_singular(const struct list_head *head)
> +static inline bool list_is_singular(const struct list_head *head)
> {
> return !list_empty(head) && (head->next == head->prev);
> }
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-11-23 19:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-21 13:35 [PATCH] Change return type of obvious Boolean list fns to "bool" Robert P. J. Day
2010-11-22 4:59 ` Rakib Mullick
2010-11-23 19:16 ` Randy Dunlap
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.