From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752394AbcFWTYE (ORCPT ); Thu, 23 Jun 2016 15:24:04 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:56072 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752369AbcFWTYB (ORCPT ); Thu, 23 Jun 2016 15:24:01 -0400 Subject: Re: [PATCH] Coccinelle: Add misc/boolconv.cocci To: Joe Perches , Julia Lawall , Gilles Muller , Nicolas Palix , Michal Marek References: <20160623185352.25818-1-afd@ti.com> <1466709177.1847.19.camel@perches.com> CC: , From: "Andrew F. Davis" Message-ID: <576C36E5.9030909@ti.com> Date: Thu, 23 Jun 2016 14:22:13 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: <1466709177.1847.19.camel@perches.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/23/2016 02:12 PM, Joe Perches wrote: > On Thu, 2016-06-23 at 13:53 -0500, Andrew F. Davis wrote: >> Add a script to check for unneeded conversions to bool. > > this could also be extended for bool functions that: > > return !!expression; > and > return expression != 0; > Agreed, it's in the works, I was going to post this current set with some patches to the kernel that is detects, then add additional checks and their kernel fixes incrementally. For the second suggestion I think we could have additions to boolinit.cocci that include the results of comparison/logical operations. Thanks, Andrew