lkml.org 
[lkml]   [2014]   [Dec]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] drivers: staging: rtl8723au: get rid of unneeded memset/memcpy
Date
This also fixes a sparse warning.

Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
---
drivers/staging/rtl8723au/hal/rtl8723a_cmd.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c b/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c
index 7b56411..d8c4c8b 100644
--- a/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c
+++ b/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c
@@ -124,14 +124,15 @@ int rtl8723a_set_rssi_cmd(struct rtw_adapter *padapter, u8 *param)

int rtl8723a_set_raid_cmd(struct rtw_adapter *padapter, u32 mask, u8 arg)
{
- u8 buf[5];
+ struct {
+ __le32 mask;
+ u8 arg;
+ } __packed buf;

- memset(buf, 0, 5);
- mask = cpu_to_le32(mask);
- memcpy(buf, &mask, 4);
- buf[4] = arg;
+ buf.mask = cpu_to_le32(mask);
+ buf.arg = arg;

- FillH2CCmd(padapter, MACID_CONFIG_EID, 5, buf);
+ FillH2CCmd(padapter, MACID_CONFIG_EID, 5, (u8 *)&buf);

return _SUCCESS;
}
--
2.1.3


\
 
 \ /
  Last update: 2014-12-07 16:01    [W:0.065 / U:0.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site