lkml.org 
[lkml]   [2014]   [Jan]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCHv2 7/7] vt6655: Remove typedefs in 80211hdr.h
On Tue, Jan 07, 2014 at 01:11:51PM +0100, Michael Gunselmann wrote:
> From: Martin Hofmann <martin.hofmann@studium.uni-erlangen.de>
>
> 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


\
 
 \ /
  Last update: 2014-01-08 20:41    [W:0.057 / U:0.436 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site