From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linas Vepstas Subject: Re: [PATCH 4/6] Hexagon: check to if we will overflow the signal stack Date: Thu, 4 Apr 2013 11:25:50 -0500 Message-ID: References: <1365033776-21804-1-git-send-email-rkuo@codeaurora.org> <1365033776-21804-5-git-send-email-rkuo@codeaurora.org> Reply-To: linasvepstas@gmail.com Mime-Version: 1.0 Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:reply-to:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=hiVZLn35lqNUBpAsnOgAeH2UE2hubrvThLvuw4eai1I=; b=X8ZjLZ/NkfvEAsEGTA2YYp0u8Aixzh99kYq5Wx3E7rHgwWZYjnQqIymbyE7Ss3K9yF 5AU94s8G5r8SAn7TB2dFOo+oB9ARi93nNB/NbaGXucAD9YqFPm7oVEWy7bknsKiYZC6v QKxIYbQITWBVndoKIi6BrDu8P5Puusgc9HipC//sTn1pIHqFv1nN94/7oskWcwVbjNXH ajjlg2QYtlyF4ALHNUadwbIiTeOk0eVmERVYoNryftXPsnMzP3kOvCsMComRJfnU1ygH EVbO8j5BIIGm1+Q8wmWjw5lwaynFvZdlxZac44rsPgq0vQmmqekEisqW9YTdkrD3IOYF uWPg== In-Reply-To: <1365033776-21804-5-git-send-email-rkuo@codeaurora.org> Sender: linux-hexagon-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Richard Kuo Cc: linux-arch@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-kernel@vger.kernel.org, viro@zeniv.linux.org.uk On 3 April 2013 19:02, Richard Kuo wrote: > + /* check if we would overflow the alt stack */ > + if (on_sig_stack(sp) && !likely(on_sig_stack(sp - frame_size))) > + return (void __user __force *)-1UL; I found the !likely construction confusing, as its doing both a 'unlikely' (right?) and inverting the argument. It seems clearer, to idiots like me, to write this as: if (on_sig_stack(sp) && unlikely(!on_sig_stack(sp - frame_size))) since where checking for overflow, and its unlikely that the overflow happened. -- Linas