From: elfring@users.sourceforge.net (SF Markus Elfring)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH RFC 3/5] coccinelle: add xxxsetbitsXX converting spatch
Date: Sun, 9 Sep 2018 13:13:25 +0200 [thread overview]
Message-ID: <463dbbdc-7afc-bee8-8da1-bbe70b4aec26@users.sourceforge.net> (raw)
In-Reply-To: <1536349307-20714-4-git-send-email-clabbe@baylibre.com>
How do you think about to add any more meta-data for this semantic patch script?
* SPDX identifier
* Copyright information
* Confidence level
https://bottest.wiki.kernel.org/coccicheck
> +virtual context
Further variables will be needed if you would like to use corresponding
operation modes (besides ?patch?).
> +expression reg;
> +expression set;
> +expression clear;
I propose once more to avoid the repetition of (unnecessary) SmPL code.
This part could be written like the following instead.
+expression clear, set, reg;
If you would increase the usage of SmPL disjunctions, the specification
of duplicate SmPL code could be reduced considerably.
* Would you like to merge SmPL rules based on the distinction between
the data types ?u32? and ?u64??
* Did you identify any optional code in this transformation approach?
> +@@
> +expression base;
> +expression offset;
> +expression value;
> +@@
> +
> +- mtu3_setbits(base, offset, value);
> ++ setbits32(base + offset, value);
> +
> +@@
> +expression base;
> +expression offset;
> +expression mask;
> +@@
> +
> +- mtu3_clrbits(base, offset, mask);
> ++ clrbits32(base + offset, mask);
Another update suggestion:
+ at replacement@
+expression base, offset;
+@@
+(
+-mtu3_clrbits
++clrbits32
+|
+-mtu3_setbits
++setbits32
+)(base
+- ,
++ +
+ offset, ...);
Would you like to try further software fine-tuning out?
Regards,
Markus
next prev parent reply other threads:[~2018-09-09 11:13 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-07 19:41 [PATCH 0/5] introduce setbits32/clrbits32/clrsetbits32/setbits64/clrbits64/clrsetbits64 functions Corentin Labbe
2018-09-07 19:41 ` [PATCH 1/5] powerpc: rename setbits32/clrbits32 to setbits32_be/clrbits32_be Corentin Labbe
2018-09-10 5:16 ` Christophe LEROY
2018-09-10 18:50 ` LABBE Corentin
2018-09-07 19:41 ` [PATCH 2/5] include: add setbits32/clrbits32/clrsetbits32/setbits64/clrbits64/clrsetbits64 in linux/setbits.h Corentin Labbe
2018-09-07 20:00 ` Scott Wood
2018-09-10 18:49 ` LABBE Corentin
2018-09-10 5:22 ` Christophe LEROY
2018-09-10 18:53 ` LABBE Corentin
2018-09-07 19:41 ` [PATCH RFC 3/5] coccinelle: add xxxsetbitsXX converting spatch Corentin Labbe
2018-09-09 11:13 ` SF Markus Elfring [this message]
2018-09-07 19:41 ` [PATCH 4/5] net: ethernet: stmmac: use xxxsetbits32 Corentin Labbe
2018-09-07 19:41 ` [PATCH 5/5] ata: ahci_sunxi: use xxxsetbits32 functions Corentin Labbe
2018-09-07 21:57 ` [PATCH 0/5] introduce setbits32/clrbits32/clrsetbits32/setbits64/clrbits64/clrsetbits64 functions David Miller
2018-09-10 5:24 ` Christophe LEROY
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=463dbbdc-7afc-bee8-8da1-bbe70b4aec26@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).