public inbox for cocci@systeme.lip6.fr
 help / color / mirror / Atom feed
* [cocci] [RFC] Increasing usage of direct pointer assignments from memcpy() calls with SmPL?
@ 2025-10-29 19:56 Markus Elfring
  2025-10-29 21:24 ` Julia Lawall
  0 siblings, 1 reply; 17+ messages in thread
From: Markus Elfring @ 2025-10-29 19:56 UTC (permalink / raw)
  To: cocci; +Cc: LKML, kernel-janitors, Miaoqian Lin

Hello,

I got into the mood to try another simple source code transformation out which
can be achieved also by the means of the semantic patch language.

@replacement@
expression object, size, source, target;
@@
 target =
-         object;
 memcpy(
-       target
+       object
        , source,
        size);


Test result (according to the software combination “Coccinelle 1.3.0”):
Markus_Elfring@Sonne:…/Projekte/Linux/next-analyses> time /usr/bin/spatch --max-width 100 --timeout 23 -j4 --chunksize 1 --no-loops -dir . …/Projekte/Coccinelle/janitor/use_memcpy_assignment.cocci > …/Projekte/Bau/Linux/scripts/Coccinelle/use_memcpy_assignment-no_loops-20251029.diff 2> …/Projekte/Bau/Linux/scripts/Coccinelle/use_memcpy_assignment-no_loops-errors-20251029.txt
real    5m35,579s
user    20m20,037s
sys     0m14,467s


It can be determined then from the generated diff file that mentioned
implementation details can be transformed in 304 source files at the moment.
Thus I became curious if it would be supported to adjust any places there
according to (Linux) coding style preferences.

Regards,
Markus

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2025-10-31 16:57 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-29 19:56 [cocci] [RFC] Increasing usage of direct pointer assignments from memcpy() calls with SmPL? Markus Elfring
2025-10-29 21:24 ` Julia Lawall
2025-10-30  9:33   ` Markus Elfring
2025-10-30 10:12     ` Julia Lawall
2025-10-30 10:19       ` Markus Elfring
2025-10-30 10:32         ` Julia Lawall
2025-10-30 12:26   ` Markus Elfring
2025-10-30 12:31     ` Julia Lawall
2025-10-30 13:35       ` Markus Elfring
2025-10-30 13:38         ` Julia Lawall
2025-10-30 13:47       ` Dan Carpenter
2025-10-30 13:58         ` Markus Elfring
2025-10-31  6:00         ` Markus Elfring
2025-10-30 14:06   ` Markus Elfring
2025-10-30 14:14     ` Julia Lawall
2025-10-30 14:22       ` Markus Elfring
2025-10-31 16:57   ` Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox