The patch titled Subject: coccinelle: semantic patch for simple_open() has been added to the -mm tree. Its filename is coccinelle-semantic-patch-for-simple_open.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Stephen Boyd <sboyd@xxxxxxxxxxxxxx> Subject: coccinelle: semantic patch for simple_open() Find instances of an open-coded simple_open() and replace them with calls to simple_open(). This seems to eat the definition of simple_open() as well. Is there a way to say only remove both the function and the reference to the function so that libfs survives? Signed-off-by: Stephen Boyd <sboyd@xxxxxxxxxxxxxx> Cc: Al Viro <viro@xxxxxxxxxxxxxxxxxx> Cc: Julia Lawall <Julia.Lawall@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- scripts/coccinelle/api/simple_open.cocci | 34 +++++++++++++++++++++ 1 file changed, 34 insertions(+) diff -puN /dev/null scripts/coccinelle/api/simple_open.cocci --- /dev/null +++ a/scripts/coccinelle/api/simple_open.cocci @@ -0,0 +1,34 @@ +// This removes an open coded simple_open() function +// and replaces file operations references to the function +// with simple_open() instead. +// + +virtual patch +virtual context + +@ open @ +identifier open_f; +identifier i, f; +@@ +-int open_f(struct inode *i, struct file *f) +-{ +( +-if (i->i_private) +-f->private_data = i->i_private; +| +-f->private_data = i->i_private; +) +-return 0; +-} + +@ has_open depends on open @ +identifier fops; +identifier open.open_f; +@@ +struct file_operations fops = { +... +-.open = open_f, ++.open = simple_open, +... +}; + _ Subject: Subject: coccinelle: semantic patch for simple_open() Patches currently in -mm which might be from sboyd@xxxxxxxxxxxxxx are origin.patch linux-next.patch libfs-add-simple_open.patch coccinelle-semantic-patch-for-simple_open.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html