[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8b3f42a3-7053-42de-a66c-92426749e246@web.de>
Date: Mon, 25 Nov 2024 18:48:18 +0100
From: Markus Elfring <Markus.Elfring@....de>
To: Christian Göttsche <cgzones@...glemail.com>,
linux-security-module@...r.kernel.org, cocci@...ia.fr,
Julia Lawall <Julia.Lawall@...ia.fr>, Nicolas Palix <nicolas.palix@...g.fr>,
Serge Hallyn <serge@...lyn.com>
Cc: Christian Göttsche <cgoettsche@...tendoof.de>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [cocci] [PATCH 01/11] coccinelle: Add script to reorder capable()
calls
…
> +++ b/scripts/coccinelle/api/capable_order.cocci
> @@ -0,0 +1,98 @@
…
> +@...ore@
> +identifier F1 = { capable, ns_capable, sockopt_ns_capable };
> +identifier F2 = { capable, ns_capable, sockopt_ns_capable };
May a key word repetition avoided here?
+identifier F1 = { capable, ns_capable, sockopt_ns_capable },
+ F2 = { capable, ns_capable, sockopt_ns_capable };
…
> +//----------------------------------------------------------
> +// For patch mode
> +//----------------------------------------------------------
I suggest to omit such a comment.
> +@ depends on patch@
…
> +(
> +- F@p(EL) op E
> ++ E op F(EL)
> +|
> +- E1 op1 F@p(EL) op2 E2
> ++ E1 op1 E2 op2 F(EL)
> +)
How do you think about to omit extra space characters at the beginning
of any SmPL lines?
> +//----------------------------------------------------------
> +// For context mode
> +//----------------------------------------------------------
> +
> +@r1 depends on !patch exists@
How good do the provided data fit to the operation modes “org” and “report”?
> +//----------------------------------------------------------
> +// For org mode
> +//----------------------------------------------------------
I suggest to omit such a comment.
> +
> +@...ipt:python depends on org@
> +p << r1.p;
> +@@
> +
> +cocci.print_main("WARNING opportunity for capable reordering",p)
How do you think about to use a statement like the following?
coccilib.org.print_todo(p[0], "WARNING: opportunity for reordering of capable() calls")
> +//----------------------------------------------------------
> +// For report mode
> +//----------------------------------------------------------
I suggest to omit such a comment.
> +@...ipt:python depends on report@
> +p << r1.p;
> +@@
> +
> +msg = "WARNING opportunity for capable reordering"
> +coccilib.report.print_report(p[0], msg)
Can the following code variant be a bit nicer?
coccilib.report.print_report(p[0], "WARNING: opportunity for reordering of capable() calls")
Regards,
Markus
Powered by blists - more mailing lists