aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/csr/csr_wifi_serialize_primitive_types.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-20 16:41:09 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-20 16:41:09 -0700
commit786eeeb3756e7fb08174c3a136c16462ccd541d1 (patch)
tree9b7621b4448768f8f950e80a1bba468652608f1c /drivers/staging/csr/csr_wifi_serialize_primitive_types.c
parentstaging: csr: remove CsrPmemFree() (diff)
downloadlinux-dev-786eeeb3756e7fb08174c3a136c16462ccd541d1.tar.xz
linux-dev-786eeeb3756e7fb08174c3a136c16462ccd541d1.zip
staging: csr: remove CsrPmemAlloc
It's just a wrapper around kmalloc(, GFP_KERNEL) + a call to panic() if we are out of memory, which is a very foolish thing to do (the panic that is.) So replace it with calls to kmalloc() and ignore the out-of-memory casese for now, odds are it will not be hit, and if it does, hey, we will end up panicing just the same as with the old code. Cc: Mikko Virkkilä <mikko.virkkila@bluegiga.com> Cc: Lauri Hintsala <Lauri.Hintsala@bluegiga.com> Cc: Riku Mettälä <riku.mettala@bluegiga.com> Cc: Veli-Pekka Peltola <veli-pekka.peltola@bluegiga.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/csr/csr_wifi_serialize_primitive_types.c')
-rw-r--r--drivers/staging/csr/csr_wifi_serialize_primitive_types.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/staging/csr/csr_wifi_serialize_primitive_types.c b/drivers/staging/csr/csr_wifi_serialize_primitive_types.c
index 661d32016136..23b0e5154a0c 100644
--- a/drivers/staging/csr/csr_wifi_serialize_primitive_types.c
+++ b/drivers/staging/csr/csr_wifi_serialize_primitive_types.c
@@ -9,6 +9,7 @@
*****************************************************************************/
#include <linux/module.h>
+#include <linux/slab.h>
#include "csr_pmem.h"
#include "csr_macro.h"
#include "csr_msgconv.h"
@@ -125,7 +126,7 @@ EXPORT_SYMBOL_GPL(CsrWifiEventSer);
void* CsrWifiEventDes(u8 *buffer, size_t length)
{
- CsrWifiFsmEvent *primitive = (CsrWifiFsmEvent *) CsrPmemAlloc(sizeof(CsrWifiFsmEvent));
+ CsrWifiFsmEvent *primitive = kmalloc(sizeof(CsrWifiFsmEvent), GFP_KERNEL);
size_t offset = 0;
CsrUint16Des(&primitive->type, buffer, &offset);
@@ -152,7 +153,7 @@ EXPORT_SYMBOL_GPL(CsrWifiEventCsrUint8Ser);
void* CsrWifiEventCsrUint8Des(u8 *buffer, size_t length)
{
- CsrWifiEventCsrUint8 *primitive = (CsrWifiEventCsrUint8 *) CsrPmemAlloc(sizeof(CsrWifiEventCsrUint8));
+ CsrWifiEventCsrUint8 *primitive = kmalloc(sizeof(CsrWifiEventCsrUint8), GFP_KERNEL);
size_t offset = 0;
CsrUint16Des(&primitive->common.type, buffer, &offset);
@@ -182,7 +183,7 @@ EXPORT_SYMBOL_GPL(CsrWifiEventCsrUint16Ser);
void* CsrWifiEventCsrUint16Des(u8 *buffer, size_t length)
{
- CsrWifiEventCsrUint16 *primitive = (CsrWifiEventCsrUint16 *) CsrPmemAlloc(sizeof(CsrWifiEventCsrUint16));
+ CsrWifiEventCsrUint16 *primitive = kmalloc(sizeof(CsrWifiEventCsrUint16), GFP_KERNEL);
size_t offset = 0;
CsrUint16Des(&primitive->common.type, buffer, &offset);
@@ -212,7 +213,7 @@ EXPORT_SYMBOL_GPL(CsrWifiEventCsrUint32Ser);
void* CsrWifiEventCsrUint32Des(u8 *buffer, size_t length)
{
- CsrWifiEventCsrUint32 *primitive = (CsrWifiEventCsrUint32 *) CsrPmemAlloc(sizeof(CsrWifiEventCsrUint32));
+ CsrWifiEventCsrUint32 *primitive = kmalloc(sizeof(CsrWifiEventCsrUint32), GFP_KERNEL);
size_t offset = 0;
CsrUint16Des(&primitive->common.type, buffer, &offset);
@@ -242,7 +243,7 @@ EXPORT_SYMBOL_GPL(CsrWifiEventCsrUint16CsrUint8Ser);
void* CsrWifiEventCsrUint16CsrUint8Des(u8 *buffer, size_t length)
{
- CsrWifiEventCsrUint16CsrUint8 *primitive = (CsrWifiEventCsrUint16CsrUint8 *) CsrPmemAlloc(sizeof(CsrWifiEventCsrUint16CsrUint8));
+ CsrWifiEventCsrUint16CsrUint8 *primitive = kmalloc(sizeof(CsrWifiEventCsrUint16CsrUint8), GFP_KERNEL);
size_t offset = 0;
CsrUint16Des(&primitive->common.type, buffer, &offset);