bug-hurd
[Top][All Lists]
Advanced

[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



reply via email to

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