[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 1/2] memory: provide common macros for mtree_
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH v2 1/2] memory: provide common macros for mtree_print_mr() |
Date: |
Wed, 11 Jan 2017 18:21:46 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 |
On 21/12/2016 08:58, Peter Xu wrote:
> - mr->romd_mode ? 'R' : '-',
> - !mr->readonly && !(mr->rom_device && mr->romd_mode) ? 'W'
> - : '-',
> + MR_CHAR_RD(mr),
> + MR_CHAR_WR(mr),
An alternative definition could be
memory_access_is_direct(mr, false) ? 'R' : '-'
memory_access_is_direct(mr, true) ? 'W' : '-'
for MR_CHAR_RD and MR_CHAR_WR. With this change, I think the small code
duplication in the "? :" operator is tolerable and the code is clearer.
Paolo
- Re: [Qemu-devel] [PATCH v2 1/2] memory: provide common macros for mtree_print_mr(),
Paolo Bonzini <=