Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1474691

[PATCH 0/3] constify pinctrl_ops and pinmux_ops structures

From Julia Lawall <Julia.Lawall@lip6.fr>
Newsgroups linux.kernel
Subject [PATCH 0/3] constify pinctrl_ops and pinmux_ops structures
Date 2016-09-01 23:40 +0200
Message-ID <scHSi-7dg-3@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


Constify pinctrl_ops and pinmux_ops structures.  The complete semantic
patch used to make this change is as follows:

// <smpl>
@initialize:ocaml@
@@

let check file =
  let second = List.nth (Str.split (Str.regexp "linux-next/") file) 1 in
  let doto =
    "/var/julia/linux-next/" ^ (Filename.chop_extension second) ^ ".o" in
  Sys.file_exists doto

@r disable optional_qualifier@
identifier i;
position p;
@@

static struct pinctrl_ops i@p = { ... };

@script:ocaml@
p << r.p;
@@

if not (check (List.hd p).file) then Coccilib.include_match false

@ok@
identifier r.i;
struct pinctrl_desc e;
position p;
@@

e.pctlops = &i@p;

@bad@
position p != {r.p,ok.p};
identifier r.i;
struct pinctrl_ops e;
@@

e@i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@

static
+const
 struct pinctrl_ops i = { ... };

// --------------------------------------------------------------------

@r1 disable optional_qualifier@
identifier i;
position p;
@@

static struct pinmux_ops i@p = { ... };

@script:ocaml@
p << r1.p;
@@

if not (check (List.hd p).file) then Coccilib.include_match false

@ok1@
identifier r1.i;
struct pinctrl_desc e;
position p;
@@

e.pmxops = &i@p;

@bad1@
position p != {r1.p,ok1.p};
identifier r1.i;
struct pinmux_ops e;
@@

e@i@p

@depends on !bad1 disable optional_qualifier@
identifier r1.i;
@@

static
+const
 struct pinmux_ops i = { ... };
// </smpl>

---

 drivers/pinctrl/bcm/pinctrl-bcm281xx.c |    4 ++--
 drivers/pinctrl/bcm/pinctrl-ns2-mux.c  |    4 ++--
 drivers/pinctrl/bcm/pinctrl-nsp-mux.c  |    4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH 0/3] constify pinctrl_ops and pinmux_ops structures Julia Lawall <Julia.Lawall@lip6.fr> - 2016-09-01 23:40 +0200

csiph-web