Covert to pointer, point to callers buffer and remove casting in callers.
CONTROLnsRequestOut is called with sizeof u8.
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/mac.c | 9 +++------
drivers/staging/vt6656/mac.h | 2 +-
drivers/staging/vt6656/main_usb.c | 4 ++--
3 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/drivers/staging/vt6656/mac.c b/drivers/staging/vt6656/mac.c
index 54414ed27..5392f7c 100644
--- a/drivers/staging/vt6656/mac.c
+++ b/drivers/staging/vt6656/mac.c
@@ -55,17 +55,14 @@ static int msglevel =MSG_LEVEL_INFO;
* Return Value: none
*
*/
-void MACvWriteMultiAddr(struct vnt_private *pDevice, u32 uByteIdx, u8 byData)
+void MACvWriteMultiAddr(struct vnt_private *pDevice, u32 uByteIdx, u8 *data)
{
- u8 byData1;
-
- byData1 = byData;
CONTROLnsRequestOut(pDevice,
MESSAGE_TYPE_WRITE,
(u16) (MAC_REG_MAR0 + uByteIdx),
MESSAGE_REQUEST_MACREG,
- 1,
- &byData1);
+ sizeof(u8),
+ data);
}
/*
diff --git a/drivers/staging/vt6656/mac.h b/drivers/staging/vt6656/mac.h
index 0db1be5..e0af29e 100644
--- a/drivers/staging/vt6656/mac.h
+++ b/drivers/staging/vt6656/mac.h
@@ -403,7 +403,7 @@
#define MAC_REVISION_A0 0x00
#define MAC_REVISION_A1 0x01
-void MACvWriteMultiAddr(struct vnt_private *, u32, u8);
+void MACvWriteMultiAddr(struct vnt_private *, u32, u8 *);
void MACbShutdown(struct vnt_private *);
void MACvSetBBType(struct vnt_private *, u8);
void MACvDisableKeyEntry(struct vnt_private *, u32);
diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c
index 4cb7aa7..45d2bf3 100644
--- a/drivers/staging/vt6656/main_usb.c
+++ b/drivers/staging/vt6656/main_usb.c
@@ -1394,8 +1394,8 @@ static void device_set_multi(struct net_device *dev)
mc_filter[bit_nr >> 5] |= cpu_to_le32(1 << (bit_nr & 31));
}
for (ii = 0; ii < 4; ii++) {
- MACvWriteMultiAddr(pDevice, ii, *((u8 *)&mc_filter[0] + ii));
- MACvWriteMultiAddr(pDevice, ii+ 4, *((u8 *)&mc_filter[1] + ii));
+ MACvWriteMultiAddr(pDevice, ii, (u8 *)&mc_filter[0] + ii);
+ MACvWriteMultiAddr(pDevice, ii + 4, (u8 *)&mc_filter[1] + ii);
}
pDevice->byRxMode &= ~(RCR_UNICAST);
pDevice->byRxMode |= (RCR_MULTICAST|RCR_BROADCAST);
--
1.8.4.4
On Tue, 2013-11-26 at 20:45 +0000, Malcolm Priestley wrote:
> Covert to pointer, point to callers buffer and remove casting in callers.
[]
> diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c
[]
> @@ -1394,8 +1394,8 @@ static void device_set_multi(struct net_device *dev)
> mc_filter[bit_nr >> 5] |= cpu_to_le32(1 << (bit_nr & 31));
A possible thing to fix for another day:
mc_filter is u32 but should probably be __le32 instead.
ORing a u32 and a cpu_to_le32 isn't ideal.