Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1164755 > unrolled thread

Re: [PATCH RFC V2] coccinelle: flag constants being passed for jiffies

Started byJulia Lawall <julia.lawall@lip6.fr>
First post2015-06-14 09:10 +0200
Last post2015-06-14 09:10 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH RFC V2] coccinelle: flag constants being passed for  jiffies Julia Lawall <julia.lawall@lip6.fr> - 2015-06-14 09:10 +0200

#1164755 — Re: [PATCH RFC V2] coccinelle: flag constants being passed for jiffies

FromJulia Lawall <julia.lawall@lip6.fr>
Date2015-06-14 09:10 +0200
SubjectRe: [PATCH RFC V2] coccinelle: flag constants being passed for jiffies
Message-ID<pBadk-4Q7-3@gated-at.bofh.it>
> +@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/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web