Re: Build regressions/improvements in v3.17-rc6 (take two)

From: Chuck Ebbert
Date: Tue Sep 23 2014 - 06:10:12 EST


On Tue, 23 Sep 2014 10:31:20 +0200
Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> wrote:

> + /scratch/kisskb/src/mm/memcontrol.c: warning: control reaches end of non-void function [-Wreturn-type]: => 4164:1

Well, this one was educational. It was caused by:

commit 05b8430123359886ef6a4146fba384e30d771b3f
Author: Johannes Weiner <hannes@xxxxxxxxxxx>
Date: Wed Aug 6 16:05:59 2014 -0700

mm: memcontrol: use root_mem_cgroup res_counter

This removed the return statement from mem_cgroup_read_u64(). I think
Johannes was assuming that BUG() never returns, but it looks like that
is not true on some archs, especially with CONFIG_BUG disabled. (On x86
it never returns in any case.) The bug was always there - it would have
just returned an uninitialized variable before. Now it returns some
different random value.

I'm not sure what to do here. I really think BUG() should never return
no matter what options are configured. In this case it's no big deal
and I'd just return zero to silence the warning, but a bigger problem
is that there are probably other places assuming BUG() never
returns?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/