lkml.org 
[lkml]   [2013]   [Apr]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/1] kconfig: fix lists definition for C++
On 04/29/13 10:59, Yann E. MORIN wrote:
> From: "Yann E. MORIN" <yann.morin.1998@free.fr>
>
> The C++ compiler is more strict in that it refuses to assign
> a void* to a struct list_head*.
>
> Fix that by explicitly casting the poisonning constants.
>
> (Tested with all 5 frontends, now.)
>
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Randy Dunlap <rdunlap@infradead.org>
> Cc: Benjamin Poirier <bpoirier@suse.de>

Acked-by: Randy Dunlap <rdunlap@infradead.org>

Thanks.

> ---
> scripts/kconfig/list.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/kconfig/list.h b/scripts/kconfig/list.h
> index ea1d581..685d80e 100644
> --- a/scripts/kconfig/list.h
> +++ b/scripts/kconfig/list.h
> @@ -125,7 +125,7 @@ static inline void __list_del(struct list_head *prev, struct list_head *next)
> static inline void list_del(struct list_head *entry)
> {
> __list_del(entry->prev, entry->next);
> - entry->next = LIST_POISON1;
> - entry->prev = LIST_POISON2;
> + entry->next = (struct list_head*)LIST_POISON1;
> + entry->prev = (struct list_head*)LIST_POISON2;
> }
> #endif
>


--
~Randy


\
 
 \ /
  Last update: 2013-04-29 23:21    [W:0.129 / U:0.412 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site