From: Eva Rachel Retuya <eraretuya@gmail.com>
To: Elizabeth Ferdman <gnudevliz@gmail.com>
Cc: outreachy-kernel@googlegroups.com
Subject: Re: [Outreachy kernel] Coccinelle Constification
Date: Sun, 16 Oct 2016 11:04:20 +0800 [thread overview]
Message-ID: <20161016030416.GC2406@Socrates-DK> (raw)
In-Reply-To: <20161016022145.GA2215@localhost>
Hello Liz,
I'm a fellow applicant so I might be wrong on some things but let me
share my experience so far with coccinelle usage.
On Sat, Oct 15, 2016 at 07:21:46PM -0700, Elizabeth Ferdman wrote:
> I'd like to try doing constification using Coccinelle but I'm having
> trouble starting on this task. Bhumika Goyal has submitted lots of these
> and I've looked at the scripts she uses but I'm very confused about the
> process.
>
> Do you identify the structs that
> need to be const first, then write the cocci script? If not, then what
> is a basic script to use to find structs that need to be const? I can't
> find any specific documentation that pertains to constification and
> coccinelle.
>
It depends on your approach. Sure you can manually identify by code
tracing if the struct qualifies to be made const then make a script to
write the changes esp. if there are lots of places to be changed.
You can also define a set of properties/situations where declaring the
structure const is justified like this:
https://git.kernel.org/cgit/linux/kernel/git/gregkh/staging.git/commit/drivers/staging?h=staging-testing&id=1c099ed63f8363228a0b075a25511c9feb90e03f
and from there write your script so that it'll detect instances where
the criteria you previously defined is met. Now that covers detection,
for making the changes I suggest you write another one to cater
specifically to a specific driver and also include the transformation
that needs to be done.
About the basic script, I suggest you try to match any struct
declaration first using the disable optional_qualifier isomorphism
stated on the project's small task 1. Start small then build your way
up.
Once you get your basic script running, coordinate the rest with Julia.
Bhumika's patches are great reference, just observe the 'criteria' at
which structures can be deemed 'const'.
I hope I clear some of your confusion,
Eva
> Thanks,
> Liz
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20161016022145.GA2215%40localhost.
> For more options, visit https://groups.google.com/d/optout.
next prev parent reply other threads:[~2016-10-16 3:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-16 2:21 Coccinelle Constification Elizabeth Ferdman
2016-10-16 3:04 ` Eva Rachel Retuya [this message]
2016-10-16 18:39 ` [Outreachy kernel] " Elizabeth Ferdman
2016-10-16 5:33 ` Bhumika Goyal
2016-10-16 18:54 ` [Outreachy kernel] " Elizabeth Ferdman
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=20161016030416.GC2406@Socrates-DK \
--to=eraretuya@gmail.com \
--cc=gnudevliz@gmail.com \
--cc=outreachy-kernel@googlegroups.com \
/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.