Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754900AbbHLPQ6 (ORCPT ); Wed, 12 Aug 2015 11:16:58 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:45059 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752850AbbHLPQ5 (ORCPT ); Wed, 12 Aug 2015 11:16:57 -0400 X-IronPort-AV: E=Sophos;i="5.15,661,1432591200"; d="scan'208";a="142619853" Date: Wed, 12 Aug 2015 17:16:46 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Michal Marek cc: Kris Borer , Gilles Muller , nicolas.palix@imag.fr, linux-kernel@vger.kernel.org, cocci@systeme.lip6.fr Subject: Re: [RFC] coccinelle: add style check for assignment in if In-Reply-To: <55CB60AC.3@suse.cz> Message-ID: References: <1439387500-11183-1-git-send-email-kborer@gmail.com> <55CB543A.70007@suse.cz> <55CB60AC.3@suse.cz> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323329-1999117561-1439392607=:2527" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1909 Lines: 49 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-1999117561-1439392607=:2527 Content-Type: TEXT/PLAIN; charset=UTF-8 Content-Transfer-Encoding: 8BIT On Wed, 12 Aug 2015, Michal Marek wrote: > On 2015-08-12 16:53, Kris Borer wrote: > > On Wed, Aug 12, 2015 at 10:12 AM, Michal Marek > > wrote: > > > > On 2015-08-12 15:51, Kris Borer wrote: > > > Add a semantic patch for fixing some cases of checkpatch.pl error: > > > > > > ERROR: do not use assignment in if condition > > > > There is a gcc warning for this already. > > > > Michal > > > > > > ​My intention was not to create another way to uncover problems but > > rather to ​provide a tool for people to use to fix them. Let me know if > > I am misunderstanding the purpose of this subsystem. > > OK, so this is fixing a style issue, and not cases of accidental > assignment instead of '==' (for which there is a gcc warning and we > hopefully do not have such errors in the kernel). While I'm probably > ignorant and no not see how one style is better than the other, I see > that some maintainers already applied your patches based on this check. > So I'll merge it once Julia acks it. Actually, assignments inside if tests are really annoying for Coccinelle, because there become two different control flows from the assignment to the test on the result. So I would be happy to see these go away. I'll check the semantic patch as soon as possible. julia --8323329-1999117561-1439392607=:2527-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/