Re: [PATCHv2 7/7] vt6655: Remove typedefs in 80211hdr.h

From: Greg KH
Date: Wed Jan 08 2014 - 14:07:24 EST


On Tue, Jan 07, 2014 at 01:11:51PM +0100, Michael Gunselmann wrote:
> From: Martin Hofmann <martin.hofmann@xxxxxxxxxxxxxxxxxxxxxxx>
>
> The file 80211hdr.h contained typedefs for 5 types. To satisfy checkpatch,
> this commit removes them. In 11 other files, every occurence of a now deleted
> type has been substituted with the correct struct ... syntax.

Why not split this into 5 patches, one for each typedef? That way the
one I don't like, I could have ignored, and taken the other 4 patches?
:)

> -typedef union tagUWLAN_80211HDR {
> - WLAN_80211HDR_A2 sA2;
> - WLAN_80211HDR_A3 sA3;
> - WLAN_80211HDR_A4 sA4;
> -} UWLAN_80211HDR, *PUWLAN_80211HDR;
> +} __attribute__((__packed__));
> +
> +union UWLAN_80211HDR {
> + struct WLAN_80211HDR_A2 sA2;
> + struct WLAN_80211HDR_A3 sA3;
> + struct WLAN_80211HDR_A4 sA4;
> +};

This really should be a struct of a union, right? Then you don't have
these "odd" casts to do:

> - pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf;
> + pFrame->pHdr = (union UWLAN_80211HDR *)pFrame->pBuf;

And are these casts even needed?

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/