[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <ddc8654a-9505-451f-87ad-075bfa646381@web.de>
Date: Wed, 29 Oct 2025 20:56:26 +0100
From: Markus Elfring <Markus.Elfring@....de>
To: cocci@...ia.fr
Cc: LKML <linux-kernel@...r.kernel.org>, kernel-janitors@...r.kernel.org,
 Miaoqian Lin <linmq006@...il.com>
Subject: [RFC] Increasing usage of direct pointer assignments from memcpy()
 calls with SmPL?
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@...ne:…/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
Powered by blists - more mailing lists
 
