Skip to content

Commit

Permalink
[PATCH] hostap: use offsetof() instead of own equivalent
Browse files Browse the repository at this point in the history
The original macros result in gcc 4.2 warning about "cast from pointer
to integer of different size" on 64-bit systems.

Use of offsetof() on fields in substructures is widespread throughout
the kernel code and should work whether offsetof() is defined using
__compiler_offsetof() or a cast.

Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Pavel Roskin authored and Jeff Garzik committed Apr 28, 2007
1 parent 876c9d3 commit c6710e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/wireless/hostap/hostap_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -368,9 +368,9 @@ enum {

#define PRISM2_HOSTAPD_MAX_BUF_SIZE 1024
#define PRISM2_HOSTAPD_RID_HDR_LEN \
((int) (&((struct prism2_hostapd_param *) 0)->u.rid.data))
offsetof(struct prism2_hostapd_param, u.rid.data)
#define PRISM2_HOSTAPD_GENERIC_ELEMENT_HDR_LEN \
((int) (&((struct prism2_hostapd_param *) 0)->u.generic_elem.data))
offsetof(struct prism2_hostapd_param, u.generic_elem.data)

/* Maximum length for algorithm names (-1 for nul termination) used in ioctl()
*/
Expand Down

0 comments on commit c6710e5

Please sign in to comment.