From 2ec47b2b13e3ad33eb5c4f744e6b1ef1d4c04fb7 Mon Sep 17 00:00:00 2001 From: Pierre Peiffer Date: Thu, 26 Jan 2012 17:00:21 +0100 Subject: Ux500 CM: avoid ugly warning if kmalloc() fails In some cases, if the CM driver fails to allocate memory through kmalloc(), it falls back into vmalloc() which has better chance to succeed for big allocations. When this happens, kmalloc() reports its failure with an ugly warning on the console. Just avoid this warning in this case. ST-Ericsson ID: 413249 ST-Ericsson FOSS-OUT ID: Trivial ST-Ericsson Linux next: N/A Change-Id: I6c8a51eb430891727854b1800cf3a649dcb4b6e9 Signed-off-by: Pierre Peiffer Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/46815 Reviewed-by: QATOOLS --- drivers/staging/nmf-cm/osal-kernel.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/nmf-cm/osal-kernel.c b/drivers/staging/nmf-cm/osal-kernel.c index 0dc8328dfc0..c1d8640b11b 100644 --- a/drivers/staging/nmf-cm/osal-kernel.c +++ b/drivers/staging/nmf-cm/osal-kernel.c @@ -527,7 +527,7 @@ void* OSAL_Alloc(t_cm_size size) if (size == 0) return NULL; - entry = kmalloc(size + sizeof(*entry), GFP_KERNEL); + entry = kmalloc(size + sizeof(*entry), GFP_KERNEL | __GFP_NOWARN); if (entry == NULL) { entry = vmalloc(size + sizeof(*entry)); @@ -553,7 +553,7 @@ void* OSAL_Alloc(t_cm_size size) if (size == 0) return NULL; - mem = kmalloc(size, GFP_KERNEL); + mem = kmalloc(size, GFP_KERNEL | __GFP_NOWARN); if (mem == NULL) { mem = vmalloc(size); if (mem == NULL) @@ -576,7 +576,7 @@ void* OSAL_Alloc_Zero(t_cm_size size) if (size == 0) return NULL; - entry = kzalloc(size + sizeof(*entry), GFP_KERNEL); + entry = kzalloc(size + sizeof(*entry), GFP_KERNEL | __GFP_NOWARN); if (entry == NULL) { entry = vmalloc(size + sizeof(*entry)); if (entry == NULL) { @@ -603,7 +603,7 @@ void* OSAL_Alloc_Zero(t_cm_size size) if (size == 0) return NULL; - mem = kzalloc(size, GFP_KERNEL); + mem = kzalloc(size, GFP_KERNEL | __GFP_NOWARN); if (mem == NULL) { mem = vmalloc(size); if (mem == NULL) -- cgit v1.2.3