summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPatrick Williams <iawillia@us.ibm.com>2010-08-19 12:08:01 -0500
committerPatrick Williams <iawillia@us.ibm.com>2010-08-19 12:08:01 -0500
commit6dbab3072e8f50e25137fa53c7ffce0d111c2338 (patch)
treee28281185d0c4359e435bf0fbc2c4bd41b19c6b7 /src
parentfad284f4af86149a8bc78c61bb99f1a1e30e7b68 (diff)
downloadtalos-hostboot-6dbab3072e8f50e25137fa53c7ffce0d111c2338.tar.gz
talos-hostboot-6dbab3072e8f50e25137fa53c7ffce0d111c2338.zip
Enable -Wall and fix warnings.
Diffstat (limited to 'src')
-rw-r--r--src/include/kernel/console.H2
-rw-r--r--src/kernel/console.C3
-rw-r--r--src/kernel/cpumgr.C2
-rw-r--r--src/kernel/heapmgr.C4
-rw-r--r--src/kernel/pagemgr.C10
-rw-r--r--src/kernel/vmmmgr.C24
-rw-r--r--src/lib/string.c1
7 files changed, 24 insertions, 22 deletions
diff --git a/src/include/kernel/console.H b/src/include/kernel/console.H
index d54132ffb..31bb9c94a 100644
--- a/src/include/kernel/console.H
+++ b/src/include/kernel/console.H
@@ -18,8 +18,8 @@ class Console
~Console() {};
private:
+ size_t iv_pos;
char * iv_buffer;
- size_t iv_pos;
};
#endif
diff --git a/src/kernel/console.C b/src/kernel/console.C
index ec1110202..032d74213 100644
--- a/src/kernel/console.C
+++ b/src/kernel/console.C
@@ -19,6 +19,7 @@ int Console::putc(int c)
{
iv_buffer[__sync_fetch_and_add(&iv_pos, 1)] = c;
}
+ return c;
}
class ConsoleTraits
@@ -117,7 +118,7 @@ void printk(const char* str, ...)
Console& console = Singleton<Console>::instance();
bool format = false;
- int size;
+ int size = 0;
while('\0' != *str)
{
diff --git a/src/kernel/cpumgr.C b/src/kernel/cpumgr.C
index 58fabdd8c..bfb6b5af9 100644
--- a/src/kernel/cpumgr.C
+++ b/src/kernel/cpumgr.C
@@ -41,7 +41,7 @@ void CpuManager::startCPU(ssize_t i)
i = getCpuId();
currentCPU = true;
}
- else if (getCpuId() == i)
+ else if (getCpuId() == (uint64_t)i)
{
currentCPU = true;
}
diff --git a/src/kernel/heapmgr.C b/src/kernel/heapmgr.C
index b6e47140c..cac6999b5 100644
--- a/src/kernel/heapmgr.C
+++ b/src/kernel/heapmgr.C
@@ -22,8 +22,8 @@ void HeapManager::free(void* p)
void* HeapManager::_allocate(size_t n)
{
- int which_bucket = 0;
- while (n > ((1 << (which_bucket + 4)) - 8)) which_bucket++;
+ size_t which_bucket = 0;
+ while (n > (size_t)((1 << (which_bucket + 4)) - 8)) which_bucket++;
chunk_t* chunk = (chunk_t*)NULL;
chunk = pop_bucket(which_bucket);
diff --git a/src/kernel/pagemgr.C b/src/kernel/pagemgr.C
index a184ee23f..022b642b0 100644
--- a/src/kernel/pagemgr.C
+++ b/src/kernel/pagemgr.C
@@ -42,7 +42,7 @@ PageManager::PageManager()
size_t page_length = BUCKETS-1;
while(length > 0)
{
- while (length < (1 << page_length))
+ while (length < (size_t)(1 << page_length))
page_length--;
first_page[page_length].push(page);
@@ -55,8 +55,8 @@ PageManager::PageManager()
void* PageManager::_allocatePage(size_t n)
{
- int which_bucket = 0;
- while (n > (1 << which_bucket)) which_bucket++;
+ size_t which_bucket = 0;
+ while (n > (size_t)(1 << which_bucket)) which_bucket++;
int retries = 0;
page_t* page = (page_t*)NULL;
@@ -80,8 +80,8 @@ void PageManager::_freePage(void* p, size_t n)
{
if ((NULL == p) || (0 == n)) return;
- int which_bucket = 0;
- while (n > (1 << which_bucket)) which_bucket++;
+ size_t which_bucket = 0;
+ while (n > (size_t)(1 << which_bucket)) which_bucket++;
push_bucket((page_t*)p, which_bucket);
return;
diff --git a/src/kernel/vmmmgr.C b/src/kernel/vmmmgr.C
index 71fb33523..3aac6fed1 100644
--- a/src/kernel/vmmmgr.C
+++ b/src/kernel/vmmmgr.C
@@ -61,12 +61,12 @@ void VmmManager::initSLB()
void VmmManager::initPTEs()
{
// Invalidate all.
- for(int i = 0; i < PTEG_COUNT; i++)
- for (int j = 0; j < PTEG_SIZE; j++)
+ for(size_t i = 0; i < PTEG_COUNT; i++)
+ for (size_t j = 0; j < PTEG_SIZE; j++)
setValid(false, getPte(i,j));
// Set up linear map.
- for(int i = 0; i < (FULL_MEM_SIZE / PAGESIZE); i++)
+ for(size_t i = 0; i < (FULL_MEM_SIZE / PAGESIZE); i++)
{
ACCESS_TYPES access = NORMAL_ACCESS;
if (0 == i)
@@ -164,17 +164,17 @@ void* VmmManager::_mmioMap(void* ra, size_t pages)
uint64_t _ra = (uint64_t) ra;
// Search for memory already mapped in.
- for (int i = 0; i < MMIO_T_ENTRIES; i++)
+ for (size_t i = 0; i < MMIO_T_ENTRIES; i++)
{
- if ((mmioMapT[i] & ~(PAGESIZE - 1) == _ra))
+ if ((mmioMapT[i] & ~(PAGESIZE - 1)) == _ra)
{
if (i + pages < MMIO_T_ENTRIES)
{
bool matched = true;
- for (int j = 1; j < pages; j++)
+ for (size_t j = 1; j < pages; j++)
{
- if ((mmioMapT[i+j] & ~(PAGESIZE - 1) !=
- (_ra + (j*PAGESIZE))))
+ if ((mmioMapT[i+j] & ~(PAGESIZE - 1)) !=
+ (_ra + (j*PAGESIZE)))
{
matched = false;
break;
@@ -193,7 +193,7 @@ void* VmmManager::_mmioMap(void* ra, size_t pages)
if (-1 != match)
{
// Increment ref counts.
- for (int i = 0; i < pages; i++)
+ for (size_t i = 0; i < pages; i++)
{
mmioMapT[match + i]++;
}
@@ -203,12 +203,12 @@ void* VmmManager::_mmioMap(void* ra, size_t pages)
}
// Search for empty region in map.
- for (int i = 0; i < MMIO_T_ENTRIES; i++)
+ for (size_t i = 0; i < MMIO_T_ENTRIES; i++)
{
if (0 == mmioMapT[i])
{
bool matched = true;
- for (int j = 1; j < pages; j++)
+ for (size_t j = 1; j < pages; j++)
{
if (0 != mmioMapT[i+j])
{
@@ -227,7 +227,7 @@ void* VmmManager::_mmioMap(void* ra, size_t pages)
// Found region to use for map.
if (-1 != match)
{
- for (int i = 0; i < pages; i++)
+ for (size_t i = 0; i < pages; i++)
{
mmioMapT[match + i] = _ra + 1; // RA + ref count of 1.
}
diff --git a/src/lib/string.c b/src/lib/string.c
index eb8fe3d1c..c267c11d7 100644
--- a/src/lib/string.c
+++ b/src/lib/string.c
@@ -8,6 +8,7 @@ void* memset(void* s, int c, size_t n)
*_s = c;
_s++; n--;
}
+ return s;
}
char* strcpy(char* d, const char* s)
OpenPOWER on IntegriCloud