From patchwork Thu Dec 13 20:45:39 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Laurent Navet [Mali]" X-Patchwork-Id: 1877711 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id C4D4E3FC64 for ; Fri, 14 Dec 2012 07:57:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 96449E687F for ; Thu, 13 Dec 2012 23:57:55 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com [209.85.212.179]) by gabe.freedesktop.org (Postfix) with ESMTP id A81FFE5F3C for ; Thu, 13 Dec 2012 12:44:19 -0800 (PST) Received: by mail-wi0-f179.google.com with SMTP id o1so1927913wic.12 for ; Thu, 13 Dec 2012 12:44:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=pVdKLlPvJUc7Y17VSAHo6TWkG74Fu8PnU1VoutTZQKE=; b=P2+O6u8EEXRS+jf982q5eqH+qS2D1t8pKRbfRZYXG8J5RwWSrLwuktQL61uMZQLjvG MlNuEQYQc9F6Sd94PPufysYSRR/gtr2J3/IEmuU1jOp35JbtTWOoxHXcDdNkzfwIZvui 9fMcxroRE7GvTyORvWjt9nyVF1c1SG5nF0WsLkATAiJ6FQx8cE3WqX3oNkyB8r+jo9xa ZTrYt4bmhQQi+RtBrK3VqNle7cnEfV1xRuTP7ZniuhJH8OAlNBHqjoKGhYXuTjQyv/CK JB9MfXBSgJ8Pt6RHp9FN0Og9H8atPWkmYwsOfsy/J3DwBPCVsje4g0XufQgeesED0Iq0 BsDQ== Received: by 10.180.102.101 with SMTP id fn5mr5548863wib.19.1355431458984; Thu, 13 Dec 2012 12:44:18 -0800 (PST) Received: from gmail.com (ANantes-257-1-105-129.w90-25.abo.wanadoo.fr. [90.25.192.129]) by mx.google.com with ESMTPS id t17sm4390069wiv.6.2012.12.13.12.44.17 (version=SSLv3 cipher=OTHER); Thu, 13 Dec 2012 12:44:18 -0800 (PST) Date: Thu, 13 Dec 2012 21:45:39 +0100 From: Laurent Navet To: Dan Carpenter Subject: Re: [PATCH] drivers: nouveau: Bool tests don't need comparison Message-ID: <20121213204538.GA7031@gmail.com> References: <1355320451-23292-1-git-send-email-laurent.navet@gmail.com> <20121213081657.GV6568@mwanda> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20121213081657.GV6568@mwanda> User-Agent: Mutt/1.5.21 (2010-09-15) X-Mailman-Approved-At: Thu, 13 Dec 2012 23:57:41 -0800 Cc: kernel-janitors@vger.kernel.org, bskeggs@redhat.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Bool initializations should use true and false. Bool tests don't need comparisons. Based on contributions from Joe Perches, Rusty Russell and Bruce W Allan. The semantic patch that makes this output is available in scripts/coccinelle/misc/boolinit.cocci. More information about semantic patching is available at http://coccinelle.lip6.fr/ Signed-off-by: Laurent Navet --- drivers/gpu/drm/nouveau/core/subdev/timer/base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/core/subdev/timer/base.c b/drivers/gpu/drm/nouveau/core/subdev/timer/base.c index 5d417cc..de6d6b7 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/timer/base.c +++ b/drivers/gpu/drm/nouveau/core/subdev/timer/base.c @@ -72,7 +72,7 @@ nouveau_timer_wait_cb(void *obj, u64 nsec, bool (*func)(void *), void *data) time0 = ptimer->read(ptimer); do { - if (func(data) == true) + if (func(data)) return true; } while (ptimer->read(ptimer) - time0 < nsec);