Commit e2382233 authored by Krzysztof Adamski's avatar Krzysztof Adamski Committed by Greg Kroah-Hartman
Browse files

staging: vt6656: Use ether_addr_copy() on vnt_private members.



This patch fixes checkpatch.pl warning:
WARNING: Prefer ether_addr_copy() over memcpy() if the Ethernet
addresses are __aligned(2)

current_net_addr and permanent_net_addr members of vnt_private alignment
is changed to at last 16 bits so that ether_addr_copy can be safely used
on them.

buf->data is of type ieee80211_cts which is already properly aligned.

Signed-off-by: default avatarKrzysztof Adamski <k@japko.eu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ccc103f5
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -307,8 +307,8 @@ struct vnt_private {

	struct vnt_cmd_card_init init_command;
	struct vnt_rsp_card_init init_response;
	u8 current_net_addr[ETH_ALEN];
	u8 permanent_net_addr[ETH_ALEN];
	u8 current_net_addr[ETH_ALEN] __aligned(2);
	u8 permanent_net_addr[ETH_ALEN] __aligned(2);

	u8 exist_sw_net_addr;

+2 −1
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@
 */
#undef __NO_VERSION__

#include <linux/etherdevice.h>
#include <linux/file.h>
#include "device.h"
#include "card.h"
@@ -319,7 +320,7 @@ static int vnt_init_registers(struct vnt_private *priv)

	/* get permanent network address */
	memcpy(priv->permanent_net_addr, init_rsp->net_addr, 6);
	memcpy(priv->current_net_addr, priv->permanent_net_addr, ETH_ALEN);
	ether_addr_copy(priv->current_net_addr, priv->permanent_net_addr);

	/* if exist SW network address, use it */
	dev_dbg(&priv->usb->dev, "Network address = %pM\n",
+2 −2
Original line number Diff line number Diff line
@@ -553,7 +553,7 @@ static u16 vnt_fill_cts_head(struct vnt_usb_send_context *tx_context,
		buf->data.frame_control =
			cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_CTS);

		memcpy(buf->data.ra, priv->current_net_addr, ETH_ALEN);
		ether_addr_copy(buf->data.ra, priv->current_net_addr);

		return vnt_rxtx_datahead_g_fb(tx_context, &buf->data_head);
	} else {
@@ -571,7 +571,7 @@ static u16 vnt_fill_cts_head(struct vnt_usb_send_context *tx_context,
		buf->data.frame_control =
			cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_CTS);

		memcpy(buf->data.ra, priv->current_net_addr, ETH_ALEN);
		ether_addr_copy(buf->data.ra, priv->current_net_addr);

		return vnt_rxtx_datahead_g(tx_context, &buf->data_head);
	}