[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 7/8] vm/vm_resident.c (vm_page_print): remove unnecessary cas
From: |
Ivan Shmakov |
Subject: |
Re: [PATCH 7/8] vm/vm_resident.c (vm_page_print): remove unnecessary casts |
Date: |
Wed, 11 Dec 2013 18:12:33 +0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
>>>>> Marin Ramesa <mpr@hi.t-com.hr> writes:
> Members offset and phys_addr are of vm_offset_t types.
> * vm/vm_resident.c (vm_page_print) (offset, phys_addr): Remove
> unnecessary casts.
[…]
> iprintf("Page 0x%X: object 0x%X,", (vm_offset_t) p, (vm_offset_t)
> p->object);
> - printf(" offset 0x%X", (vm_offset_t) p->offset);
> + printf(" offset 0x%X", p->offset);
> printf("wire_count %d,", p->wire_count);
> printf(" %s",
> (p->active ? "active" : (p->inactive ? "inactive" : "loose")));
> @@ -1533,7 +1533,7 @@ void vm_page_print(p)
> printf("%s,",
> (p->tabled ? "" : "not_tabled"));
> printf("phys_addr = 0x%X, lock = 0x%X, unlock_request = 0x%X\n",
> - (vm_offset_t) p->phys_addr,
> + p->phys_addr,
> (vm_offset_t) p->page_lock,
Even though I’m unsure how vm_offset_t is defined (is it int? or
is it ptrdiff_t? ¹), I’d rather like to see casts to /int/ here,
as it’s what %X (usually – no idea about vm/*) implies.
¹ Please note that while int is 32 bits on both i386 and amd64,
the size of ptrdiff_t varies between the two.
[…]
--
FSF associate member #7257
- [PATCH 4/8] Quiet GCC warnings about set but unused variables, (continued)
[PATCH 3/8] Cleanup of the copyin() and copyout() calls, Marin Ramesa, 2013/12/11
[PATCH 5/8] include/mach/mach4.defs (memory_object_create_proxy): fix passing from incompatible pointer type, Marin Ramesa, 2013/12/11
[PATCH 6/8] vm/vm_kern.c (kmem_submap): remove unnecessary cast, Marin Ramesa, 2013/12/11
[PATCH 7/8] vm/vm_resident.c (vm_page_print): remove unnecessary casts, Marin Ramesa, 2013/12/11
- Re: [PATCH 7/8] vm/vm_resident.c (vm_page_print): remove unnecessary casts,
Ivan Shmakov <=
[PATCH 8/8] mig/server.c (WriteVarDecls): quiet GCC warning about set but unused variable, Marin Ramesa, 2013/12/11