linux-mips
[Top] [All Lists]

Re: [PATCH v2 2/2] hugetlb: Provide safer dummy values for HPAGE_MASK an

To: David Daney <ddaney.cavm@gmail.com>
Subject: Re: [PATCH v2 2/2] hugetlb: Provide safer dummy values for HPAGE_MASK and HPAGE_SIZE
From: Sergei Shtylyov <sshtylyov@mvista.com>
Date: Fri, 18 Nov 2011 12:56:17 +0400
Cc: linux-mips@linux-mips.org, ralf@linux-mips.org, Andrew Morton <akpm@linux-foundation.org>, linux-kernel@vger.kernel.org, David Daney <david.daney@cavium.com>, David Rientjes <rientjes@google.com>
In-reply-to: <1321567050-13197-3-git-send-email-ddaney.cavm@gmail.com>
References: <1321567050-13197-1-git-send-email-ddaney.cavm@gmail.com> <1321567050-13197-3-git-send-email-ddaney.cavm@gmail.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:8.0) Gecko/20111105 Thunderbird/8.0
Hello.

On 18-11-2011 1:57, David Daney wrote:

From: David Daney<david.daney@cavium.com>

It was pointed out by David Rientjes that the dummy values for
HPAGE_MASK and HPAGE_SIZE are quite unsafe.  It they are inadvertently
used with !CONFIG_HUGETLB_PAGE, compilation would succeed, but the
resulting code would surly not do anything sensible.

Place BUG() in the these dummy definitions, as we do in similar
circumstances in other places, so any abuse can be easily detected.

Since the only sane place to use these symbols when
!CONFIG_HUGETLB_PAGE is on dead code paths, the BUG() cause any actual
code to be emitted by the compiler.

   You mean "doesn't cause"?

Cc: David Rientjes<rientjes@google.com>
Signed-off-by: David Daney<david.daney@cavium.com>

WBR, Sergei


<Prev in Thread] Current Thread [Next in Thread>