Commit graph

3 commits

Author SHA1 Message Date
Gerard Marull-Paretas a01d40f604 scripts: utils: migrate_sys_init: handle empty line after ARG_UNUSED
The script left empty lines below ARG_UNUSED. After this patch,

```c
static int f(const struct device *dev)
{
	ARG_UNUSED(dev);

	/* code */
	...
}
```

will become:

```c
static int f(void)
{
	/* code */
	...
}
```

instead of:

```c
static int f(void)
{

	/* code */
	...
}
```

Fixes #56954

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-04-25 19:57:00 +02:00
Gerard Marull-Paretas 2dbbfaec6b scripts: utils: migrate_sys_init: remove dead ZEPHYR_BASE
ZEPHYR_BASE is not used, so delete it.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-04-25 19:57:00 +02:00
Gerard Marull-Paretas 4355b7f179 scripts: utils: add sys_init migration script
Utility script to migrate SYS_INIT() calls from the old signature:

```c
int (*init_fn)(const struct device *dev)
```
to

```c
int (*init_fn)(void)
```

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-04-12 14:28:07 +00:00