Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751887AbbFNHCb (ORCPT ); Sun, 14 Jun 2015 03:02:31 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:32032 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751475AbbFNHC1 (ORCPT ); Sun, 14 Jun 2015 03:02:27 -0400 X-IronPort-AV: E=Sophos;i="5.13,611,1427752800"; d="scan'208";a="165115383" Date: Sun, 14 Jun 2015 09:02:24 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@localhost6.localdomain6 To: Nicholas Mc Guire cc: Julia Lawall , Gilles Muller , Nicolas Palix , Michal Marek , Joe Perches , Andy Whitcroft , John Stultz , cocci@systeme.lip6.fr, linux-kernel@vger.kernel.org Subject: Re: [PATCH RFC V2] coccinelle: flag constants being passed for jiffies In-Reply-To: <1434128979-2096-1-git-send-email-hofrat@osadl.org> Message-ID: References: <1434128979-2096-1-git-send-email-hofrat@osadl.org> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1304 Lines: 42 > +@script:python depends on report@ > +p << cc.p; > +timeout << cc.C; > +@@ > + > +if str.isdigit(timeout): > + if (int(timeout) != 1): > + msg = "WARNING: timeout (%s) seems HZ dependent" % (timeout) > + coccilib.report.print_report(p[0], msg) The parentheses in the warning messages around the timeouts seem a little strange to me. Otherwise, as a semantic patch, it looks fine. I can't judge the problem being solved though. julia > +@script:python depends on strict@ > +p << cc.p; > +timeout << cc.C; > +@@ > + > +# "strict" mode prints the cases that use C-constants != HZ > +# as well as the numeric constants != 1. This will deliver a false > +# positives if the C-constant is already in jiffies ! > +if str.isdigit(timeout): > + if (int(timeout) != 1): > + msg = "WARNING: timeout (%s) is HZ dependent" % (timeout) > + coccilib.report.print_report(p[0], msg) > +elif (timeout != "HZ"): > + msg = "INFO: timeout (%s) may be HZ dependent" % (timeout) > + coccilib.report.print_report(p[0], msg) > -- > 1.7.10.4 > > -- 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/