Skip to content

Commit c2a052a

Browse files
fengidrimstsirkin
authored andcommitted
remoteproc: rename len of rpoc_vring to num
Rename the member len in the structure rpoc_vring to num. And remove 'in bytes' from the comment of it. This is misleading. Because this actually refers to the size of the virtio vring to be created. The unit is not bytes. Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com> Message-Id: <20220624025621.128843-2-xuanzhuo@linux.alibaba.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
1 parent 3d7cb6b commit c2a052a

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

drivers/remoteproc/remoteproc_core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ int rproc_alloc_vring(struct rproc_vdev *rvdev, int i)
334334
size_t size;
335335

336336
/* actual size of vring (in bytes) */
337-
size = PAGE_ALIGN(vring_size(rvring->len, rvring->align));
337+
size = PAGE_ALIGN(vring_size(rvring->num, rvring->align));
338338

339339
rsc = (void *)rproc->table_ptr + rvdev->rsc_offset;
340340

@@ -401,7 +401,7 @@ rproc_parse_vring(struct rproc_vdev *rvdev, struct fw_rsc_vdev *rsc, int i)
401401
return -EINVAL;
402402
}
403403

404-
rvring->len = vring->num;
404+
rvring->num = vring->num;
405405
rvring->align = vring->align;
406406
rvring->rvdev = rvdev;
407407

drivers/remoteproc/remoteproc_virtio.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ static struct virtqueue *rp_find_vq(struct virtio_device *vdev,
8787
struct fw_rsc_vdev *rsc;
8888
struct virtqueue *vq;
8989
void *addr;
90-
int len, size;
90+
int num, size;
9191

9292
/* we're temporarily limited to two virtqueues per rvdev */
9393
if (id >= ARRAY_SIZE(rvdev->vring))
@@ -104,20 +104,20 @@ static struct virtqueue *rp_find_vq(struct virtio_device *vdev,
104104

105105
rvring = &rvdev->vring[id];
106106
addr = mem->va;
107-
len = rvring->len;
107+
num = rvring->num;
108108

109109
/* zero vring */
110-
size = vring_size(len, rvring->align);
110+
size = vring_size(num, rvring->align);
111111
memset(addr, 0, size);
112112

113113
dev_dbg(dev, "vring%d: va %pK qsz %d notifyid %d\n",
114-
id, addr, len, rvring->notifyid);
114+
id, addr, num, rvring->notifyid);
115115

116116
/*
117117
* Create the new vq, and tell virtio we're not interested in
118118
* the 'weak' smp barriers, since we're talking with a real device.
119119
*/
120-
vq = vring_new_virtqueue(id, len, rvring->align, vdev, false, ctx,
120+
vq = vring_new_virtqueue(id, num, rvring->align, vdev, false, ctx,
121121
addr, rproc_virtio_notify, callback, name);
122122
if (!vq) {
123123
dev_err(dev, "vring_new_virtqueue %s failed\n", name);

include/linux/remoteproc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ struct rproc_subdev {
597597
/**
598598
* struct rproc_vring - remoteproc vring state
599599
* @va: virtual address
600-
* @len: length, in bytes
600+
* @num: vring size
601601
* @da: device address
602602
* @align: vring alignment
603603
* @notifyid: rproc-specific unique vring index
@@ -606,7 +606,7 @@ struct rproc_subdev {
606606
*/
607607
struct rproc_vring {
608608
void *va;
609-
int len;
609+
int num;
610610
u32 da;
611611
u32 align;
612612
int notifyid;

0 commit comments

Comments
 (0)