Re: [patch] mm, mempolicy: dummy slab_node return value for bugless kernels

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 4 Mar 2012 13:43:32 -0800 (PST)
David Rientjes <rientjes@xxxxxxxxxx> wrote:

> BUG() is a no-op when CONFIG_BUG is disabled, so slab_node() needs a
> dummy return value to avoid reaching the end of a non-void function.
> 
> Signed-off-by: David Rientjes <rientjes@xxxxxxxxxx>
> ---
>  mm/mempolicy.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/mm/mempolicy.c b/mm/mempolicy.c
> --- a/mm/mempolicy.c
> +++ b/mm/mempolicy.c
> @@ -1611,6 +1611,7 @@ unsigned slab_node(struct mempolicy *policy)
>  
>  	default:
>  		BUG();
> +		return numa_node_id();
>  	}
>  }

Wait.  If the above code generated a warning then surely we get a *lot*
of warnings!  I'd expect that a lot of code assumes that BUG() never
returns?

Can we fix this within the BUG() definition?  I can't think of a way,
unless gcc gives us a way of accessing the return type of the current
function, and I don't think it does that.


Also, does CONIG_BUG=n even make sense?  If we got here and we know
that the kernel has malfunctioned, what point is there in pretending
otherwise?  Odd.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]