All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fonyuy-Asheri Caleb <fonyuy-asheri.caleb@inria.fr>
To: Julia Lawall <julia.lawall@inria.fr>
Cc: cocci <cocci@inria.fr>
Subject: Re: [cocci] Creating function definitions from function pointers in a struct with coccinelle
Date: Mon, 10 Feb 2025 12:23:39 +0100 (CET)	[thread overview]
Message-ID: <1948830352.8646779.1739186619092.JavaMail.zimbra@inria.fr> (raw)
In-Reply-To: <74e89641-1819-e332-47c1-f1ba5fbc47@inria.fr>

Thank you for your prompt response

> I'm not really sure what you are trying to do here.  Maybe if you could
> give an example of source code an the results you want to achieve that
> would be more understandable.
> 

I have structures defined as such in the code base but this is a problem for 
the work I want to do. 

struct save_ops {
    void (*start_copy)(void *data, const char *filename);
    void *(*copy_finished)(const char *filename);
    void (*check_copied)(void *data);
};

The aim of my patch is to define the following functions from the above struct

 
void hvm_start_copy(void *data, const char *filename);
void *hvm_copy_finished(const char *filename);
void hvm_check_copied(void *data);

void pv_start_copy(void *data, const char *filename);
void *pv_copy_finished(const char *filename);
void pv_check_copied(void *data);

The python m_rule I have permits me to match the list of function pointers
and the python script permits me to rename the pointers to the function names
as I have them here. Having at least the pv functions will be good for me. 

The issue now is to be able to write these to the resulting patch. 


Caleb

  reply	other threads:[~2025-02-10 11:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-10 11:08 [cocci] Creating function definitions from function pointers in a struct with coccinelle Fonyuy-Asheri Caleb
2025-02-10 11:16 ` Julia Lawall
2025-02-10 11:23   ` Fonyuy-Asheri Caleb [this message]
2025-02-10 11:32     ` Julia Lawall
2025-02-10 11:42       ` Fonyuy-Asheri Caleb
2025-02-10 11:56         ` Julia Lawall
2025-02-10 14:48           ` Fonyuy-Asheri Caleb
2025-02-10 14:52             ` Julia Lawall
2025-02-10 14:54               ` Fonyuy-Asheri Caleb
2025-02-10 15:00                 ` Julia Lawall
2025-02-10 15:54                 ` Markus Elfring

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=1948830352.8646779.1739186619092.JavaMail.zimbra@inria.fr \
    --to=fonyuy-asheri.caleb@inria.fr \
    --cc=cocci@inria.fr \
    --cc=julia.lawall@inria.fr \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.