All of lore.kernel.org
 help / color / mirror / Atom feed
From: elfring@users.sourceforge.net (SF Markus Elfring)
To: cocci@systeme.lip6.fr
Subject: [Cocci] Improving size determinations with SmPL
Date: Thu, 17 Aug 2017 17:18:05 +0200	[thread overview]
Message-ID: <788ea49a-14c4-7dfe-d868-c8df90dd4439@users.sourceforge.net> (raw)

Hello,

I have constructed the following small script for another application of the
semantic patch language.


@replacement@
identifier action, var, work;
type T, X;
@@
 T work(...)
 {
 ... when any
 X* var;
 ... when any
 var = action(...,
              sizeof(
-                    X
+                    *var
                    ),
              ...
             )
 ... when any
 }


I know that this transformation approach is working to some degree.
I came along another source file where I do not get the desired code adjustment
with the software version ?1.0.6-00186-g0acd38ee? automatically.

elfring at Sonne:~/Projekte/Linux/next-patched> git checkout next-20170803 && spatch.opt ~/Projekte/Coccinelle/janitor/safer_size_determination1.cocci fs/pstore/ram.c


How should the software situation be changed further so that the function
?ramoops_pstore_read? will be also handled in the way like I published it in the update suggestion ?pstore: Improve a size determination in three functions??
http://elixir.free-electrons.com/linux/v4.12.8/source/fs/pstore/ram.c#L291
https://patchwork.kernel.org/patch/9904523/
https://lkml.kernel.org/r/<23798ef4-5559-3454-ecf4-e6844b644ff3@users.sourceforge.net>

Regards,
Markus

             reply	other threads:[~2017-08-17 15:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-17 15:18 SF Markus Elfring [this message]
2017-08-17 15:22 ` [Cocci] Improving size determinations with SmPL Julia Lawall
2017-08-17 15:57   ` SF Markus Elfring
2017-08-17 16:00     ` Julia Lawall
2017-08-17 16:11       ` SF Markus Elfring
     [not found]   ` <alpine.DEB.2.20.1708171818300.3748@hadrien>
2017-08-17 16:50     ` SF Markus Elfring
2017-08-18  8:00       ` SF Markus Elfring
2017-08-18  8:49         ` Julia Lawall
2017-08-18  9:15           ` SF 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=788ea49a-14c4-7dfe-d868-c8df90dd4439@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --cc=cocci@systeme.lip6.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.