qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 11/30] qcow2: Add l2_entry_size()


From: Eric Blake
Subject: Re: [PATCH v4 11/30] qcow2: Add l2_entry_size()
Date: Tue, 14 Apr 2020 11:01:42 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0

On 4/14/20 7:20 AM, Alberto Garcia wrote:

Hmm. How to avoid it? Maybe, at least, refactor the code, to drop all
sizeof(uint64_t), converting them to L2_ENTRY_SIZE, L1_ENTRY_SIZE,
REFTABLE_ENTRY_SIZE etc?

That wouldn't be a bad thing I guess but, again, for a separate patch or
series.

And all occurrences of pure '8' (not many of them exist)

I think most/all nowadays only refer to the number of bits per byte.

CHAR_BIT (from <limits.h>) is good for that.


Maybe there's a couple that still need to be fixed, but we have been
removing a lot of numeric literals from the qcow2 code (see for example
b6c246942b, 3afea40243 or a35f87f50d).

Berto


--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org




reply via email to

[Prev in Thread] Current Thread [Next in Thread]