Skip to content

Commit 28831ee

Browse files
committed
vhost: better variable name in logging
We really store a page offset in write_address, so rename it write_page to avoid confusion. Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
1 parent 3bf9be4 commit 28831ee

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎drivers/vhost/vhost.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -882,15 +882,15 @@ static int set_bit_to_user(int nr, void __user *addr)
882882
static int log_write(void __user *log_base,
883883
u64 write_address, u64 write_length)
884884
{
885+
u64 write_page = write_address / VHOST_PAGE_SIZE;
885886
int r;
886887
if (!write_length)
887888
return 0;
888889
write_length += write_address % VHOST_PAGE_SIZE;
889-
write_address /= VHOST_PAGE_SIZE;
890890
for (;;) {
891891
u64 base = (u64)(unsigned long)log_base;
892-
u64 log = base + write_address / 8;
893-
int bit = write_address % 8;
892+
u64 log = base + write_page / 8;
893+
int bit = write_page % 8;
894894
if ((u64)(unsigned long)log != log)
895895
return -EFAULT;
896896
r = set_bit_to_user(bit, (void __user *)(unsigned long)log);
@@ -899,7 +899,7 @@ static int log_write(void __user *log_base,
899899
if (write_length <= VHOST_PAGE_SIZE)
900900
break;
901901
write_length -= VHOST_PAGE_SIZE;
902-
write_address += 1;
902+
write_page += 1;
903903
}
904904
return r;
905905
}

0 commit comments

Comments
 (0)