[haiku-commits] Re: haiku: hrev44611 - src/system/kernel/vm

  • From: "Ingo Weinhold" <ingo_weinhold@xxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 04 Sep 2012 23:46:53 +0200

kallisti5@xxxxxxxxxxx wrote:
> Commit: 3d87b8120cea948d0d9f5e9264274fb181605545
> URL: http://cgit.haiku-os.org/haiku/commit/?id=3d87b81
> Author: Alexander von Gluck IV <kallisti5@xxxxxxxxxxx>
> Date: Tue Sep 4 13:42:36 2012 UTC
> 
> Kernel VM: Style cleanup; No functional change
> 
> ----------------------------------------------------------------------------
> 
> diff --git a/src/system/kernel/vm/VMAnonymousCache.cpp 
> b/src/system/kernel/vm/VMAnonymousCache.cpp
> index d9047df..eae0b54 100644
> --- a/src/system/kernel/vm/VMAnonymousCache.cpp
> +++ b/src/system/kernel/vm/VMAnonymousCache.cpp
[...]
> @@ -283,9 +283,10 @@ swap_slot_alloc(uint32 count)
>  
>   // if this swap file has used more than 90% percent of its space
>   // switch to another
> - if (sSwapFileAlloc->bmp->free_slots
> - < (sSwapFileAlloc->last_slot - sSwapFileAlloc->first_slot) / 10)
> + if (sSwapFileAlloc->bmp->free_slots
> + < (sSwapFileAlloc->last_slot - sSwapFileAlloc->first_slot) / 10) {
>   sSwapFileAlloc = sSwapFileList.GetNext(sSwapFileAlloc);
> + }

I would say it was actually more correct before.

[...]
> @@ -1067,9 +1069,9 @@ VMAnonymousCache::_MergeSwapPages(VMAnonymousCache* 
> source)
>   return;
>  
>   for (off_t offset = source->virtual_base
> - & ~(off_t)(B_PAGE_SIZE * SWAP_BLOCK_PAGES - 1);
> - offset < source->virtual_end;
> - offset += B_PAGE_SIZE * SWAP_BLOCK_PAGES) {
> + & ~(off_t)(B_PAGE_SIZE * SWAP_BLOCK_PAGES - 1);
> + offset < source->virtual_end;
> + offset += B_PAGE_SIZE * SWAP_BLOCK_PAGES) {

The first of the three lines shouldn't have the same indentation as the latter 
two.

[...]
> @@ -1352,8 +1354,9 @@ swap_init_post_modules()
>   size = string ? atoll(string) : 0;
>  
>   unload_driver_settings(settings);
> - } else
> + } else {
>   size = (off_t)vm_page_num_pages() * B_PAGE_SIZE * 2;
> + }

No reason for that.

CU, Ingo

Other related posts: