[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFH PATCH 1/2] xen: do not use __-named variables in m
From: |
Stefano Stabellini |
Subject: |
Re: [Qemu-devel] [RFH PATCH 1/2] xen: do not use __-named variables in mapcache |
Date: |
Wed, 14 Jan 2015 11:44:44 +0000 |
User-agent: |
Alpine 2.02 (DEB 1266 2009-07-14) |
On Wed, 14 Jan 2015, Paolo Bonzini wrote:
> Keep the namespace clean.
>
> Signed-off-by: Paolo Bonzini <address@hidden>
Acked-by: Stefano Stabellini <address@hidden>
> xen-mapcache.c | 40 ++++++++++++++++++++--------------------
> 1 file changed, 20 insertions(+), 20 deletions(-)
>
> diff --git a/xen-mapcache.c b/xen-mapcache.c
> index 66da1a6..458069b 100644
> --- a/xen-mapcache.c
> +++ b/xen-mapcache.c
> @@ -199,8 +199,8 @@ uint8_t *xen_map_cache(hwaddr phys_addr, hwaddr size,
> MapCacheEntry *entry, *pentry = NULL;
> hwaddr address_index;
> hwaddr address_offset;
> - hwaddr __size = size;
> - hwaddr __test_bit_size = size;
> + hwaddr cache_size = size;
> + hwaddr test_bit_size;
> bool translated = false;
>
> tryagain:
> @@ -209,22 +209,22 @@ tryagain:
>
> trace_xen_map_cache(phys_addr);
>
> - /* __test_bit_size is always a multiple of XC_PAGE_SIZE */
> + /* test_bit_size is always a multiple of XC_PAGE_SIZE */
> if (size) {
> - __test_bit_size = size + (phys_addr & (XC_PAGE_SIZE - 1));
> + test_bit_size = size + (phys_addr & (XC_PAGE_SIZE - 1));
>
> - if (__test_bit_size % XC_PAGE_SIZE) {
> - __test_bit_size += XC_PAGE_SIZE - (__test_bit_size %
> XC_PAGE_SIZE);
> + if (test_bit_size % XC_PAGE_SIZE) {
> + test_bit_size += XC_PAGE_SIZE - (test_bit_size % XC_PAGE_SIZE);
> }
> } else {
> - __test_bit_size = XC_PAGE_SIZE;
> + test_bit_size = XC_PAGE_SIZE;
> }
>
> if (mapcache->last_entry != NULL &&
> mapcache->last_entry->paddr_index == address_index &&
> - !lock && !__size &&
> + !lock && !size &&
> test_bits(address_offset >> XC_PAGE_SHIFT,
> - __test_bit_size >> XC_PAGE_SHIFT,
> + test_bit_size >> XC_PAGE_SHIFT,
> mapcache->last_entry->valid_mapping)) {
> trace_xen_map_cache_return(mapcache->last_entry->vaddr_base +
> address_offset);
> return mapcache->last_entry->vaddr_base + address_offset;
> @@ -232,20 +232,20 @@ tryagain:
>
> /* size is always a multiple of MCACHE_BUCKET_SIZE */
> if (size) {
> - __size = size + address_offset;
> - if (__size % MCACHE_BUCKET_SIZE) {
> - __size += MCACHE_BUCKET_SIZE - (__size % MCACHE_BUCKET_SIZE);
> + cache_size = size + address_offset;
> + if (cache_size % MCACHE_BUCKET_SIZE) {
> + cache_size += MCACHE_BUCKET_SIZE - (cache_size %
> MCACHE_BUCKET_SIZE);
> }
> } else {
> - __size = MCACHE_BUCKET_SIZE;
> + cache_size = MCACHE_BUCKET_SIZE;
> }
>
> entry = &mapcache->entry[address_index % mapcache->nr_buckets];
>
> while (entry && entry->lock && entry->vaddr_base &&
> - (entry->paddr_index != address_index || entry->size != __size ||
> + (entry->paddr_index != address_index || entry->size !=
> cache_size ||
> !test_bits(address_offset >> XC_PAGE_SHIFT,
> - __test_bit_size >> XC_PAGE_SHIFT,
> + test_bit_size >> XC_PAGE_SHIFT,
> entry->valid_mapping))) {
> pentry = entry;
> entry = entry->next;
> @@ -253,19 +253,19 @@ tryagain:
> if (!entry) {
> entry = g_malloc0(sizeof (MapCacheEntry));
> pentry->next = entry;
> - xen_remap_bucket(entry, __size, address_index);
> + xen_remap_bucket(entry, cache_size, address_index);
> } else if (!entry->lock) {
> if (!entry->vaddr_base || entry->paddr_index != address_index ||
> - entry->size != __size ||
> + entry->size != cache_size ||
> !test_bits(address_offset >> XC_PAGE_SHIFT,
> - __test_bit_size >> XC_PAGE_SHIFT,
> + test_bit_size >> XC_PAGE_SHIFT,
> entry->valid_mapping)) {
> - xen_remap_bucket(entry, __size, address_index);
> + xen_remap_bucket(entry, cache_size, address_index);
> }
> }
>
> if(!test_bits(address_offset >> XC_PAGE_SHIFT,
> - __test_bit_size >> XC_PAGE_SHIFT,
> + test_bit_size >> XC_PAGE_SHIFT,
> entry->valid_mapping)) {
> mapcache->last_entry = NULL;
> if (!translated && mapcache->phys_offset_to_gaddr) {
> --
> 1.8.3.1
>
>