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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux