linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] add __init attribute
@ 2016-04-18 14:55 Julia Lawall
  2016-04-18 14:55 ` [PATCH 1/5] clk: qoriq: " Julia Lawall
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Julia Lawall @ 2016-04-18 14:55 UTC (permalink / raw)
  To: netdev
  Cc: kernel-janitors, linux-kernel, linux-clk, linux-arm-kernel,
	linux-mediatek, linux-ide, Josh Triplett, Luis R . Rodriguez

Add __init attribute on a function that is only called from other __init
functions and that is not inlined.

The complete semantic patch used to detect the need for this change is
below (http://coccinelle.lip6.fr/).  This semantic patch checks for local
static non-init functions that are called from an __init function and are
not called from any other function.

<smpl>
@initialize:ocaml@
@@

let itbl = Hashtbl.create 101
let ltbl = Hashtbl.create 101
let thefile = ref ""

let hashadd t k =
  let cell =
    try Hashtbl.find t k
    with Not_found ->
      let cell = ref 0 in
      Hashtbl.add t k cell;
      cell in
  cell := !cell + 1

let hashget t k = try !(Hashtbl.find t k) with Not_found -> 0

let seen  = ref []

@script:ocaml@
@@

(let file = List.hd (Coccilib.files()) in
thefile := file;
let file =
    try List.hd(List.tl (Str.split (Str.regexp "/linux-next/") file))
    with _ -> file in
let ofile = "/var/julia/linux-next/" ^
      (Filename.chop_extension file) ^ ".o" in
if not(Sys.file_exists ofile)
then Coccilib.exit());

Hashtbl.clear itbl;
Hashtbl.clear ltbl;
seen := []

@r@
identifier f;
@@

__init f(...) { ... }

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

Hashtbl.add itbl f ()

@s disable optional_attributes@
identifier f;
@@

static f(...) { ... }

@script:ocaml@
f << s.f;
@@

Hashtbl.add ltbl f ()

@t exists@
identifier f,g;
position p;
@@

__init f(...) { ... when any
   g@p(...)
   ... when any
 }

@script:ocaml@
g << t.g;
_p << t.p;
@@

if not (Hashtbl.mem ltbl g) || Hashtbl.mem itbl g
then Coccilib.include_match false

@ok1 disable optional_attributes exists@
identifier f,t.g;
@@

f(...) { ... when any
   g
   ... when any
 }

@ok2 disable optional_attributes exists@
identifier i,j,fld,t.g;
@@

struct i j = { .fld = g, };

@ok3 disable optional_attributes exists@
identifier t.g;
declarer d;
@@

d(...,g,...);

@ok4 disable optional_attributes exists@
identifier t.g;
expression e;
@@

(
e(...,g,...)
|
e(...,&g,...)
|
e = &g
|
e = g
)

@script:ocaml depends on !ok1 && !ok2 && !ok3 && !ok4@
g << t.g;
@@

let file = !thefile in
let file =
    try List.hd(List.tl (Str.split (Str.regexp "/linux-next/") file))
    with _ -> file in
if not(List.mem (g,file) !seen)
then
  begin
    seen := (g,file) :: !seen;
    let ofile = "/var/julia/linux-next/" ^
      (Filename.chop_extension file) ^ ".o" in
    if Sys.file_exists ofile
    then
      let l =
	Common.cmd_to_list
	  (Printf.sprintf
	     "objdump -x %s | grep -w %s | grep -w F | grep .text.unlikely"
	     ofile g) in
      match l with
	[] -> Coccilib.include_match false
      | _ ->
	  Printf.printf "Info for %s %s\n" file g;
	  List.iter
	    (function l -> Printf.printf "%s\n" l)
	    l;
	  Printf.printf "\n"; flush stdout
    else Coccilib.include_match false
  end
else Coccilib.include_match false

@depends on !ok1 && !ok2 && !ok3 && !ok4@
identifier t.g;
@@

- g
+__init g
 (...) { ... }
</smpl>

---

 drivers/clk/clk-qoriq.c         |    3 ++-
 drivers/clocksource/mtk_timer.c |    2 +-
 drivers/ide/cmd640.c            |    2 +-
 drivers/net/arcnet/com90xx.c    |    2 +-
 drivers/tty/rocket.c            |    3 ++-
 5 files changed, 7 insertions(+), 5 deletions(-)

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/5] clk: qoriq: add __init attribute
  2016-04-18 14:55 [PATCH 0/5] add __init attribute Julia Lawall
@ 2016-04-18 14:55 ` Julia Lawall
  2016-04-18 18:53   ` Stephen Boyd
  2016-04-18 14:55 ` [PATCH 2/5] arcnet: com90xx: " Julia Lawall
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 12+ messages in thread
From: Julia Lawall @ 2016-04-18 14:55 UTC (permalink / raw)
  To: Michael Turquette
  Cc: kernel-janitors, Stephen Boyd, linux-clk, linux-kernel,
	Luis R . Rodriguez, Josh Triplett

Add __init attribute on a function that is only called from other __init
functions and that is not inlined, at least with gcc version 4.8.4 on an
x86 machine with allyesconfig.  Currently, the function is put in the
.text.unlikely segment.  Declaring it as __init will cause it to be put in
the .init.text and to disappear after initialization.

The result of objdump -x on the function before the change is as follows:

0000000000000000 l     F .text.unlikely 0000000000000071 sysclk_from_fixed.constprop.5

And after the change it is as follows:

0000000000000480 l     F .init.text	000000000000006c sysclk_from_fixed.constprop.5

Done with the help of Coccinelle.  The semantic patch checks for local
static non-init functions that are called from an __init function and are
not called from any other function.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/clk/clk-qoriq.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/clk-qoriq.c b/drivers/clk/clk-qoriq.c
index 7bc1c45..5c11b58 100644
--- a/drivers/clk/clk-qoriq.c
+++ b/drivers/clk/clk-qoriq.c
@@ -869,7 +869,8 @@ static void __init core_mux_init(struct device_node *np)
 	}
 }
 
-static struct clk *sysclk_from_fixed(struct device_node *node, const char *name)
+static struct clk __init
+*sysclk_from_fixed(struct device_node *node, const char *name)
 {
 	u32 rate;
 

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/5] arcnet: com90xx: add __init attribute
  2016-04-18 14:55 [PATCH 0/5] add __init attribute Julia Lawall
  2016-04-18 14:55 ` [PATCH 1/5] clk: qoriq: " Julia Lawall
@ 2016-04-18 14:55 ` Julia Lawall
  2016-04-19  6:56   ` Michael Grzeschik
  2016-04-20  0:18   ` David Miller
  2016-04-18 14:55 ` [PATCH 3/5] clocksource/drivers/mtk_timer: " Julia Lawall
                   ` (2 subsequent siblings)
  4 siblings, 2 replies; 12+ messages in thread
From: Julia Lawall @ 2016-04-18 14:55 UTC (permalink / raw)
  To: Michael Grzeschik
  Cc: kernel-janitors, netdev, linux-kernel, Luis R . Rodriguez, Josh Triplett

Add __init attribute on a function that is only called from other __init
functions and that is not inlined, at least with gcc version 4.8.4 on an
x86 machine with allyesconfig.  Currently, the function is put in the
.text.unlikely segment.  Declaring it as __init will cause it to be put in
the .init.text and to disappear after initialization.

The result of objdump -x on the function before the change is as follows:

0000000000000000 l     F .text.unlikely 00000000000000bf check_mirror

And after the change it is as follows:

0000000000000000 l     F .init.text	00000000000000ba check_mirror

Done with the help of Coccinelle.  The semantic patch checks for local
static non-init functions that are called from an __init function and are
not called from any other function.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/net/arcnet/com90xx.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/arcnet/com90xx.c b/drivers/net/arcnet/com90xx.c
index 0d9b45f..81f90c4 100644
--- a/drivers/net/arcnet/com90xx.c
+++ b/drivers/net/arcnet/com90xx.c
@@ -433,7 +433,7 @@ static void __init com90xx_probe(void)
 	kfree(iomem);
 }
 
-static int check_mirror(unsigned long addr, size_t size)
+static int __init check_mirror(unsigned long addr, size_t size)
 {
 	void __iomem *p;
 	int res = -1;

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 3/5] clocksource/drivers/mtk_timer: add __init attribute
  2016-04-18 14:55 [PATCH 0/5] add __init attribute Julia Lawall
  2016-04-18 14:55 ` [PATCH 1/5] clk: qoriq: " Julia Lawall
  2016-04-18 14:55 ` [PATCH 2/5] arcnet: com90xx: " Julia Lawall
@ 2016-04-18 14:55 ` Julia Lawall
  2016-04-18 15:51   ` Matthias Brugger
  2016-04-18 16:44   ` Daniel Lezcano
  2016-04-18 14:55 ` [PATCH 4/5] TTY: " Julia Lawall
  2016-04-18 14:55 ` [PATCH 5/5] cmd640: " Julia Lawall
  4 siblings, 2 replies; 12+ messages in thread
From: Julia Lawall @ 2016-04-18 14:55 UTC (permalink / raw)
  To: Daniel Lezcano
  Cc: kernel-janitors, Thomas Gleixner, Matthias Brugger, linux-kernel,
	linux-arm-kernel, linux-mediatek, Luis R . Rodriguez,
	Josh Triplett

Add __init attribute on a function that is only called from other __init
functions and that is not inlined, at least with gcc version 4.8.4 on an
x86 machine with allyesconfig.  Currently, the function is put in the
.text.unlikely segment.  Declaring it as __init will cause it to be put in
the .init.text and to disappear after initialization.

The result of objdump -x on the function before the change is as follows:

0000000000000000 l     F .text.unlikely 000000000000006f mtk_timer_setup.isra.4

And after the change it is as follows:

0000000000000000 l     F .init.text	000000000000006a mtk_timer_setup.isra.4

Done with the help of Coccinelle.  The semantic patch checks for local
static non-init functions that are called from an __init function and are
not called from any other function.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/clocksource/mtk_timer.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clocksource/mtk_timer.c b/drivers/clocksource/mtk_timer.c
index d67bc35..7e583f8 100644
--- a/drivers/clocksource/mtk_timer.c
+++ b/drivers/clocksource/mtk_timer.c
@@ -152,7 +152,7 @@ static irqreturn_t mtk_timer_interrupt(int irq, void *dev_id)
 }
 
 static void
-mtk_timer_setup(struct mtk_clock_event_device *evt, u8 timer, u8 option)
+__init mtk_timer_setup(struct mtk_clock_event_device *evt, u8 timer, u8 option)
 {
 	writel(TIMER_CTRL_CLEAR | TIMER_CTRL_DISABLE,
 		evt->gpt_base + TIMER_CTRL_REG(timer));

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 4/5] TTY: add __init attribute
  2016-04-18 14:55 [PATCH 0/5] add __init attribute Julia Lawall
                   ` (2 preceding siblings ...)
  2016-04-18 14:55 ` [PATCH 3/5] clocksource/drivers/mtk_timer: " Julia Lawall
@ 2016-04-18 14:55 ` Julia Lawall
  2016-04-18 14:55 ` [PATCH 5/5] cmd640: " Julia Lawall
  4 siblings, 0 replies; 12+ messages in thread
From: Julia Lawall @ 2016-04-18 14:55 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: kernel-janitors, Jiri Slaby, linux-kernel, Luis R . Rodriguez,
	Josh Triplett

Add __init attribute on a function that is only called from other __init
functions and that is not inlined, at least with gcc version 4.8.4 on an
x86 machine with allyesconfig.  Currently, the function is put in the
.text.unlikely segment.  Declaring it as __init will cause it to be put in
the .init.text and to disappear after initialization.

The result of objdump -x on the function before the change is as follows:

000000000000014c l     F .text.unlikely 0000000000000a2e init_r_port

And after the change it is as follows:

0000000000000000 l     F .init.text	0000000000000a29 init_r_port

Done with the help of Coccinelle.  The semantic patch checks for local
static non-init functions that are called from an __init function and are
not called from any other function.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/tty/rocket.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/rocket.c b/drivers/tty/rocket.c
index 0b802cd..e979f2f 100644
--- a/drivers/tty/rocket.c
+++ b/drivers/tty/rocket.c
@@ -615,7 +615,8 @@ static void rp_do_poll(unsigned long dummy)
  *  the board.  
  *  Inputs:  board, aiop, chan numbers
  */
-static void init_r_port(int board, int aiop, int chan, struct pci_dev *pci_dev)
+static void __init
+init_r_port(int board, int aiop, int chan, struct pci_dev *pci_dev)
 {
 	unsigned rocketMode;
 	struct r_port *info;

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 5/5] cmd640: add __init attribute
  2016-04-18 14:55 [PATCH 0/5] add __init attribute Julia Lawall
                   ` (3 preceding siblings ...)
  2016-04-18 14:55 ` [PATCH 4/5] TTY: " Julia Lawall
@ 2016-04-18 14:55 ` Julia Lawall
  2016-07-26 22:26   ` David Miller
  4 siblings, 1 reply; 12+ messages in thread
From: Julia Lawall @ 2016-04-18 14:55 UTC (permalink / raw)
  To: David S. Miller
  Cc: kernel-janitors, linux-ide, linux-kernel, Luis R . Rodriguez,
	Josh Triplett

Add __init attribute on a function that is only called from other __init
functions and that is not inlined, at least with gcc version 4.8.4 on an
x86 machine with allyesconfig.  Currently, the function is put in the
.text.unlikely segment.  Declaring it as __init will cause it to be put in
the .init.text and to disappear after initialization.

The result of objdump -x on the function before the change is as follows:

0000000000000000 l     F .text.unlikely 00000000000000e4 cmd640x_init_one

And after the change it is as follows:

00000000000000d2 l     F .init.text	00000000000000df cmd640x_init_one

Done with the help of Coccinelle.  The semantic patch checks for local
static non-init functions that are called from an __init function and are
not called from any other function.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/ide/cmd640.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ide/cmd640.c b/drivers/ide/cmd640.c
index 70f0a27..004243b 100644
--- a/drivers/ide/cmd640.c
+++ b/drivers/ide/cmd640.c
@@ -695,7 +695,7 @@ static const struct ide_port_info cmd640_port_info __initconst = {
 	.pio_mask		= ATA_PIO5,
 };
 
-static int cmd640x_init_one(unsigned long base, unsigned long ctl)
+static int __init cmd640x_init_one(unsigned long base, unsigned long ctl)
 {
 	if (!request_region(base, 8, DRV_NAME)) {
 		printk(KERN_ERR "%s: I/O resource 0x%lX-0x%lX not free.\n",

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 3/5] clocksource/drivers/mtk_timer: add __init attribute
  2016-04-18 14:55 ` [PATCH 3/5] clocksource/drivers/mtk_timer: " Julia Lawall
@ 2016-04-18 15:51   ` Matthias Brugger
  2016-04-18 16:44   ` Daniel Lezcano
  1 sibling, 0 replies; 12+ messages in thread
From: Matthias Brugger @ 2016-04-18 15:51 UTC (permalink / raw)
  To: Julia Lawall, Daniel Lezcano
  Cc: kernel-janitors, Thomas Gleixner, linux-kernel, linux-arm-kernel,
	linux-mediatek, Luis R . Rodriguez, Josh Triplett



On 18/04/16 16:55, Julia Lawall wrote:
> Add __init attribute on a function that is only called from other __init
> functions and that is not inlined, at least with gcc version 4.8.4 on an
> x86 machine with allyesconfig.  Currently, the function is put in the
> .text.unlikely segment.  Declaring it as __init will cause it to be put in
> the .init.text and to disappear after initialization.
>
> The result of objdump -x on the function before the change is as follows:
>
> 0000000000000000 l     F .text.unlikely 000000000000006f mtk_timer_setup.isra.4
>
> And after the change it is as follows:
>
> 0000000000000000 l     F .init.text	000000000000006a mtk_timer_setup.isra.4
>
> Done with the help of Coccinelle.  The semantic patch checks for local
> static non-init functions that are called from an __init function and are
> not called from any other function.
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
>

Acked-by: Matthias Brugger <matthias.bgg@gmail.com>

> ---
>   drivers/clocksource/mtk_timer.c |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/clocksource/mtk_timer.c b/drivers/clocksource/mtk_timer.c
> index d67bc35..7e583f8 100644
> --- a/drivers/clocksource/mtk_timer.c
> +++ b/drivers/clocksource/mtk_timer.c
> @@ -152,7 +152,7 @@ static irqreturn_t mtk_timer_interrupt(int irq, void *dev_id)
>   }
>
>   static void
> -mtk_timer_setup(struct mtk_clock_event_device *evt, u8 timer, u8 option)
> +__init mtk_timer_setup(struct mtk_clock_event_device *evt, u8 timer, u8 option)
>   {
>   	writel(TIMER_CTRL_CLEAR | TIMER_CTRL_DISABLE,
>   		evt->gpt_base + TIMER_CTRL_REG(timer));
>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 3/5] clocksource/drivers/mtk_timer: add __init attribute
  2016-04-18 14:55 ` [PATCH 3/5] clocksource/drivers/mtk_timer: " Julia Lawall
  2016-04-18 15:51   ` Matthias Brugger
@ 2016-04-18 16:44   ` Daniel Lezcano
  1 sibling, 0 replies; 12+ messages in thread
From: Daniel Lezcano @ 2016-04-18 16:44 UTC (permalink / raw)
  To: Julia Lawall
  Cc: kernel-janitors, Thomas Gleixner, Matthias Brugger, linux-kernel,
	linux-arm-kernel, linux-mediatek, Luis R . Rodriguez,
	Josh Triplett

On Mon, Apr 18, 2016 at 04:55:36PM +0200, Julia Lawall wrote:
> Add __init attribute on a function that is only called from other __init
> functions and that is not inlined, at least with gcc version 4.8.4 on an
> x86 machine with allyesconfig.  Currently, the function is put in the
> .text.unlikely segment.  Declaring it as __init will cause it to be put in
> the .init.text and to disappear after initialization.
> 
> The result of objdump -x on the function before the change is as follows:
> 
> 0000000000000000 l     F .text.unlikely 000000000000006f mtk_timer_setup.isra.4
> 
> And after the change it is as follows:
> 
> 0000000000000000 l     F .init.text	000000000000006a mtk_timer_setup.isra.4
> 
> Done with the help of Coccinelle.  The semantic patch checks for local
> static non-init functions that are called from an __init function and are
> not called from any other function.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> ---

Applied for 4.7.

Thanks !

  -- Daniel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/5] clk: qoriq: add __init attribute
  2016-04-18 14:55 ` [PATCH 1/5] clk: qoriq: " Julia Lawall
@ 2016-04-18 18:53   ` Stephen Boyd
  0 siblings, 0 replies; 12+ messages in thread
From: Stephen Boyd @ 2016-04-18 18:53 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Michael Turquette, kernel-janitors, linux-clk, linux-kernel,
	Luis R . Rodriguez, Josh Triplett

On 04/18, Julia Lawall wrote:
> Add __init attribute on a function that is only called from other __init
> functions and that is not inlined, at least with gcc version 4.8.4 on an
> x86 machine with allyesconfig.  Currently, the function is put in the
> .text.unlikely segment.  Declaring it as __init will cause it to be put in
> the .init.text and to disappear after initialization.
> 
> The result of objdump -x on the function before the change is as follows:
> 
> 0000000000000000 l     F .text.unlikely 0000000000000071 sysclk_from_fixed.constprop.5
> 
> And after the change it is as follows:
> 
> 0000000000000480 l     F .init.text	000000000000006c sysclk_from_fixed.constprop.5
> 
> Done with the help of Coccinelle.  The semantic patch checks for local
> static non-init functions that are called from an __init function and are
> not called from any other function.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---

Applied to clk-next

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/5] arcnet: com90xx: add __init attribute
  2016-04-18 14:55 ` [PATCH 2/5] arcnet: com90xx: " Julia Lawall
@ 2016-04-19  6:56   ` Michael Grzeschik
  2016-04-20  0:18   ` David Miller
  1 sibling, 0 replies; 12+ messages in thread
From: Michael Grzeschik @ 2016-04-19  6:56 UTC (permalink / raw)
  To: Julia Lawall
  Cc: kernel-janitors, netdev, linux-kernel, Luis R . Rodriguez, Josh Triplett

On Mon, Apr 18, 2016 at 04:55:35PM +0200, Julia Lawall wrote:
> Add __init attribute on a function that is only called from other __init
> functions and that is not inlined, at least with gcc version 4.8.4 on an
> x86 machine with allyesconfig.  Currently, the function is put in the
> .text.unlikely segment.  Declaring it as __init will cause it to be put in
> the .init.text and to disappear after initialization.
> 
> The result of objdump -x on the function before the change is as follows:
> 
> 0000000000000000 l     F .text.unlikely 00000000000000bf check_mirror
> 
> And after the change it is as follows:
> 
> 0000000000000000 l     F .init.text	00000000000000ba check_mirror
> 
> Done with the help of Coccinelle.  The semantic patch checks for local
> static non-init functions that are called from an __init function and are
> not called from any other function.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 

Acked-by: Michael Grzeschik <mgr@pengutronix.de>

> ---
>  drivers/net/arcnet/com90xx.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/arcnet/com90xx.c b/drivers/net/arcnet/com90xx.c
> index 0d9b45f..81f90c4 100644
> --- a/drivers/net/arcnet/com90xx.c
> +++ b/drivers/net/arcnet/com90xx.c
> @@ -433,7 +433,7 @@ static void __init com90xx_probe(void)
>  	kfree(iomem);
>  }
>  
> -static int check_mirror(unsigned long addr, size_t size)
> +static int __init check_mirror(unsigned long addr, size_t size)
>  {
>  	void __iomem *p;
>  	int res = -1;
> 
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/5] arcnet: com90xx: add __init attribute
  2016-04-18 14:55 ` [PATCH 2/5] arcnet: com90xx: " Julia Lawall
  2016-04-19  6:56   ` Michael Grzeschik
@ 2016-04-20  0:18   ` David Miller
  1 sibling, 0 replies; 12+ messages in thread
From: David Miller @ 2016-04-20  0:18 UTC (permalink / raw)
  To: Julia.Lawall
  Cc: m.grzeschik, kernel-janitors, netdev, linux-kernel, mcgrof, josh

From: Julia Lawall <Julia.Lawall@lip6.fr>
Date: Mon, 18 Apr 2016 16:55:35 +0200

> Add __init attribute on a function that is only called from other __init
> functions and that is not inlined, at least with gcc version 4.8.4 on an
> x86 machine with allyesconfig.  Currently, the function is put in the
> .text.unlikely segment.  Declaring it as __init will cause it to be put in
> the .init.text and to disappear after initialization.
> 
> The result of objdump -x on the function before the change is as follows:
> 
> 0000000000000000 l     F .text.unlikely 00000000000000bf check_mirror
> 
> And after the change it is as follows:
> 
> 0000000000000000 l     F .init.text	00000000000000ba check_mirror
> 
> Done with the help of Coccinelle.  The semantic patch checks for local
> static non-init functions that are called from an __init function and are
> not called from any other function.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Applied to net-next, thanks.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 5/5] cmd640: add __init attribute
  2016-04-18 14:55 ` [PATCH 5/5] cmd640: " Julia Lawall
@ 2016-07-26 22:26   ` David Miller
  0 siblings, 0 replies; 12+ messages in thread
From: David Miller @ 2016-07-26 22:26 UTC (permalink / raw)
  To: Julia.Lawall; +Cc: kernel-janitors, linux-ide, linux-kernel, mcgrof, josh

From: Julia Lawall <Julia.Lawall@lip6.fr>
Date: Mon, 18 Apr 2016 16:55:38 +0200

> Add __init attribute on a function that is only called from other __init
> functions and that is not inlined, at least with gcc version 4.8.4 on an
> x86 machine with allyesconfig.  Currently, the function is put in the
> .text.unlikely segment.  Declaring it as __init will cause it to be put in
> the .init.text and to disappear after initialization.
> 
> The result of objdump -x on the function before the change is as follows:
> 
> 0000000000000000 l     F .text.unlikely 00000000000000e4 cmd640x_init_one
> 
> And after the change it is as follows:
> 
> 00000000000000d2 l     F .init.text	00000000000000df cmd640x_init_one
> 
> Done with the help of Coccinelle.  The semantic patch checks for local
> static non-init functions that are called from an __init function and are
> not called from any other function.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Applied.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2016-07-26 22:26 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-18 14:55 [PATCH 0/5] add __init attribute Julia Lawall
2016-04-18 14:55 ` [PATCH 1/5] clk: qoriq: " Julia Lawall
2016-04-18 18:53   ` Stephen Boyd
2016-04-18 14:55 ` [PATCH 2/5] arcnet: com90xx: " Julia Lawall
2016-04-19  6:56   ` Michael Grzeschik
2016-04-20  0:18   ` David Miller
2016-04-18 14:55 ` [PATCH 3/5] clocksource/drivers/mtk_timer: " Julia Lawall
2016-04-18 15:51   ` Matthias Brugger
2016-04-18 16:44   ` Daniel Lezcano
2016-04-18 14:55 ` [PATCH 4/5] TTY: " Julia Lawall
2016-04-18 14:55 ` [PATCH 5/5] cmd640: " Julia Lawall
2016-07-26 22:26   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).