[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [qemu-s390x] [PATCH v3 2/9] s390x/kvm: pass values instead of pointe
From: |
Cornelia Huck |
Subject: |
Re: [qemu-s390x] [PATCH v3 2/9] s390x/kvm: pass values instead of pointers to kvm_s390_set_clock_*() |
Date: |
Mon, 25 Jun 2018 17:50:29 +0200 |
On Mon, 25 Jun 2018 13:53:45 +0200
David Hildenbrand <address@hidden> wrote:
> We are going to factor out the TOD into a separate device and use const
> pointers for device class functions where possible. We are passing right
> now ordinary pointers that should never be touched when setting the TOD.
> Let's just pass the values directly.
>
> Signed-off-by: David Hildenbrand <address@hidden>
> ---
> target/s390x/cpu.c | 4 ++--
> target/s390x/kvm-stub.c | 4 ++--
> target/s390x/kvm.c | 12 ++++++------
> target/s390x/kvm_s390x.h | 4 ++--
> 4 files changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c
> index c268065887..68512e3e54 100644
> --- a/target/s390x/cpu.c
> +++ b/target/s390x/cpu.c
> @@ -413,9 +413,9 @@ int s390_set_clock(uint8_t *tod_high, uint64_t *tod_low)
Any reason why you keep the pointers here?
> int r = 0;
>
> if (kvm_enabled()) {
> - r = kvm_s390_set_clock_ext(tod_high, tod_low);
> + r = kvm_s390_set_clock_ext(*tod_high, *tod_low);
> if (r == -ENXIO) {
> - return kvm_s390_set_clock(tod_high, tod_low);
> + return kvm_s390_set_clock(*tod_high, *tod_low);
Especially as it would be more clean to check for !NULL before
dereferencing...
> }
> }
> /* Fixme TCG */
[qemu-s390x] [PATCH v3 4/9] s390x/tcg: drop tod_basetime, David Hildenbrand, 2018/06/25
[qemu-s390x] [PATCH v3 3/9] s390x/tod: factor out TOD into separate device, David Hildenbrand, 2018/06/25
[qemu-s390x] [PATCH v3 7/9] s390x/tcg: implement SET CLOCK, David Hildenbrand, 2018/06/25
[qemu-s390x] [PATCH v3 8/9] s390x/tcg: rearm the CKC timer during migration, David Hildenbrand, 2018/06/25
[qemu-s390x] [PATCH v3 6/9] s390x/tcg: SET CLOCK COMPARATOR can clear CKC interrupts, David Hildenbrand, 2018/06/25