linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 4/4] staging: vt6656: Remove typedef enum _CONTEXT_TYPE
@ 2014-02-19 21:56 Malcolm Priestley
  2014-02-19 22:15 ` Joe Perches
  0 siblings, 1 reply; 5+ messages in thread
From: Malcolm Priestley @ 2014-02-19 21:56 UTC (permalink / raw)
  To: gregkh; +Cc: linux-wireless

Replace with enum

assign as u8 type.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
---
 drivers/staging/vt6656/device.h  | 10 +++++-----
 drivers/staging/vt6656/rxtx.c    | 10 +++++-----
 drivers/staging/vt6656/usbpipe.c |  2 +-
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/vt6656/device.h b/drivers/staging/vt6656/device.h
index 33e5e34..8d8f31a 100644
--- a/drivers/staging/vt6656/device.h
+++ b/drivers/staging/vt6656/device.h
@@ -158,10 +158,10 @@ typedef enum __device_msg_level {
 /*
  * Enum of context types for SendPacket
  */
-typedef enum _CONTEXT_TYPE {
-    CONTEXT_DATA_PACKET = 1,
-    CONTEXT_MGMT_PACKET
-} CONTEXT_TYPE;
+enum {
+	CONTEXT_DATA_PACKET = 1,
+	CONTEXT_MGMT_PACKET
+};
 
 /* RCB (Receive Control Block) */
 struct vnt_rcb {
@@ -180,7 +180,7 @@ struct vnt_usb_send_context {
 	struct sk_buff *pPacket;
 	struct urb *pUrb;
 	unsigned int uBufLen;
-	CONTEXT_TYPE Type;
+	u8 type;
 	struct ethhdr sEthHeader;
 	void *Next;
 	bool bBoolInUse;
diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
index 92146e5..ba0184a 100644
--- a/drivers/staging/vt6656/rxtx.c
+++ b/drivers/staging/vt6656/rxtx.c
@@ -1610,7 +1610,7 @@ CMD_STATUS csMgmt_xmit(struct vnt_private *pDevice,
     pTX_Buffer->byType = 0x00;
 
     pContext->pPacket = NULL;
-    pContext->Type = CONTEXT_MGMT_PACKET;
+    pContext->type = CONTEXT_MGMT_PACKET;
     pContext->uBufLen = (u16)cbReqCount + 4;  //USB header
 
     if (WLAN_GET_FC_TODS(pMACHeader->frame_control) == 0) {
@@ -1702,7 +1702,7 @@ CMD_STATUS csBeacon_xmit(struct vnt_private *pDevice,
     pTX_Buffer->byType = 0x01;
 
     pContext->pPacket = NULL;
-    pContext->Type = CONTEXT_MGMT_PACKET;
+    pContext->type = CONTEXT_MGMT_PACKET;
     pContext->uBufLen = (u16)cbReqCount + 4;  //USB header
 
     PIPEnsSendBulkOut(pDevice,pContext);
@@ -2050,7 +2050,7 @@ void vDMA0_tx_80211(struct vnt_private *pDevice, struct sk_buff *skb)
     pTX_Buffer->byType = 0x00;
 
     pContext->pPacket = skb;
-    pContext->Type = CONTEXT_MGMT_PACKET;
+    pContext->type = CONTEXT_MGMT_PACKET;
     pContext->uBufLen = (u16)cbReqCount + 4;  //USB header
 
     if (WLAN_GET_FC_TODS(pMACHeader->frame_control) == 0) {
@@ -2440,7 +2440,7 @@ int nsDMA_tx_packet(struct vnt_private *pDevice,
     pTX_Buffer->wTxByteCount = (u16)BytesToWrite;
 
     pContext->pPacket = skb;
-    pContext->Type = CONTEXT_DATA_PACKET;
+    pContext->type = CONTEXT_DATA_PACKET;
     pContext->uBufLen = (u16)BytesToWrite + 4 ; //USB header
 
     s_vSaveTxPktInfo(pDevice, (u8)(pTX_Buffer->byPKTNO & 0x0F),
@@ -2594,7 +2594,7 @@ int bRelayPacketSend(struct vnt_private *pDevice, u8 *pbySkbData, u32 uDataLen,
     pTX_Buffer->wTxByteCount = (u16)BytesToWrite;
 
     pContext->pPacket = NULL;
-    pContext->Type = CONTEXT_DATA_PACKET;
+    pContext->type = CONTEXT_DATA_PACKET;
     pContext->uBufLen = (u16)BytesToWrite + 4 ; //USB header
 
     s_vSaveTxPktInfo(pDevice, (u8)(pTX_Buffer->byPKTNO & 0x0F),
diff --git a/drivers/staging/vt6656/usbpipe.c b/drivers/staging/vt6656/usbpipe.c
index 0ae5d20..1fc382d 100644
--- a/drivers/staging/vt6656/usbpipe.c
+++ b/drivers/staging/vt6656/usbpipe.c
@@ -610,7 +610,7 @@ static void s_nsBulkOutIoCompleteWrite(struct urb *urb)
 	struct vnt_usb_send_context *context =
 			(struct vnt_usb_send_context *)urb->context;
 	struct vnt_private *priv = context->pDevice;
-	CONTEXT_TYPE context_type = context->Type;
+	u8 context_type = context->type;
 	unsigned long buf_len = context->uBufLen;
 	int status;
 
-- 
1.9.rc1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 4/4] staging: vt6656: Remove typedef enum _CONTEXT_TYPE
  2014-02-19 21:56 [PATCH 4/4] staging: vt6656: Remove typedef enum _CONTEXT_TYPE Malcolm Priestley
@ 2014-02-19 22:15 ` Joe Perches
  2014-02-19 22:29   ` Malcolm Priestley
  0 siblings, 1 reply; 5+ messages in thread
From: Joe Perches @ 2014-02-19 22:15 UTC (permalink / raw)
  To: Malcolm Priestley; +Cc: gregkh, linux-wireless

On Wed, 2014-02-19 at 21:56 +0000, Malcolm Priestley wrote:
> Replace with enum
> assign as u8 type.
[]
> diff --git a/drivers/staging/vt6656/device.h b/drivers/staging/vt6656/device.h
[]
> @@ -180,7 +180,7 @@ struct vnt_usb_send_context {
>  	struct sk_buff *pPacket;
>  	struct urb *pUrb;
>  	unsigned int uBufLen;
> -	CONTEXT_TYPE Type;
> +	u8 type;

This doesn't really save any space in the struct.
You might move it immediately before or after bBoolInUse.

>  	struct ethhdr sEthHeader;
>  	void *Next;
>  	bool bBoolInUse;



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 4/4] staging: vt6656: Remove typedef enum _CONTEXT_TYPE
  2014-02-19 22:15 ` Joe Perches
@ 2014-02-19 22:29   ` Malcolm Priestley
  2014-02-19 22:31     ` Joe Perches
  0 siblings, 1 reply; 5+ messages in thread
From: Malcolm Priestley @ 2014-02-19 22:29 UTC (permalink / raw)
  To: Joe Perches; +Cc: gregkh, linux-wireless

On 19/02/14 22:15, Joe Perches wrote:
> On Wed, 2014-02-19 at 21:56 +0000, Malcolm Priestley wrote:
>> Replace with enum
>> assign as u8 type.
> []
>> diff --git a/drivers/staging/vt6656/device.h b/drivers/staging/vt6656/device.h
> []
>> @@ -180,7 +180,7 @@ struct vnt_usb_send_context {
>>   	struct sk_buff *pPacket;
>>   	struct urb *pUrb;
>>   	unsigned int uBufLen;
>> -	CONTEXT_TYPE Type;
>> +	u8 type;
>
> This doesn't really save any space in the struct.
> You might move it immediately before or after bBoolInUse.
>
>>   	struct ethhdr sEthHeader;
>>   	void *Next;
>>   	bool bBoolInUse;
>
>
No, but there are dead members in the structure that need removing.

sEthHeader and Next are dead



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 4/4] staging: vt6656: Remove typedef enum _CONTEXT_TYPE
  2014-02-19 22:29   ` Malcolm Priestley
@ 2014-02-19 22:31     ` Joe Perches
  2014-02-19 22:59       ` Malcolm Priestley
  0 siblings, 1 reply; 5+ messages in thread
From: Joe Perches @ 2014-02-19 22:31 UTC (permalink / raw)
  To: Malcolm Priestley; +Cc: gregkh, linux-wireless

On Wed, 2014-02-19 at 22:29 +0000, Malcolm Priestley wrote:
> On 19/02/14 22:15, Joe Perches wrote:
> > On Wed, 2014-02-19 at 21:56 +0000, Malcolm Priestley wrote:
> >> Replace with enum
> >> assign as u8 type.
> > []
> >> diff --git a/drivers/staging/vt6656/device.h b/drivers/staging/vt6656/device.h
> > []
> >> @@ -180,7 +180,7 @@ struct vnt_usb_send_context {
> >>   	struct sk_buff *pPacket;
> >>   	struct urb *pUrb;
> >>   	unsigned int uBufLen;
> >> -	CONTEXT_TYPE Type;
> >> +	u8 type;
> >
> > This doesn't really save any space in the struct.
> > You might move it immediately before or after bBoolInUse.
> >
> >>   	struct ethhdr sEthHeader;
> >>   	void *Next;
> >>   	bool bBoolInUse;
> >
> >
> No, but there are dead members in the structure that need removing.
> 
> sEthHeader and Next are dead

Then it'll all work out well in the end...


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 4/4] staging: vt6656: Remove typedef enum _CONTEXT_TYPE
  2014-02-19 22:31     ` Joe Perches
@ 2014-02-19 22:59       ` Malcolm Priestley
  0 siblings, 0 replies; 5+ messages in thread
From: Malcolm Priestley @ 2014-02-19 22:59 UTC (permalink / raw)
  To: Joe Perches; +Cc: gregkh, linux-wireless

On 19/02/14 22:31, Joe Perches wrote:
> On Wed, 2014-02-19 at 22:29 +0000, Malcolm Priestley wrote:
>> On 19/02/14 22:15, Joe Perches wrote:
>>> On Wed, 2014-02-19 at 21:56 +0000, Malcolm Priestley wrote:
>>>> Replace with enum
>>>> assign as u8 type.
>>> []
>>>> diff --git a/drivers/staging/vt6656/device.h b/drivers/staging/vt6656/device.h
>>> []
>>>> @@ -180,7 +180,7 @@ struct vnt_usb_send_context {
>>>>    	struct sk_buff *pPacket;
>>>>    	struct urb *pUrb;
>>>>    	unsigned int uBufLen;
>>>> -	CONTEXT_TYPE Type;
>>>> +	u8 type;
>>>
>>> This doesn't really save any space in the struct.
>>> You might move it immediately before or after bBoolInUse.
>>>
>>>>    	struct ethhdr sEthHeader;
>>>>    	void *Next;
>>>>    	bool bBoolInUse;
>>>
>>>
>> No, but there are dead members in the structure that need removing.
>>
>> sEthHeader and Next are dead
>
> Then it'll all work out well in the end...
>
Oh sorry sEthHeader isn't dead, but will go dead in the future under 
mac80211.

I'll do a patch to reorder the structure.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-02-19 22:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-19 21:56 [PATCH 4/4] staging: vt6656: Remove typedef enum _CONTEXT_TYPE Malcolm Priestley
2014-02-19 22:15 ` Joe Perches
2014-02-19 22:29   ` Malcolm Priestley
2014-02-19 22:31     ` Joe Perches
2014-02-19 22:59       ` Malcolm Priestley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).