Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 35628c4a authored by Joe Perches's avatar Joe Perches Committed by Greg Kroah-Hartman
Browse files

staging: rtl8723bs: convert private allocation functions to return void *



Using char * for a return from allocation functions means the
code has to cast generic allocations to specific types.

Allow the compiler to not need casts on the allocations.

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 67af9094
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -96,8 +96,8 @@ typedef enum mstat_status{

#define rtw_mstat_update(flag, status, sz) do {} while (0)
#define rtw_mstat_dump(sel) do {} while (0)
u8*_rtw_zmalloc(u32 sz);
u8*_rtw_malloc(u32 sz);
void *_rtw_zmalloc(u32 sz);
void *_rtw_malloc(u32 sz);
void _kfree(u8 *pbuf, u32 sz);

struct sk_buff *_rtw_skb_alloc(u32 sz);
+5 −10
Original line number Diff line number Diff line
@@ -30,22 +30,17 @@ inline int RTW_STATUS_CODE(int error_code)
	return _FAIL;
}

u8 *_rtw_malloc(u32 sz)
void *_rtw_malloc(u32 sz)
{
	u8 *pbuf = NULL;

	pbuf = kmalloc(sz, in_interrupt() ? GFP_ATOMIC : GFP_KERNEL);

	return pbuf;
	return kmalloc(sz, in_interrupt() ? GFP_ATOMIC : GFP_KERNEL);
}

u8 *_rtw_zmalloc(u32 sz)
void *_rtw_zmalloc(u32 sz)
{
	u8 *pbuf = _rtw_malloc(sz);
	void *pbuf = _rtw_malloc(sz);

	if (pbuf != NULL) {
	if (pbuf)
		memset(pbuf, 0, sz);
	}

	return pbuf;
}