Coccinelle archive on lore.kernel.org
 help / Atom feed
* [Cocci] [PATCH] standard.h: Add Z_SYSCALL_HANDLER macro
@ 2019-01-16 21:04 Himanshu Jha
  2019-01-16 21:45 ` Himanshu Jha
  0 siblings, 1 reply; 2+ messages in thread
From: Himanshu Jha @ 2019-01-16 21:04 UTC (permalink / raw)
  To: Julia.Lawall; +Cc: Flavio Ceolin, cocci, Patrik Flykt

This patch allows coccinelle to parse the Z_SYSCALL_HANDLER
macro for transformation.

Cc: Patrik Flykt <patrik.flykt@linux.intel.com>
Cc: Flavio Ceolin <flavio.ceolin@intel.com>
Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
---

Results:

himanshu@himanshu-Vostro-3559:~/zephyr$ cat test.cocci; spatch --sp-file test.cocci drivers/dma/dma_handlers.c
@r@
identifier fn =~ "^_.*";
@@

   fn (...)

@script:python@
f << r.fn;
@@

print f
init_defs_builtins: /usr/local/bin/../lib/coccinelle/standard.h
HANDLING: drivers/dma/dma_handlers.c
_impl_dma_start
_impl_dma_stop

 standard.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/standard.h b/standard.h
index d9200643..032d75c5 100644
--- a/standard.h
+++ b/standard.h
@@ -777,4 +777,6 @@ do {									\
 #define SYSCALL_DEFINE6(func, t1, a1, t2, a2, t3, a3, t4, a4, t5, a5, t6, a6) \
     asmlinkage unsigned long func(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6)
 
+#define Z_SYSCALL_HANDLER int xxx
+
 #define KBUILD_MODNAME YACFE_STRING
-- 
2.17.1

_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

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

* Re: [Cocci] [PATCH] standard.h: Add Z_SYSCALL_HANDLER macro
  2019-01-16 21:04 [Cocci] [PATCH] standard.h: Add Z_SYSCALL_HANDLER macro Himanshu Jha
@ 2019-01-16 21:45 ` Himanshu Jha
  0 siblings, 0 replies; 2+ messages in thread
From: Himanshu Jha @ 2019-01-16 21:45 UTC (permalink / raw)
  To: Julia.Lawall; +Cc: Flavio Ceolin, cocci, Patrik Flykt

On Thu, Jan 17, 2019 at 02:34:55AM +0530, Himanshu Jha wrote:
> This patch allows coccinelle to parse the Z_SYSCALL_HANDLER
> macro for transformation.
> 
> Cc: Patrik Flykt <patrik.flykt@linux.intel.com>
> Cc: Flavio Ceolin <flavio.ceolin@intel.com>
> Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
> ---

Please drop this patch Julia.

I misunderstood what you suggested and it works fine using
`--macro-file` flag:

himanshu@himanshu-Vostro-3559:~/zephyr$ cat mymacros.h; spatch --sp-file test.cocci drivers/dma/dma_handlers.c --macro-file mymacros.h
#define Z_SYSCALL_HANDLER int xxx
init_defs_builtins: /usr/local/bin/../lib/coccinelle/standard.h
init_defs: mymacros.h
HANDLING: drivers/dma/dma_handlers.c
_impl_dma_start
_impl_dma_stop


Sorry for the noise.

-- 
Himanshu Jha
Undergraduate Student
Department of Electronics & Communication
Guru Tegh Bahadur Institute of Technology
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-16 21:04 [Cocci] [PATCH] standard.h: Add Z_SYSCALL_HANDLER macro Himanshu Jha
2019-01-16 21:45 ` Himanshu Jha

Coccinelle archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/cocci/0 cocci/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 cocci cocci/ https://lore.kernel.org/cocci \
		cocci@systeme.lip6.fr cocci@archiver.kernel.org
	public-inbox-index cocci


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/fr.lip6.systeme.cocci


AGPL code for this site: git clone https://public-inbox.org/ public-inbox