Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934051AbcKNMRd (ORCPT ); Mon, 14 Nov 2016 07:17:33 -0500 Received: from ozlabs.org ([103.22.144.67]:58991 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932216AbcKNMR1 (ORCPT ); Mon, 14 Nov 2016 07:17:27 -0500 X-powerpc-patch-notification: thanks X-powerpc-patch-commit: 0e27d27e0d6d92342797e0d37738c276c1ff090e In-Reply-To: <20161109085504.10799-1-andrew.shadura@collabora.co.uk> To: Andrew Shadura , linuxppc-dev@lists.ozlabs.org, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org From: Michael Ellerman Cc: Shuah Khan , Paul Mackerras , Cyril Bur Subject: Re: [RESEND] tools-powerpc: Return false instead of -1 Message-Id: <3tHTzn42Z9z9s5w@ozlabs.org> Date: Mon, 14 Nov 2016 23:17:25 +1100 (AEDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 881 Lines: 33 On Wed, 2016-09-11 at 08:55:04 UTC, Andrew Shadura wrote: > From: Peter Senna Tschudin > > Returning a negative value for a boolean function seem to have the > undesired effect of returning true. require_paranoia_below() is a > boolean function, but the variable used to store the return value is an > integer, receiving -1 or 0. This patch convert rc to bool, replace -1 > by false, and 0 by true. > > This issue was found by the following Coccinelle semantic patch: > > @@ > identifier f, ret; > constant C; > typedef bool; > @@ > bool f (...){ > <+... > ret = -C; > ... > * return ret; > ...+> > } > > > Signed-off-by: Peter Senna Tschudin > Signed-off-by: Andrew Shadura Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/0e27d27e0d6d92342797e0d37738c2 cheers