[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 3/3] vm/vm_debug.c: quiet GCC warning about uninitialized variabl
From: |
Marin Ramesa |
Subject: |
[PATCH 3/3] vm/vm_debug.c: quiet GCC warning about uninitialized variable |
Date: |
Wed, 18 Dec 2013 09:17:49 +0100 |
The same situation as the previous patch.
* vm/vm_debug.c (host_virtual_physical_table_info) (size): Don't initialize to
zero.
(host_virtual_physical_table_info) (size): Move initialization before the break
statement.
---
vm/vm_debug.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/vm/vm_debug.c b/vm/vm_debug.c
index e4a4b8b..850547b 100644
--- a/vm/vm_debug.c
+++ b/vm/vm_debug.c
@@ -439,7 +439,7 @@ host_virtual_physical_table_info(host, infop, countp)
natural_t *countp;
{
vm_offset_t addr;
- vm_size_t size = 0;/* '=0' to quiet gcc warnings */
+ vm_size_t size;
hash_info_bucket_t *info;
unsigned int potential, actual;
kern_return_t kr;
@@ -454,6 +454,9 @@ host_virtual_physical_table_info(host, infop, countp)
for (;;) {
actual = vm_page_info(info, potential);
+
+ size = round_page(actual * sizeof *info);
+
if (actual <= potential)
break;
@@ -462,7 +465,6 @@ host_virtual_physical_table_info(host, infop, countp)
if (info != *infop)
kmem_free(ipc_kernel_map, addr, size);
- size = round_page(actual * sizeof *info);
kr = kmem_alloc_pageable(ipc_kernel_map, &addr, size);
if (kr != KERN_SUCCESS)
return KERN_RESOURCE_SHORTAGE;
--
1.8.1.4
- [PATCH 1/3] ipc: avoid dereference of null pointer and quiet the GCC warning about uninitialized variable, Marin Ramesa, 2013/12/18
- [PATCH 2/3] ipc/mach_debug.c (host_ipc_hash_info): quiet GCC warning about uninitialized variable, Marin Ramesa, 2013/12/18
- [PATCH 3/3] vm/vm_debug.c: quiet GCC warning about uninitialized variable,
Marin Ramesa <=
- Re: [PATCH 1/3] ipc: avoid dereference of null pointer and quiet the GCC warning about uninitialized variable, Anatoly A. Kazantsev, 2013/12/18
- Re: [PATCH 1/3] ipc: avoid dereference of null pointer and quiet the GCC warning about uninitialized variable, Marin Ramesa, 2013/12/18
- Re: [PATCH 1/3] ipc: avoid dereference of null pointer and quiet the GCC warning about uninitialized variable, Richard Braun, 2013/12/18
- Re: [PATCH 1/3] ipc: avoid dereference of null pointer and quiet the GCC warning about uninitialized variable, Richard Braun, 2013/12/18
- Re: [PATCH 1/3] ipc: avoid dereference of null pointer and quiet the GCC warning about uninitialized variable, Marin Ramesa, 2013/12/18
- Re: [PATCH 1/3] ipc: avoid dereference of null pointer and quiet the GCC warning about uninitialized variable, Marin Ramesa, 2013/12/18
- Re: [PATCH 1/3] ipc: avoid dereference of null pointer and quiet the GCC warning about uninitialized variable, Richard Braun, 2013/12/18
- Re: [PATCH 1/3] ipc: avoid dereference of null pointer and quiet the GCC warning about uninitialized variable, Marin Ramesa, 2013/12/18
- Re: [PATCH 1/3] ipc: avoid dereference of null pointer and quiet the GCC warning about uninitialized variable, Richard Braun, 2013/12/18