linux/drivers/staging/wlan-ng
Maciek Borzecki a305cf3162 staging: wlan-ng: prism2sta: replace memcmp with ether_addr_equal
Replace memcmp() with ether_addr_equal(). In every location where the
replacement was done, the addresses accessed are
__aligned(2). Structures accessed either stack or heap allocated, no
direct memory casts to possibly unaligned structs are used.

Involved structures:

typedef struct hfa384x_authenticateStation_data {
	u8 address[ETH_ALEN];   /* 0 offset */
	...
} __packed hfa384x_authenticateStation_data_t;

struct prism2sta_authlist {
	unsigned int cnt;
	u8 addr[WLAN_AUTH_MAX][ETH_ALEN]; /* 4 bytes offset,
					     addresses start
					     at u16 boundary */
	u8 assoc[WLAN_AUTH_MAX];
};

struct prism2sta_accesslist {
	unsigned int modify;
	unsigned int cnt;
	u8 addr[WLAN_ACCESS_MAX][ETH_ALEN]; /* 8 bytes offset,
					       multiple of u16 */
	...
	u8 addr1[WLAN_ACCESS_MAX][ETH_ALEN]; /* starts at u32 boundary,
						struct not packed */
};

typedef struct hfa384x_AssocStatus {
	u16 assocstatus;
	u8 sta_addr[ETH_ALEN];    /* 2 bytes offset,
				     struct is packed */
	u8 old_ap_addr[ETH_ALEN]; /* 8 bytes offset */
	...
} __packed hfa384x_AssocStatus_t;

The patch resolves the following checkpatch warnings:

  WARNING: Prefer ether_addr_equal() or ether_addr_equal_unaligned()
           over memcmp()

Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-04 08:27:48 +01:00
..
cfg80211.c
hfa384x_usb.c
hfa384x.h
Kconfig
Makefile
p80211conv.c
p80211conv.h
p80211hdr.h
p80211ioctl.h
p80211meta.h
p80211metadef.h
p80211metastruct.h
p80211mgmt.h
p80211msg.h
p80211netdev.c
p80211netdev.h
p80211req.c
p80211req.h
p80211types.h
p80211wep.c
prism2fw.c staging: wlan-ng remove unnessecary variable 2015-09-29 04:19:27 +02:00
prism2mgmt.c
prism2mgmt.h
prism2mib.c
prism2sta.c staging: wlan-ng: prism2sta: replace memcmp with ether_addr_equal 2015-10-04 08:27:48 +01:00
prism2usb.c
README

TODO:
	- checkpatch.pl cleanups
	- sparse warnings
	- move to use the in-kernel wireless stack

Please send any patches or complaints about this driver to Greg
Kroah-Hartman <greg@kroah.com> and don't bother the upstream wireless
kernel developers about it, they want nothing to do with it.