public inbox for linux-metag@vger.kernel.org
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@lip6.fr>
To: Joe Perches <joe@perches.com>
Cc: linux-pm@vger.kernel.org, kernel-janitors@vger.kernel.org,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-clk@vger.kernel.org, linaro-mm-sig@lists.linaro.org,
	Julia Lawall <Julia.Lawall@lip6.fr>,
	linux-mtd@lists.infradead.org, linux-tegra@vger.kernel.org,
	linux-media@vger.kernel.org, linux-metag@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, drbd-dev@lists.linbit.com
Subject: Re: [PATCH 00/15] improve function-level documentation
Date: Sat, 1 Oct 2016 22:39:15 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.10.1610012232350.3445@hadrien> (raw)
In-Reply-To: <1475353194.1996.3.camel@perches.com>



On Sat, 1 Oct 2016, Joe Perches wrote:

> On Sat, 2016-10-01 at 21:46 +0200, Julia Lawall wrote:
> > These patches fix cases where the documentation above a function definition
> > is not consistent with the function header.  Issues are detected using the
> > semantic patch below (http://coccinelle.lip6.fr/).  Basically, the semantic
> > patch parses a file to find comments, then matches each function header,
> > and checks that the name and parameter list in the function header are
> > compatible with the comment that preceeds it most closely.
>
> Hi Julia.
>
> Would it be possible for a semantic patch to scan for
> function definitions where the types do not have
> identifiers and update the definitions to match the
> declarations?
>
> For instance, given:
>
> <some.h>
> int foo(int);
>
> <some.c>
> int foo(int bar)
> {
> 	return baz;
> }
>
> Could coccinelle output:
>
> diff a/some.h b/some.h
> []
> -int foo(int);
> +int foo(int bar);

The following seems to work:

@r@
identifier f;
position p;
type T, t;
parameter list[n] ps;
@@

T f@p(ps,t,...);

@s@
identifier r.f,x;
type r.T, r.t;
parameter list[r.n] ps;
@@

T f(ps,t x,...) { ... }

@@
identifier r.f, s.x;
position r.p;
type r.T, r.t;
parameter list[r.n] ps;
@@

T f@p(ps,t
+ x
  ,...);

After letting it run for a few minutes without making any effort to
include .h files, I get over 2700 changed lines.

julia
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2016-10-01 20:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-01 19:46 [PATCH 00/15] improve function-level documentation Julia Lawall
2016-10-01 19:46 ` [PATCH 14/15] irqchip/metag-ext: " Julia Lawall
2016-10-01 20:33   ` James Hogan
2016-10-01 20:19 ` [PATCH 00/15] " Joe Perches
2016-10-01 20:39   ` Julia Lawall [this message]
     [not found] ` <1475351192-27079-1-git-send-email-Julia.Lawall-L2FTfq7BK8M@public.gmane.org>
2016-10-05 13:15   ` Daniel Vetter
2016-10-05 14:04     ` kernel-doc-rst-lint (was: Re: [PATCH 00/15] improve function-level documentation) Jani Nikula
2016-10-05 17:27       ` Markus Heiser
2016-10-05 20:25       ` Julia Lawall
     [not found]     ` <CAKMK7uHT3FutHQuQQ3iwXmYbidB3AOs7AxnpaJD4MTqy0-QehQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-10-05 14:47       ` [PATCH 00/15] improve function-level documentation Julia Lawall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.10.1610012232350.3445@hadrien \
    --to=julia.lawall@lip6.fr \
    --cc=drbd-dev@lists.linbit.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=joe@perches.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-metag@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox