* [PATCH] drivers: staging: rtl8723au: get rid of unneeded memset/memcpy
@ 2014-12-07 14:37 Emil Renner Berthing
2015-01-17 21:50 ` Greg Kroah-Hartman
0 siblings, 1 reply; 3+ messages in thread
From: Emil Renner Berthing @ 2014-12-07 14:37 UTC (permalink / raw)
To: Larry Finger, Jes Sorensen
Cc: Emil Renner Berthing, Greg Kroah-Hartman, linux-wireless, devel,
linux-kernel
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
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] drivers: staging: rtl8723au: get rid of unneeded memset/memcpy
2014-12-07 14:37 [PATCH] drivers: staging: rtl8723au: get rid of unneeded memset/memcpy Emil Renner Berthing
@ 2015-01-17 21:50 ` Greg Kroah-Hartman
2015-01-18 15:24 ` Jes Sorensen
0 siblings, 1 reply; 3+ messages in thread
From: Greg Kroah-Hartman @ 2015-01-17 21:50 UTC (permalink / raw)
To: Emil Renner Berthing
Cc: Larry Finger, Jes Sorensen, devel, linux-wireless, linux-kernel
On Sun, Dec 07, 2014 at 03:37:20PM +0100, Emil Renner Berthing wrote:
> This also fixes a sparse warning.
What sparse warning? What's wrong with the original code? Unless Jes
resends this to me, I don't see the need to apply it, sorry.
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drivers: staging: rtl8723au: get rid of unneeded memset/memcpy
2015-01-17 21:50 ` Greg Kroah-Hartman
@ 2015-01-18 15:24 ` Jes Sorensen
0 siblings, 0 replies; 3+ messages in thread
From: Jes Sorensen @ 2015-01-18 15:24 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Emil Renner Berthing, Larry Finger, devel, linux-wireless,
linux-kernel
Greg Kroah-Hartman <gregkh@linuxfoundation.org> writes:
> On Sun, Dec 07, 2014 at 03:37:20PM +0100, Emil Renner Berthing wrote:
>> This also fixes a sparse warning.
>
> What sparse warning? What's wrong with the original code? Unless Jes
> resends this to me, I don't see the need to apply it, sorry.
I agree, I cannot see what this is fixing, it does however add an ugly
cast.
If you want to change the paramters passed to FillH2CCmd() then change
the prototype and create something like struct h2c_cmd_arg{} and apply
that across the board.
NACK
Jes
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-01-18 15:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-07 14:37 [PATCH] drivers: staging: rtl8723au: get rid of unneeded memset/memcpy Emil Renner Berthing
2015-01-17 21:50 ` Greg Kroah-Hartman
2015-01-18 15:24 ` Jes Sorensen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).