1. 04 Oct, 2015 1 commit
    • Maciek Borzecki's avatar
      staging: wlan-ng: prism2sta: replace memcmp with ether_addr_equal · a305cf31
      Maciek Borzecki authored
      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: default avatarMaciek Borzecki <maciek.borzecki@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a305cf31
  2. 02 Oct, 2015 39 commits