From 2205c84de4c8cc75e3446936f7d93e32391f4aed Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Mon, 15 Sep 2003 08:11:29 +0000 Subject: comparison was always false due to limited range of data types. Carefully cast to unsigned long long prior to multiply to get the expected result. --- init/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'init') diff --git a/init/init.c b/init/init.c index 8da358c..85792c9 100644 --- a/init/init.c +++ b/init/init.c @@ -333,7 +333,7 @@ static unsigned int check_free_memory(void) s--; } result = (info.totalram >> s) + (info.totalswap >> s); - if ((unsigned long long) (result * u) > UINT_MAX) { + if (((unsigned long long)result * (unsigned long long)u) > UINT_MAX) { return(UINT_MAX); } else { return(result * u); -- cgit v1.1