Skip to content

Commit 45bf79a

Browse files
xiaoxiang781216arnopo
authored andcommitted
apps: add const for remoteproc_ops and image_store_ops
follow up the change in lib Signed-off-by: Xiang Xiao <[email protected]>
1 parent 6f03c1e commit 45bf79a

File tree

15 files changed

+32
-32
lines changed

15 files changed

+32
-32
lines changed

apps/examples/load_fw/load_fw.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include <platform_info.h>
1111
#include <common.h>
1212

13-
extern struct image_store_ops mem_image_store_ops;
13+
extern const struct image_store_ops mem_image_store_ops;
1414

1515
struct mem_file {
1616
const void *base;
@@ -21,7 +21,7 @@ static struct mem_file image = {
2121
};
2222

2323
int load_exectuable_block(struct remoteproc *rproc,
24-
struct image_store_ops *store_ops, void *store,
24+
const struct image_store_ops *store_ops, void *store,
2525
const char *img_path)
2626
{
2727
int ret;
@@ -60,8 +60,8 @@ int load_exectuable_block(struct remoteproc *rproc,
6060

6161
#ifndef RPU_BOOT_LINUX
6262
int load_exectuable_noblock(struct remoteproc *rproc,
63-
struct image_store_ops *store_ops, void *store,
64-
const char *img_path)
63+
const struct image_store_ops *store_ops,
64+
void *store, const char *img_path)
6565
{
6666
int ret;
6767
const void *img_data;

apps/examples/load_fw/mem_image_store.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ int mem_image_load(void *store, size_t offset, size_t size,
7373
return (int)size;
7474
}
7575

76-
struct image_store_ops mem_image_store_ops = {
76+
const struct image_store_ops mem_image_store_ops = {
7777
.open = mem_image_open,
7878
.close = mem_image_close,
7979
.load = mem_image_load,

apps/examples/load_fw/platform_info.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,23 @@
88
#include <platform_info.h>
99
#include <common.h>
1010

11-
extern struct remoteproc_ops zynqmp_apu_rproc_ops;
12-
extern struct remoteproc_ops zynqmp_rpu_rproc_ops;
11+
extern const struct remoteproc_ops zynqmp_apu_rproc_ops;
12+
extern const struct remoteproc_ops zynqmp_rpu_rproc_ops;
1313

1414
static struct remoteproc rproc_inst;
15-
static struct remoteproc_ops ops;
1615

1716
static struct remoteproc * platform_create_proc(unsigned int cpu_id)
1817
{
18+
const struct remoteproc_ops *ops;
1919
struct remoteproc * rproc;
2020
if (NODE_RPU_0 <= LOAD_FW_TARGET && LOAD_FW_TARGET <= NODE_RPU_1)
21-
ops = zynqmp_rpu_rproc_ops;
21+
ops = &zynqmp_rpu_rproc_ops;
2222
else if (NODE_APU_0 <= LOAD_FW_TARGET && LOAD_FW_TARGET <= NODE_APU_1)
23-
ops = zynqmp_apu_rproc_ops;
23+
ops = &zynqmp_apu_rproc_ops;
2424
else
2525
return NULL;
2626

27-
rproc = remoteproc_init(&rproc_inst, &ops, &cpu_id);
27+
rproc = remoteproc_init(&rproc_inst, ops, &cpu_id);
2828
if (!rproc)
2929
return NULL;
3030
return &rproc_inst;

apps/examples/load_fw/zynqmp_apu_lcm_rproc_example.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include <common.h>
1111

1212
static struct remoteproc *apu_rproc_init(struct remoteproc *rproc,
13-
struct remoteproc_ops *ops, void *arg)
13+
const struct remoteproc_ops *ops, void *arg)
1414
{
1515
struct rproc_priv *priv;
1616
unsigned int cpu_id = *((unsigned int *)arg);
@@ -166,7 +166,7 @@ static int apu_rproc_shutdown(struct remoteproc *rproc)
166166
return 0;
167167
}
168168

169-
struct remoteproc_ops zynqmp_apu_rproc_ops = {
169+
const struct remoteproc_ops zynqmp_apu_rproc_ops = {
170170
.init = apu_rproc_init,
171171
.remove = apu_rproc_remove,
172172
.start = apu_rproc_start,

apps/examples/load_fw/zynqmp_r5_lcm_rproc_example.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ static void r5_rproc_mode_config(struct r5_rproc_priv *priv)
9797
}
9898

9999
struct remoteproc *r5_rproc_init(struct remoteproc *rproc,
100-
struct remoteproc_ops *ops, void *arg)
100+
const struct remoteproc_ops *ops, void *arg)
101101
{
102102
struct r5_rproc_priv *priv;
103103
unsigned int cpu_id = *((unsigned int *)arg);
@@ -303,7 +303,7 @@ int r5_rproc_shutdown(struct remoteproc *rproc)
303303
return 0;
304304
}
305305

306-
struct remoteproc_ops r5_rproc_ops = {
306+
const struct remoteproc_ops r5_rproc_ops = {
307307
.init = r5_rproc_init,
308308
.remove = r5_rproc_remove,
309309
.start = r5_rproc_start,

apps/examples/load_fw/zynqmp_rpu_lcm_rproc_example.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <common.h>
1010

1111
static struct remoteproc *rpu_rproc_init(struct remoteproc *rproc,
12-
struct remoteproc_ops *ops, void *arg)
12+
const struct remoteproc_ops *ops, void *arg)
1313
{
1414
struct rproc_priv *priv;
1515
unsigned int cpu_id = *((unsigned int *)arg);
@@ -193,7 +193,7 @@ static int rpu_rproc_shutdown(struct remoteproc *rproc)
193193
return 0;
194194
}
195195

196-
struct remoteproc_ops zynqmp_rpu_rproc_ops = {
196+
const struct remoteproc_ops zynqmp_rpu_rproc_ops = {
197197
.init = rpu_rproc_init,
198198
.remove = rpu_rproc_remove,
199199
.start = rpu_rproc_start,

apps/machine/microblaze_generic/platform_info.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ extern void cleanup_system(void);
4545
* processor operations from MicroBlaze to a53. It defines
4646
* notification operation and remote processor management operations.
4747
*/
48-
extern struct remoteproc_ops zynqmp_mb_a53_proc_ops;
48+
extern const struct remoteproc_ops zynqmp_mb_a53_proc_ops;
4949

5050
/* RPMsg virtio shared buffer pool */
5151
static struct rpmsg_virtio_shm_pool shpool;

apps/machine/microblaze_generic/zynqmp_mb_a53_rproc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
#include "platform_info.h"
3030

3131
static struct remoteproc *
32-
zynqmp_mb_a53_proc_init(struct remoteproc *rproc, struct remoteproc_ops *ops,
33-
void *arg)
32+
zynqmp_mb_a53_proc_init(struct remoteproc *rproc,
33+
const struct remoteproc_ops *ops, void *arg)
3434
{
3535
struct remoteproc_priv *prproc = arg;
3636

@@ -107,7 +107,7 @@ static int zynqmp_mb_a53_proc_notify(struct remoteproc *rproc, uint32_t id)
107107
* processor operations from mb to a53. It defines
108108
* notification operation and remote processor management operations.
109109
*/
110-
struct remoteproc_ops zynqmp_mb_a53_proc_ops = {
110+
const struct remoteproc_ops zynqmp_mb_a53_proc_ops = {
111111
.init = zynqmp_mb_a53_proc_init,
112112
.remove = zynqmp_mb_a53_proc_remove,
113113
.mmap = zynqmp_mb_a53_proc_mmap,

apps/machine/zynq7/platform_info.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444

4545
/* processor operations for hil_proc for A9. It defines
4646
* notification operation and remote processor management. */
47-
extern struct remoteproc_ops zynq_a9_proc_ops;
47+
extern const struct remoteproc_ops zynq_a9_proc_ops;
4848
static metal_phys_addr_t scugic_phys_addr = SCUGIC_DIST_BASE;
4949
struct metal_device scugic_device = {
5050
.name = SCUGIC_DEV_NAME,

apps/machine/zynq7/zynq_a9_rproc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ static int zynq_a9_proc_irq_handler(int vect_id, void *data)
4545

4646
static struct remoteproc *
4747
zynq_a9_proc_init(struct remoteproc *rproc,
48-
struct remoteproc_ops *ops, void *arg)
48+
const struct remoteproc_ops *ops, void *arg)
4949
{
5050
struct remoteproc_priv *prproc = arg;
5151
struct metal_device *dev;
@@ -157,7 +157,7 @@ static int zynq_a9_proc_notify(struct remoteproc *rproc, uint32_t id)
157157

158158
/* processor operations from r5 to a53. It defines
159159
* notification operation and remote processor managementi operations. */
160-
struct remoteproc_ops zynq_a9_proc_ops = {
160+
const struct remoteproc_ops zynq_a9_proc_ops = {
161161
.init = zynq_a9_proc_init,
162162
.remove = zynq_a9_proc_remove,
163163
.mmap = zynq_a9_proc_mmap,

0 commit comments

Comments
 (0)