* [PATCH 1/9] Staging: Winbond: Fix case statements in wb35reg.c.
@ 2011-08-16 0:24 Akshay Joshi
2011-08-16 0:24 ` [PATCH 2/9] Staging: Winbond: Fix pointer style in wb35tx.c Akshay Joshi
` (9 more replies)
0 siblings, 10 replies; 29+ messages in thread
From: Akshay Joshi @ 2011-08-16 0:24 UTC (permalink / raw)
To: Pavel Machek, Greg Kroah-Hartman, Pekka Enberg, Akshay Joshi,
Ilia Mirkin, devel, linux-kernel
Split the case statement and the code that is executed if the condition
is met so that it passes checkpatch.pl and conforms to the kernel code
style.
Signed-off-by: Akshay Joshi <me@akshayjoshi.com>
---
drivers/staging/winbond/wb35reg.c | 105 ++++++++++++++++++++++++------------
1 files changed, 70 insertions(+), 35 deletions(-)
diff --git a/drivers/staging/winbond/wb35reg.c b/drivers/staging/winbond/wb35reg.c
index da595f1..742636c 100644
--- a/drivers/staging/winbond/wb35reg.c
+++ b/drivers/staging/winbond/wb35reg.c
@@ -76,41 +76,76 @@ void Wb35Reg_Update(struct hw_data *pHwData, u16 RegisterNo, u32 RegisterValue
{
struct wb35_reg *reg = &pHwData->reg;
switch (RegisterNo) {
- case 0x3b0: reg->U1B0 = RegisterValue; break;
- case 0x3bc: reg->U1BC_LEDConfigure = RegisterValue; break;
- case 0x400: reg->D00_DmaControl = RegisterValue; break;
- case 0x800: reg->M00_MacControl = RegisterValue; break;
- case 0x804: reg->M04_MulticastAddress1 = RegisterValue; break;
- case 0x808: reg->M08_MulticastAddress2 = RegisterValue; break;
- case 0x824: reg->M24_MacControl = RegisterValue; break;
- case 0x828: reg->M28_MacControl = RegisterValue; break;
- case 0x82c: reg->M2C_MacControl = RegisterValue; break;
- case 0x838: reg->M38_MacControl = RegisterValue; break;
- case 0x840: reg->M40_MacControl = RegisterValue; break;
- case 0x844: reg->M44_MacControl = RegisterValue; break;
- case 0x848: reg->M48_MacControl = RegisterValue; break;
- case 0x84c: reg->M4C_MacStatus = RegisterValue; break;
- case 0x860: reg->M60_MacControl = RegisterValue; break;
- case 0x868: reg->M68_MacControl = RegisterValue; break;
- case 0x870: reg->M70_MacControl = RegisterValue; break;
- case 0x874: reg->M74_MacControl = RegisterValue; break;
- case 0x878: reg->M78_ERPInformation = RegisterValue; break;
- case 0x87C: reg->M7C_MacControl = RegisterValue; break;
- case 0x880: reg->M80_MacControl = RegisterValue; break;
- case 0x884: reg->M84_MacControl = RegisterValue; break;
- case 0x888: reg->M88_MacControl = RegisterValue; break;
- case 0x898: reg->M98_MacControl = RegisterValue; break;
- case 0x100c: reg->BB0C = RegisterValue; break;
- case 0x102c: reg->BB2C = RegisterValue; break;
- case 0x1030: reg->BB30 = RegisterValue; break;
- case 0x103c: reg->BB3C = RegisterValue; break;
- case 0x1048: reg->BB48 = RegisterValue; break;
- case 0x104c: reg->BB4C = RegisterValue; break;
- case 0x1050: reg->BB50 = RegisterValue; break;
- case 0x1054: reg->BB54 = RegisterValue; break;
- case 0x1058: reg->BB58 = RegisterValue; break;
- case 0x105c: reg->BB5C = RegisterValue; break;
- case 0x1060: reg->BB60 = RegisterValue; break;
+ case 0x3b0:
+ reg->U1B0 = RegisterValue; break;
+ case 0x3bc:
+ reg->U1BC_LEDConfigure = RegisterValue; break;
+ case 0x400:
+ reg->D00_DmaControl = RegisterValue; break;
+ case 0x800:
+ reg->M00_MacControl = RegisterValue; break;
+ case 0x804:
+ reg->M04_MulticastAddress1 = RegisterValue; break;
+ case 0x808:
+ reg->M08_MulticastAddress2 = RegisterValue; break;
+ case 0x824:
+ reg->M24_MacControl = RegisterValue; break;
+ case 0x828:
+ reg->M28_MacControl = RegisterValue; break;
+ case 0x82c:
+ reg->M2C_MacControl = RegisterValue; break;
+ case 0x838:
+ reg->M38_MacControl = RegisterValue; break;
+ case 0x840:
+ reg->M40_MacControl = RegisterValue; break;
+ case 0x844:
+ reg->M44_MacControl = RegisterValue; break;
+ case 0x848:
+ reg->M48_MacControl = RegisterValue; break;
+ case 0x84c:
+ reg->M4C_MacStatus = RegisterValue; break;
+ case 0x860:
+ reg->M60_MacControl = RegisterValue; break;
+ case 0x868:
+ reg->M68_MacControl = RegisterValue; break;
+ case 0x870:
+ reg->M70_MacControl = RegisterValue; break;
+ case 0x874:
+ reg->M74_MacControl = RegisterValue; break;
+ case 0x878:
+ reg->M78_ERPInformation = RegisterValue; break;
+ case 0x87C:
+ reg->M7C_MacControl = RegisterValue; break;
+ case 0x880:
+ reg->M80_MacControl = RegisterValue; break;
+ case 0x884:
+ reg->M84_MacControl = RegisterValue; break;
+ case 0x888:
+ reg->M88_MacControl = RegisterValue; break;
+ case 0x898:
+ reg->M98_MacControl = RegisterValue; break;
+ case 0x100c:
+ reg->BB0C = RegisterValue; break;
+ case 0x102c:
+ reg->BB2C = RegisterValue; break;
+ case 0x1030:
+ reg->BB30 = RegisterValue; break;
+ case 0x103c:
+ reg->BB3C = RegisterValue; break;
+ case 0x1048:
+ reg->BB48 = RegisterValue; break;
+ case 0x104c:
+ reg->BB4C = RegisterValue; break;
+ case 0x1050:
+ reg->BB50 = RegisterValue; break;
+ case 0x1054:
+ reg->BB54 = RegisterValue; break;
+ case 0x1058:
+ reg->BB58 = RegisterValue; break;
+ case 0x105c:
+ reg->BB5C = RegisterValue; break;
+ case 0x1060:
+ reg->BB60 = RegisterValue; break;
}
}
--
1.7.5.4
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH 2/9] Staging: Winbond: Fix pointer style in wb35tx.c.
2011-08-16 0:24 [PATCH 1/9] Staging: Winbond: Fix case statements in wb35reg.c Akshay Joshi
@ 2011-08-16 0:24 ` Akshay Joshi
2011-08-16 5:41 ` Pekka Enberg
2011-08-16 0:24 ` [PATCH 3/9] Staging: Winbond: Fix space issues " Akshay Joshi
` (8 subsequent siblings)
9 siblings, 1 reply; 29+ messages in thread
From: Akshay Joshi @ 2011-08-16 0:24 UTC (permalink / raw)
To: Pavel Machek, Greg Kroah-Hartman, Pekka Enberg, Akshay Joshi,
Karthigan Srinivasan, devel, linux-kernel
Pointers should be prefixed with a single space according to the kernel
coding style.
Signed-off-by: Akshay Joshi <me@akshayjoshi.com>
---
drivers/staging/winbond/wb35tx.c | 26 +++++++++++++-------------
1 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/drivers/staging/winbond/wb35tx.c b/drivers/staging/winbond/wb35tx.c
index 5df39d4..21edbc9 100644
--- a/drivers/staging/winbond/wb35tx.c
+++ b/drivers/staging/winbond/wb35tx.c
@@ -15,7 +15,7 @@
#include "mds_f.h"
unsigned char
-Wb35Tx_get_tx_buffer(struct hw_data * pHwData, u8 **pBuffer)
+Wb35Tx_get_tx_buffer(struct hw_data *pHwData, u8 **pBuffer)
{
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;
@@ -25,10 +25,10 @@ Wb35Tx_get_tx_buffer(struct hw_data * pHwData, u8 **pBuffer)
static void Wb35Tx(struct wbsoft_priv *adapter);
-static void Wb35Tx_complete(struct urb * pUrb)
+static void Wb35Tx_complete(struct urb *pUrb)
{
struct wbsoft_priv *adapter = pUrb->context;
- struct hw_data * pHwData = &adapter->sHwData;
+ struct hw_data *pHwData = &adapter->sHwData;
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;
struct wb35_mds *pMds = &adapter->Mds;
@@ -64,7 +64,7 @@ error:
static void Wb35Tx(struct wbsoft_priv *adapter)
{
- struct hw_data * pHwData = &adapter->sHwData;
+ struct hw_data *pHwData = &adapter->sHwData;
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;
u8 *pTxBufferAddress;
struct wb35_mds *pMds = &adapter->Mds;
@@ -115,7 +115,7 @@ static void Wb35Tx(struct wbsoft_priv *adapter)
void Wb35Tx_start(struct wbsoft_priv *adapter)
{
- struct hw_data * pHwData = &adapter->sHwData;
+ struct hw_data *pHwData = &adapter->sHwData;
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;
// Allow only one thread to run into function
@@ -126,7 +126,7 @@ void Wb35Tx_start(struct wbsoft_priv *adapter)
atomic_dec(&pWb35Tx->TxFireCounter);
}
-unsigned char Wb35Tx_initial(struct hw_data * pHwData)
+unsigned char Wb35Tx_initial(struct hw_data *pHwData)
{
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;
@@ -145,7 +145,7 @@ unsigned char Wb35Tx_initial(struct hw_data * pHwData)
}
//======================================================
-void Wb35Tx_stop(struct hw_data * pHwData)
+void Wb35Tx_stop(struct hw_data *pHwData)
{
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;
@@ -161,7 +161,7 @@ void Wb35Tx_stop(struct hw_data * pHwData)
}
//======================================================
-void Wb35Tx_destroy(struct hw_data * pHwData)
+void Wb35Tx_destroy(struct hw_data *pHwData)
{
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;
@@ -182,7 +182,7 @@ void Wb35Tx_destroy(struct hw_data * pHwData)
void Wb35Tx_CurrentTime(struct wbsoft_priv *adapter, u32 TimeCount)
{
- struct hw_data * pHwData = &adapter->sHwData;
+ struct hw_data *pHwData = &adapter->sHwData;
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;
unsigned char Trigger = false;
@@ -199,10 +199,10 @@ void Wb35Tx_CurrentTime(struct wbsoft_priv *adapter, u32 TimeCount)
static void Wb35Tx_EP2VM(struct wbsoft_priv *adapter);
-static void Wb35Tx_EP2VM_complete(struct urb * pUrb)
+static void Wb35Tx_EP2VM_complete(struct urb *pUrb)
{
struct wbsoft_priv *adapter = pUrb->context;
- struct hw_data * pHwData = &adapter->sHwData;
+ struct hw_data *pHwData = &adapter->sHwData;
struct T02_descriptor T02, TSTATUS;
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;
u32 * pltmp = (u32 *)pWb35Tx->EP2_buf;
@@ -250,7 +250,7 @@ error:
static void Wb35Tx_EP2VM(struct wbsoft_priv *adapter)
{
- struct hw_data * pHwData = &adapter->sHwData;
+ struct hw_data *pHwData = &adapter->sHwData;
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;
struct urb * pUrb = (struct urb *)pWb35Tx->Tx2Urb;
u32 * pltmp = (u32 *)pWb35Tx->EP2_buf;
@@ -284,7 +284,7 @@ error:
void Wb35Tx_EP2VM_start(struct wbsoft_priv *adapter)
{
- struct hw_data * pHwData = &adapter->sHwData;
+ struct hw_data *pHwData = &adapter->sHwData;
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;
// Allow only one thread to run into function
--
1.7.5.4
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH 3/9] Staging: Winbond: Fix space issues in wb35tx.c.
2011-08-16 0:24 [PATCH 1/9] Staging: Winbond: Fix case statements in wb35reg.c Akshay Joshi
2011-08-16 0:24 ` [PATCH 2/9] Staging: Winbond: Fix pointer style in wb35tx.c Akshay Joshi
@ 2011-08-16 0:24 ` Akshay Joshi
2011-08-16 5:42 ` Pekka Enberg
2011-08-16 0:24 ` [PATCH 4/9] Staging: Winbond: Convert C99 style comments in Winbond Akshay Joshi
` (7 subsequent siblings)
9 siblings, 1 reply; 29+ messages in thread
From: Akshay Joshi @ 2011-08-16 0:24 UTC (permalink / raw)
To: Pavel Machek, Greg Kroah-Hartman, Pekka Enberg, Akshay Joshi,
Karthigan Srinivasan, devel, linux-kernel
Issues with spaces (such as not having spaces inside of square brackets,
etc.) were fixed in the wb35tx.c file.
Signed-off-by: Akshay Joshi <me@akshayjoshi.com>
---
drivers/staging/winbond/wb35tx.c | 26 +++++++++++++-------------
1 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/drivers/staging/winbond/wb35tx.c b/drivers/staging/winbond/wb35tx.c
index 21edbc9..49a43c1 100644
--- a/drivers/staging/winbond/wb35tx.c
+++ b/drivers/staging/winbond/wb35tx.c
@@ -36,7 +36,7 @@ static void Wb35Tx_complete(struct urb *pUrb)
// Variable setting
pWb35Tx->EP4vm_state = VM_COMPLETED;
pWb35Tx->EP4VM_status = pUrb->status; //Store the last result of Irp
- pMds->TxOwner[ pWb35Tx->TxSendIndex ] = 0;// Set the owner. Free the owner bit always.
+ pMds->TxOwner[pWb35Tx->TxSendIndex] = 0;// Set the owner. Free the owner bit always.
pWb35Tx->TxSendIndex++;
pWb35Tx->TxSendIndex %= MAX_USB_TX_BUFFER_NUMBER;
@@ -90,12 +90,12 @@ static void Wb35Tx(struct wbsoft_priv *adapter)
//
usb_fill_bulk_urb(pUrb, pHwData->udev,
usb_sndbulkpipe(pHwData->udev, 4),
- pTxBufferAddress, pMds->TxBufferSize[ SendIndex ],
+ pTxBufferAddress, pMds->TxBufferSize[SendIndex],
Wb35Tx_complete, adapter);
pWb35Tx->EP4vm_state = VM_RUNNING;
retv = usb_submit_urb(pUrb, GFP_ATOMIC);
- if (retv<0) {
+ if (retv < 0) {
printk("EP4 Tx Irp sending error\n");
goto cleanup;
}
@@ -137,7 +137,7 @@ unsigned char Wb35Tx_initial(struct hw_data *pHwData)
pWb35Tx->Tx2Urb = usb_alloc_urb(0, GFP_ATOMIC);
if (!pWb35Tx->Tx2Urb)
{
- usb_free_urb( pWb35Tx->Tx4Urb );
+ usb_free_urb(pWb35Tx->Tx4Urb);
return false;
}
@@ -151,12 +151,12 @@ void Wb35Tx_stop(struct hw_data *pHwData)
// Trying to canceling the Trp of EP2
if (pWb35Tx->EP2vm_state == VM_RUNNING)
- usb_unlink_urb( pWb35Tx->Tx2Urb ); // Only use unlink, let Wb35Tx_destrot to free them
+ usb_unlink_urb(pWb35Tx->Tx2Urb); // Only use unlink, let Wb35Tx_destrot to free them
pr_debug("EP2 Tx stop\n");
// Trying to canceling the Irp of EP4
if (pWb35Tx->EP4vm_state == VM_RUNNING)
- usb_unlink_urb( pWb35Tx->Tx4Urb ); // Only use unlink, let Wb35Tx_destrot to free them
+ usb_unlink_urb(pWb35Tx->Tx4Urb); // Only use unlink, let Wb35Tx_destrot to free them
pr_debug("EP4 Tx stop\n");
}
@@ -168,14 +168,14 @@ void Wb35Tx_destroy(struct hw_data *pHwData)
// Wait for VM stop
do {
msleep(10); // Delay for waiting function enter 940623.1.a
- } while( (pWb35Tx->EP2vm_state != VM_STOP) && (pWb35Tx->EP4vm_state != VM_STOP) );
+ } while ((pWb35Tx->EP2vm_state != VM_STOP) && (pWb35Tx->EP4vm_state != VM_STOP));
msleep(10); // Delay for waiting function enter 940623.1.b
if (pWb35Tx->Tx4Urb)
- usb_free_urb( pWb35Tx->Tx4Urb );
+ usb_free_urb(pWb35Tx->Tx4Urb);
if (pWb35Tx->Tx2Urb)
- usb_free_urb( pWb35Tx->Tx2Urb );
+ usb_free_urb(pWb35Tx->Tx2Urb);
pr_debug("Wb35Tx_destroy OK\n");
}
@@ -224,7 +224,7 @@ static void Wb35Tx_EP2VM_complete(struct urb *pUrb)
//The Urb is completed, check the result
if (pWb35Tx->EP2VM_status != 0) {
printk("EP2 IoCompleteRoutine return error\n");
- pWb35Tx->EP2vm_state= VM_STOP;
+ pWb35Tx->EP2vm_state = VM_STOP;
goto error;
}
@@ -238,7 +238,7 @@ static void Wb35Tx_EP2VM_complete(struct urb *pUrb)
T02.value |= ((cpu_to_le32(pltmp[i]) & 0xff) << 24);
TSTATUS.value = T02.value; //20061009 anson's endian
- Mds_SendComplete( adapter, &TSTATUS );
+ Mds_SendComplete(adapter, &TSTATUS);
T02.value = cpu_to_le32(pltmp[i]) >> 8;
}
@@ -265,8 +265,8 @@ static void Wb35Tx_EP2VM(struct wbsoft_priv *adapter)
//
// Issuing URB
//
- usb_fill_int_urb( pUrb, pHwData->udev, usb_rcvintpipe(pHwData->udev,2),
- pltmp, MAX_INTERRUPT_LENGTH, Wb35Tx_EP2VM_complete, adapter, 32);
+ usb_fill_int_urb(pUrb, pHwData->udev, usb_rcvintpipe(pHwData->udev, 2),
+ pltmp, MAX_INTERRUPT_LENGTH, Wb35Tx_EP2VM_complete, adapter, 32);
pWb35Tx->EP2vm_state = VM_RUNNING;
retv = usb_submit_urb(pUrb, GFP_ATOMIC);
--
1.7.5.4
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH 4/9] Staging: Winbond: Convert C99 style comments in Winbond.
2011-08-16 0:24 [PATCH 1/9] Staging: Winbond: Fix case statements in wb35reg.c Akshay Joshi
2011-08-16 0:24 ` [PATCH 2/9] Staging: Winbond: Fix pointer style in wb35tx.c Akshay Joshi
2011-08-16 0:24 ` [PATCH 3/9] Staging: Winbond: Fix space issues " Akshay Joshi
@ 2011-08-16 0:24 ` Akshay Joshi
2011-08-16 5:42 ` Pekka Enberg
2011-08-16 19:56 ` Gábor Stefanik
2011-08-16 0:24 ` [PATCH 5/9] Staging: Winbond: Fix spacing issues for spaces before tabs Akshay Joshi
` (6 subsequent siblings)
9 siblings, 2 replies; 29+ messages in thread
From: Akshay Joshi @ 2011-08-16 0:24 UTC (permalink / raw)
To: Pavel Machek, Greg Kroah-Hartman, Akshay Joshi, Pekka Enberg,
Karthigan Srinivasan, devel, linux-kernel
Converted all of the C99 style comments in the Winbond driver to the
kernel-accepted multiline stlye.
Signed-off-by: Akshay Joshi <me@akshayjoshi.com>
---
drivers/staging/winbond/wb35rx_f.h | 6 +-
drivers/staging/winbond/wb35rx_s.h | 51 ++++++++++----------
drivers/staging/winbond/wb35tx.c | 92 ++++++++++++++++++-----------------
drivers/staging/winbond/wb35tx_s.h | 45 ++++++++---------
4 files changed, 96 insertions(+), 98 deletions(-)
diff --git a/drivers/staging/winbond/wb35rx_f.h b/drivers/staging/winbond/wb35rx_f.h
index 1fdf65e..bb408e9 100644
--- a/drivers/staging/winbond/wb35rx_f.h
+++ b/drivers/staging/winbond/wb35rx_f.h
@@ -4,9 +4,9 @@
#include <net/mac80211.h>
#include "wbhal.h"
-//====================================
-// Interface function declare
-//====================================
+/*
+ * Interface function declare
+ */
unsigned char Wb35Rx_initial( struct hw_data * pHwData );
void Wb35Rx_destroy( struct hw_data * pHwData );
void Wb35Rx_stop( struct hw_data * pHwData );
diff --git a/drivers/staging/winbond/wb35rx_s.h b/drivers/staging/winbond/wb35rx_s.h
index 4b03274..c896337 100644
--- a/drivers/staging/winbond/wb35rx_s.h
+++ b/drivers/staging/winbond/wb35rx_s.h
@@ -1,43 +1,42 @@
-//============================================================================
-// wb35rx.h --
-//============================================================================
-
-// Definition for this module used
-#define MAX_USB_RX_BUFFER 4096 // This parameter must be 4096 931130.4.f
-
-#define MAX_USB_RX_BUFFER_NUMBER ETHERNET_RX_DESCRIPTORS // Maximum 254, 255 is RESERVED ID
-#define RX_INTERFACE 0 // Interface 1
-#define RX_PIPE 2 // Pipe 3
-#define MAX_PACKET_SIZE 1600 //1568 // 8 + 1532 + 4 + 24(IV EIV MIC ICV CRC) for check DMA data 931130.4.g
-#define RX_END_TAG 0x0badbeef
-
-
-//====================================
-// Internal variable for module
-//====================================
+/*============================================================================
+/* wb35rx.h --
+/*============================================================================
+
+/* Definition for this module used */
+#define MAX_USB_RX_BUFFER 4096 /* This parameter must be 4096 931130.4.f */
+
+#define MAX_USB_RX_BUFFER_NUMBER ETHERNET_RX_DESCRIPTORS /* Maximum 254, 255 is RESERVED ID */
+#define RX_INTERFACE 0 /* Interface 1 */
+#define RX_PIPE 2 /* Pipe 3 */
+#define MAX_PACKET_SIZE 1600 /*1568: 8 + 1532 + 4 + 24(IV EIV MIC ICV CRC) for check DMA data 931130.4.g */
+#define RX_END_TAG 0x0badbeef
+
+/*
+ * Internal variable for module
+ */
struct wb35_rx {
- u32 ByteReceived;// For calculating throughput of BulkIn
- atomic_t RxFireCounter;// Does Wb35Rx module fire?
+ u32 ByteReceived;/* For calculating throughput of BulkIn */
+ atomic_t RxFireCounter;/* Does Wb35Rx module fire? */
u8 RxBuffer[ MAX_USB_RX_BUFFER_NUMBER ][ ((MAX_USB_RX_BUFFER+3) & ~0x03 ) ];
+ /* Ownership of buffer 0: SW 1:HW */
u16 RxBufferSize[ ((MAX_USB_RX_BUFFER_NUMBER+1) & ~0x01) ];
- u8 RxOwner[ ((MAX_USB_RX_BUFFER_NUMBER+3) & ~0x03 ) ];//Ownership of buffer 0: SW 1:HW
-
- u32 RxProcessIndex;//The next index to process
+ u8 RxOwner[ ((MAX_USB_RX_BUFFER_NUMBER+3) & ~0x03 ) ];
+ u32 RxProcessIndex; /* The next index to process */
u32 RxBufferId;
u32 EP3vm_state;
- u32 rx_halt; // For VM stopping
+ u32 rx_halt; /* For VM stopping */
u16 MoreDataSize;
u16 PacketSize;
- u32 CurrentRxBufferId; // For complete routine usage
+ u32 CurrentRxBufferId; /* For complete routine usage */
u32 Rx3UrbCancel;
- u32 LastR1; // For RSSI reporting
+ u32 LastR1; /* For RSSI reporting */
struct urb * RxUrb;
- u32 Ep3ErrorCount2; // 20060625.1 Usbd for Rx DMA error count
+ u32 Ep3ErrorCount2; /* 20060625.1 Usbd for Rx DMA error count */
int EP3VM_status;
u8 * pDRx;
diff --git a/drivers/staging/winbond/wb35tx.c b/drivers/staging/winbond/wb35tx.c
index 49a43c1..a8dd4c9 100644
--- a/drivers/staging/winbond/wb35tx.c
+++ b/drivers/staging/winbond/wb35tx.c
@@ -1,13 +1,13 @@
-//============================================================================
-// Copyright (c) 1996-2002 Winbond Electronic Corporation
-//
-// Module Name:
-// Wb35Tx.c
-//
-// Abstract:
-// Processing the Tx message and put into down layer
-//
-//============================================================================
+/*============================================================================
+ * Copyright (c) 1996-2002 Winbond Electronic Corporation
+ *
+ * Module Name:
+ * Wb35Tx.c
+ *
+ * Abstract:
+ * Processing the Tx message and put into down layer
+ *
+*/
#include <linux/usb.h>
#include <linux/gfp.h>
@@ -33,20 +33,22 @@ static void Wb35Tx_complete(struct urb *pUrb)
struct wb35_mds *pMds = &adapter->Mds;
printk("wb35: tx complete\n");
- // Variable setting
+ /* Variable setting */
pWb35Tx->EP4vm_state = VM_COMPLETED;
- pWb35Tx->EP4VM_status = pUrb->status; //Store the last result of Irp
- pMds->TxOwner[pWb35Tx->TxSendIndex] = 0;// Set the owner. Free the owner bit always.
+ pWb35Tx->EP4VM_status = pUrb->status; /* Store the last result of Irp */
+ /* Set the owner. Free the owner bit always. */
+ pMds->TxOwner[pWb35Tx->TxSendIndex] = 0;
pWb35Tx->TxSendIndex++;
pWb35Tx->TxSendIndex %= MAX_USB_TX_BUFFER_NUMBER;
- if (pHwData->SurpriseRemove) // Let WbWlanHalt to handle surprise remove
+ /* Let WbWlanHalt to handle surprise remove */
+ if (pHwData->SurpriseRemove)
goto error;
if (pWb35Tx->tx_halt)
goto error;
- // The URB is completed, check the result
+ /* The URB is completed, check the result */
if (pWb35Tx->EP4VM_status != 0) {
printk("URB submission failed\n");
pWb35Tx->EP4vm_state = VM_STOP;
@@ -79,15 +81,16 @@ static void Wb35Tx(struct wbsoft_priv *adapter)
if (pWb35Tx->tx_halt)
goto cleanup;
- // Ownership checking
+ /* Ownership checking */
SendIndex = pWb35Tx->TxSendIndex;
- if (!pMds->TxOwner[SendIndex]) //No more data need to be sent, return immediately
+ if (!pMds->TxOwner[SendIndex])
+ /* No more data need to be sent, return immediately. */
goto cleanup;
pTxBufferAddress = pWb35Tx->TxBuffer[SendIndex];
- //
- // Issuing URB
- //
+
+ /* Issuing URB */
+
usb_fill_bulk_urb(pUrb, pHwData->udev,
usb_sndbulkpipe(pHwData->udev, 4),
pTxBufferAddress, pMds->TxBufferSize[SendIndex],
@@ -100,7 +103,7 @@ static void Wb35Tx(struct wbsoft_priv *adapter)
goto cleanup;
}
- // Check if driver needs issue Irp for EP2
+ /* Check if driver needs issue Irp for EP2 */
pWb35Tx->TxFillCount += pMds->TxCountInBuffer[SendIndex];
if (pWb35Tx->TxFillCount > 12)
Wb35Tx_EP2VM_start(adapter);
@@ -118,7 +121,7 @@ void Wb35Tx_start(struct wbsoft_priv *adapter)
struct hw_data *pHwData = &adapter->sHwData;
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;
- // Allow only one thread to run into function
+ /* Allow only one thread to run into function */
if (atomic_inc_return(&pWb35Tx->TxFireCounter) == 1) {
pWb35Tx->EP4vm_state = VM_RUNNING;
Wb35Tx(adapter);
@@ -144,32 +147,32 @@ unsigned char Wb35Tx_initial(struct hw_data *pHwData)
return true;
}
-//======================================================
void Wb35Tx_stop(struct hw_data *pHwData)
{
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;
- // Trying to canceling the Trp of EP2
+ /* Trying to canceling the Trp of EP2 */
if (pWb35Tx->EP2vm_state == VM_RUNNING)
- usb_unlink_urb(pWb35Tx->Tx2Urb); // Only use unlink, let Wb35Tx_destrot to free them
+ /* Only use unlink, let Wb35Tx_destroy to free them. */
+ usb_unlink_urb(pWb35Tx->Tx2Urb);
pr_debug("EP2 Tx stop\n");
- // Trying to canceling the Irp of EP4
+ /* Trying to canceling the Irp of EP4 */
if (pWb35Tx->EP4vm_state == VM_RUNNING)
- usb_unlink_urb(pWb35Tx->Tx4Urb); // Only use unlink, let Wb35Tx_destrot to free them
+ /* Only use unlink, let Wb35Tx_destroy to free them. */
+ usb_unlink_urb(pWb35Tx->Tx4Urb);
pr_debug("EP4 Tx stop\n");
}
-//======================================================
void Wb35Tx_destroy(struct hw_data *pHwData)
{
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;
- // Wait for VM stop
+ /* Wait for VM stop */
do {
- msleep(10); // Delay for waiting function enter 940623.1.a
+ msleep(10); /* Delay for waiting function enter 940623.1.a */
} while ((pWb35Tx->EP2vm_state != VM_STOP) && (pWb35Tx->EP4vm_state != VM_STOP));
- msleep(10); // Delay for waiting function enter 940623.1.b
+ msleep(10); /* Delay for waiting function enter 940623.1.b */
if (pWb35Tx->Tx4Urb)
usb_free_urb(pWb35Tx->Tx4Urb);
@@ -210,34 +213,35 @@ static void Wb35Tx_EP2VM_complete(struct urb *pUrb)
u16 InterruptInLength;
- // Variable setting
+ /* Variable setting */
pWb35Tx->EP2vm_state = VM_COMPLETED;
pWb35Tx->EP2VM_status = pUrb->status;
- // For Linux 2.4. Interrupt will always trigger
- if (pHwData->SurpriseRemove) // Let WbWlanHalt to handle surprise remove
+ /* For Linux 2.4. Interrupt will always trigger */
+ if (pHwData->SurpriseRemove) /* Let WbWlanHalt to handle surprise remove */
goto error;
if (pWb35Tx->tx_halt)
goto error;
- //The Urb is completed, check the result
+ /* The Urb is completed, check the result */
if (pWb35Tx->EP2VM_status != 0) {
printk("EP2 IoCompleteRoutine return error\n");
pWb35Tx->EP2vm_state = VM_STOP;
goto error;
}
- // Update the Tx result
+ /* Update the Tx result */
InterruptInLength = pUrb->actual_length;
- // Modify for minimum memory access and DWORD alignment.
- T02.value = cpu_to_le32(pltmp[0]) >> 8; // [31:8] -> [24:0]
- InterruptInLength -= 1;// 20051221.1.c Modify the follow for more stable
- InterruptInLength >>= 2; // InterruptInLength/4
+ /* Modify for minimum memory access and DWORD alignment. */
+ T02.value = cpu_to_le32(pltmp[0]) >> 8; /* [31:8] -> [24:0] */
+ /* 20051221.1.c Modify the follow for more stable */
+ InterruptInLength -= 1;
+ InterruptInLength >>= 2; /* InterruptInLength/4 */
for (i = 1; i <= InterruptInLength; i++) {
T02.value |= ((cpu_to_le32(pltmp[i]) & 0xff) << 24);
- TSTATUS.value = T02.value; //20061009 anson's endian
+ TSTATUS.value = T02.value; /* 20061009 anson's endian */
Mds_SendComplete(adapter, &TSTATUS);
T02.value = cpu_to_le32(pltmp[i]) >> 8;
}
@@ -262,9 +266,7 @@ static void Wb35Tx_EP2VM(struct wbsoft_priv *adapter)
if (pWb35Tx->tx_halt)
goto error;
- //
- // Issuing URB
- //
+ /* Issuing URB */
usb_fill_int_urb(pUrb, pHwData->udev, usb_rcvintpipe(pHwData->udev, 2),
pltmp, MAX_INTERRUPT_LENGTH, Wb35Tx_EP2VM_complete, adapter, 32);
@@ -287,7 +289,7 @@ void Wb35Tx_EP2VM_start(struct wbsoft_priv *adapter)
struct hw_data *pHwData = &adapter->sHwData;
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;
- // Allow only one thread to run into function
+ /* Allow only one thread to run into function */
if (atomic_inc_return(&pWb35Tx->TxResultCount) == 1) {
pWb35Tx->EP2vm_state = VM_RUNNING;
Wb35Tx_EP2VM(adapter);
diff --git a/drivers/staging/winbond/wb35tx_s.h b/drivers/staging/winbond/wb35tx_s.h
index f70f433..1befbcb 100644
--- a/drivers/staging/winbond/wb35tx_s.h
+++ b/drivers/staging/winbond/wb35tx_s.h
@@ -3,36 +3,33 @@
#include "mds_s.h"
-//====================================
-// IS89C35 Tx related definition
-//====================================
-#define TX_INTERFACE 0 // Interface 1
-#define TX_PIPE 3 // endpoint 4
-#define TX_INTERRUPT 1 // endpoint 2
-#define MAX_INTERRUPT_LENGTH 64 // It must be 64 for EP2 hardware
-
-
-
-//====================================
-// Internal variable for module
-//====================================
-
+/*
+ * IS89C35 Tx related definition
+ */
+#define TX_INTERFACE 0 /* Interface 1 */
+#define TX_PIPE 3 /* endpoint 4 */
+#define TX_INTERRUPT 1 /* endpoint 2 */
+#define MAX_INTERRUPT_LENGTH 64 /* It must be 64 for EP2 hardware */
+
+/*
+ * Internal variable for module
+ */
struct wb35_tx {
- // For Tx buffer
+ /* For Tx buffer */
u8 TxBuffer[ MAX_USB_TX_BUFFER_NUMBER ][ MAX_USB_TX_BUFFER ];
- // For Interrupt pipe
+ /* For Interrupt pipe */
u8 EP2_buf[MAX_INTERRUPT_LENGTH];
- atomic_t TxResultCount;// For thread control of EP2 931130.4.m
- atomic_t TxFireCounter;// For thread control of EP4 931130.4.n
+ atomic_t TxResultCount;/* For thread control of EP2 931130.4.m */
+ atomic_t TxFireCounter;/* For thread control of EP4 931130.4.n */
u32 ByteTransfer;
- u32 TxSendIndex;// The next index of Mds array to be sent
- u32 EP2vm_state; // for EP2vm state
- u32 EP4vm_state; // for EP4vm state
- u32 tx_halt; // Stopping VM
+ u32 TxSendIndex;/* The next index of Mds array to be sent */
+ u32 EP2vm_state; /* for EP2vm state */
+ u32 EP4vm_state; /* for EP4vm state */
+ u32 tx_halt; /* Stopping VM */
struct urb * Tx4Urb;
struct urb * Tx2Urb;
@@ -40,8 +37,8 @@ struct wb35_tx {
int EP2VM_status;
int EP4VM_status;
- u32 TxFillCount; // 20060928
- u32 TxTimer; // 20060928 Add if sending packet not great than 13
+ u32 TxFillCount; /* 20060928 */
+ u32 TxTimer; /* 20060928 Add if sending packet not great than 13 */
};
#endif
--
1.7.5.4
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH 5/9] Staging: Winbond: Fix spacing issues for spaces before tabs.
2011-08-16 0:24 [PATCH 1/9] Staging: Winbond: Fix case statements in wb35reg.c Akshay Joshi
` (2 preceding siblings ...)
2011-08-16 0:24 ` [PATCH 4/9] Staging: Winbond: Convert C99 style comments in Winbond Akshay Joshi
@ 2011-08-16 0:24 ` Akshay Joshi
2011-08-16 5:43 ` Pekka Enberg
2011-08-16 0:24 ` [PATCH 6/9] Staging: Winbond: Remove spacing issues related to pointers Akshay Joshi
` (5 subsequent siblings)
9 siblings, 1 reply; 29+ messages in thread
From: Akshay Joshi @ 2011-08-16 0:24 UTC (permalink / raw)
To: Pavel Machek, Greg Kroah-Hartman, Pekka Enberg, Akshay Joshi,
Ilia Mirkin, Andrew Morton, Mike Frysinger, Karthigan Srinivasan,
devel, linux-kernel
Fix the spaces-before-tabs issues that occur within the Winbond driver
code.
Signed-off-by: Akshay Joshi <me@akshayjoshi.com>
---
drivers/staging/winbond/wb35reg.c | 2 +-
drivers/staging/winbond/wb35reg_s.h | 2 +-
drivers/staging/winbond/wb35rx_f.h | 6 +++---
drivers/staging/winbond/wb35rx_s.h | 6 +++---
drivers/staging/winbond/wb35tx.c | 2 +-
drivers/staging/winbond/wb35tx_s.h | 2 +-
6 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/staging/winbond/wb35reg.c b/drivers/staging/winbond/wb35reg.c
index 742636c..f2a411f 100644
--- a/drivers/staging/winbond/wb35reg.c
+++ b/drivers/staging/winbond/wb35reg.c
@@ -69,7 +69,7 @@ unsigned char Wb35Reg_BurstWrite(struct hw_data *pHwData, u16 RegisterNo, u32 *p
kfree(reg_queue);
return false;
}
- return false;
+ return false;
}
void Wb35Reg_Update(struct hw_data *pHwData, u16 RegisterNo, u32 RegisterValue)
diff --git a/drivers/staging/winbond/wb35reg_s.h b/drivers/staging/winbond/wb35reg_s.h
index dc79faa..cdbbf35 100644
--- a/drivers/staging/winbond/wb35reg_s.h
+++ b/drivers/staging/winbond/wb35reg_s.h
@@ -12,7 +12,7 @@ struct hw_data;
* HAL setting function
*
* ========================================
- * |Uxx| |Dxx| |Mxx| |BB| |RF|
+ * |Uxx| |Dxx| |Mxx| |BB| |RF|
* ========================================
* | |
* Wb35Reg_Read Wb35Reg_Write
diff --git a/drivers/staging/winbond/wb35rx_f.h b/drivers/staging/winbond/wb35rx_f.h
index bb408e9..4efc790 100644
--- a/drivers/staging/winbond/wb35rx_f.h
+++ b/drivers/staging/winbond/wb35rx_f.h
@@ -7,9 +7,9 @@
/*
* Interface function declare
*/
-unsigned char Wb35Rx_initial( struct hw_data * pHwData );
-void Wb35Rx_destroy( struct hw_data * pHwData );
-void Wb35Rx_stop( struct hw_data * pHwData );
+unsigned char Wb35Rx_initial(struct hw_data *pHwData);
+void Wb35Rx_destroy(struct hw_data * pHwData);
+void Wb35Rx_stop(struct hw_data * pHwData);
void Wb35Rx_start(struct ieee80211_hw *hw);
#endif
diff --git a/drivers/staging/winbond/wb35rx_s.h b/drivers/staging/winbond/wb35rx_s.h
index c896337..949e4f5 100644
--- a/drivers/staging/winbond/wb35rx_s.h
+++ b/drivers/staging/winbond/wb35rx_s.h
@@ -18,10 +18,10 @@ struct wb35_rx {
u32 ByteReceived;/* For calculating throughput of BulkIn */
atomic_t RxFireCounter;/* Does Wb35Rx module fire? */
- u8 RxBuffer[ MAX_USB_RX_BUFFER_NUMBER ][ ((MAX_USB_RX_BUFFER+3) & ~0x03 ) ];
+ u8 RxBuffer[MAX_USB_RX_BUFFER_NUMBER][((MAX_USB_RX_BUFFER+3) & ~0x03)];
/* Ownership of buffer 0: SW 1:HW */
- u16 RxBufferSize[ ((MAX_USB_RX_BUFFER_NUMBER+1) & ~0x01) ];
- u8 RxOwner[ ((MAX_USB_RX_BUFFER_NUMBER+3) & ~0x03 ) ];
+ u16 RxBufferSize[((MAX_USB_RX_BUFFER_NUMBER+1) & ~0x01)];
+ u8 RxOwner[((MAX_USB_RX_BUFFER_NUMBER+3) & ~0x03)];
u32 RxProcessIndex; /* The next index to process */
u32 RxBufferId;
u32 EP3vm_state;
diff --git a/drivers/staging/winbond/wb35tx.c b/drivers/staging/winbond/wb35tx.c
index a8dd4c9..a06212a 100644
--- a/drivers/staging/winbond/wb35tx.c
+++ b/drivers/staging/winbond/wb35tx.c
@@ -71,7 +71,7 @@ static void Wb35Tx(struct wbsoft_priv *adapter)
u8 *pTxBufferAddress;
struct wb35_mds *pMds = &adapter->Mds;
struct urb * pUrb = (struct urb *)pWb35Tx->Tx4Urb;
- int retv;
+ int retv;
u32 SendIndex;
diff --git a/drivers/staging/winbond/wb35tx_s.h b/drivers/staging/winbond/wb35tx_s.h
index 1befbcb..83b4b0f 100644
--- a/drivers/staging/winbond/wb35tx_s.h
+++ b/drivers/staging/winbond/wb35tx_s.h
@@ -17,7 +17,7 @@
struct wb35_tx {
/* For Tx buffer */
- u8 TxBuffer[ MAX_USB_TX_BUFFER_NUMBER ][ MAX_USB_TX_BUFFER ];
+ u8 TxBuffer[MAX_USB_TX_BUFFER_NUMBER][MAX_USB_TX_BUFFER];
/* For Interrupt pipe */
u8 EP2_buf[MAX_INTERRUPT_LENGTH];
--
1.7.5.4
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH 6/9] Staging: Winbond: Remove spacing issues related to pointers.
2011-08-16 0:24 [PATCH 1/9] Staging: Winbond: Fix case statements in wb35reg.c Akshay Joshi
` (3 preceding siblings ...)
2011-08-16 0:24 ` [PATCH 5/9] Staging: Winbond: Fix spacing issues for spaces before tabs Akshay Joshi
@ 2011-08-16 0:24 ` Akshay Joshi
2011-08-16 5:45 ` Pekka Enberg
2011-08-16 0:24 ` [PATCH 7/9] Staging: Winbond: Fix parentheses in returns Akshay Joshi
` (4 subsequent siblings)
9 siblings, 1 reply; 29+ messages in thread
From: Akshay Joshi @ 2011-08-16 0:24 UTC (permalink / raw)
To: Pavel Machek, Greg Kroah-Hartman, Akshay Joshi, Pekka Enberg,
devel, linux-kernel
This patch ensures that spacing around pointers is consistent and
follows the kernel coding style.
Signed-off-by: Akshay Joshi <me@akshayjoshi.com>
---
drivers/staging/winbond/wb35rx_f.h | 4 ++--
drivers/staging/winbond/wb35rx_s.h | 4 ++--
drivers/staging/winbond/wb35tx_s.h | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/winbond/wb35rx_f.h b/drivers/staging/winbond/wb35rx_f.h
index 4efc790..8f51136 100644
--- a/drivers/staging/winbond/wb35rx_f.h
+++ b/drivers/staging/winbond/wb35rx_f.h
@@ -8,8 +8,8 @@
* Interface function declare
*/
unsigned char Wb35Rx_initial(struct hw_data *pHwData);
-void Wb35Rx_destroy(struct hw_data * pHwData);
-void Wb35Rx_stop(struct hw_data * pHwData);
+void Wb35Rx_destroy(struct hw_data *pHwData);
+void Wb35Rx_stop(struct hw_data *pHwData);
void Wb35Rx_start(struct ieee80211_hw *hw);
#endif
diff --git a/drivers/staging/winbond/wb35rx_s.h b/drivers/staging/winbond/wb35rx_s.h
index 949e4f5..e99475db 100644
--- a/drivers/staging/winbond/wb35rx_s.h
+++ b/drivers/staging/winbond/wb35rx_s.h
@@ -35,9 +35,9 @@ struct wb35_rx {
u32 Rx3UrbCancel;
u32 LastR1; /* For RSSI reporting */
- struct urb * RxUrb;
+ struct urb *RxUrb;
u32 Ep3ErrorCount2; /* 20060625.1 Usbd for Rx DMA error count */
int EP3VM_status;
- u8 * pDRx;
+ u8 *pDRx;
};
diff --git a/drivers/staging/winbond/wb35tx_s.h b/drivers/staging/winbond/wb35tx_s.h
index 83b4b0f..fda18d6 100644
--- a/drivers/staging/winbond/wb35tx_s.h
+++ b/drivers/staging/winbond/wb35tx_s.h
@@ -31,8 +31,8 @@ struct wb35_tx {
u32 EP4vm_state; /* for EP4vm state */
u32 tx_halt; /* Stopping VM */
- struct urb * Tx4Urb;
- struct urb * Tx2Urb;
+ struct urb *Tx4Urb;
+ struct urb *Tx2Urb;
int EP2VM_status;
int EP4VM_status;
--
1.7.5.4
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH 7/9] Staging: Winbond: Fix parentheses in returns.
2011-08-16 0:24 [PATCH 1/9] Staging: Winbond: Fix case statements in wb35reg.c Akshay Joshi
` (4 preceding siblings ...)
2011-08-16 0:24 ` [PATCH 6/9] Staging: Winbond: Remove spacing issues related to pointers Akshay Joshi
@ 2011-08-16 0:24 ` Akshay Joshi
2011-08-16 5:45 ` Pekka Enberg
2011-08-16 0:24 ` [PATCH 8/9] Staging: Winbond: Use tabs instead of spaces for indents Akshay Joshi
` (3 subsequent siblings)
9 siblings, 1 reply; 29+ messages in thread
From: Akshay Joshi @ 2011-08-16 0:24 UTC (permalink / raw)
To: Pavel Machek, Greg Kroah-Hartman, Pekka Enberg, Akshay Joshi,
Chihau Chau, devel, linux-kernel
Removes parentheses when calling return, since return is not a function.
Signed-off-by: Akshay Joshi <me@akshayjoshi.com>
---
drivers/staging/winbond/phy_calibration.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/winbond/phy_calibration.c b/drivers/staging/winbond/phy_calibration.c
index c5a07fb..816fe7c 100644
--- a/drivers/staging/winbond/phy_calibration.c
+++ b/drivers/staging/winbond/phy_calibration.c
@@ -51,7 +51,7 @@ s32 _s13_to_s32(u32 data)
if ((data & BIT(12)) != 0)
val |= 0xFFFFF000;
- return ((s32) val);
+ return (s32)val;
}
u32 _s32_to_s13(s32 data)
@@ -184,7 +184,7 @@ s32 _floor(s32 n)
else
n -= 5;
- return (n/10);
+ return n/10;
}
/****************************************************************************/
--
1.7.5.4
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH 8/9] Staging: Winbond: Use tabs instead of spaces for indents.
2011-08-16 0:24 [PATCH 1/9] Staging: Winbond: Fix case statements in wb35reg.c Akshay Joshi
` (5 preceding siblings ...)
2011-08-16 0:24 ` [PATCH 7/9] Staging: Winbond: Fix parentheses in returns Akshay Joshi
@ 2011-08-16 0:24 ` Akshay Joshi
2011-08-16 5:46 ` Pekka Enberg
2011-08-16 0:24 ` [PATCH 9/9] Staging: Winbond: Reposition a curly bracket Akshay Joshi
` (2 subsequent siblings)
9 siblings, 1 reply; 29+ messages in thread
From: Akshay Joshi @ 2011-08-16 0:24 UTC (permalink / raw)
To: Pavel Machek, Greg Kroah-Hartman, Pekka Enberg, Akshay Joshi,
Chihau Chau, devel, linux-kernel
Replace some space indented lines with tab indented lines to follow the
kernel code style.
Signed-off-by: Akshay Joshi <me@akshayjoshi.com>
---
drivers/staging/winbond/phy_calibration.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/winbond/phy_calibration.c b/drivers/staging/winbond/phy_calibration.c
index 816fe7c..155f29d 100644
--- a/drivers/staging/winbond/phy_calibration.c
+++ b/drivers/staging/winbond/phy_calibration.c
@@ -455,7 +455,7 @@ void _txidac_dc_offset_cancellation_winbond(struct hw_data *phw_data)
phy_set_rf_data(phw_data, 11, (11<<24)|0x1901D6);
/* 0x05 0x24C60A ; 09318 ; Calibration (6c). setting TX-VGA gain: TXGCH=2 & GPK=110 --> to be optimized */
phy_set_rf_data(phw_data, 5, (5<<24)|0x24C48A);
- /* 0x06 0x06880C ; 01A20 ; Calibration (6d). RXGCH=00; RXGCL=100 000 (RXVGA=32) --> to be optimized */
+ /* 0x06 0x06880C ; 01A20 ; Calibration (6d). RXGCH=00; RXGCL=100 000 (RXVGA=32) --> to be optimized */
phy_set_rf_data(phw_data, 6, (6<<24)|0x06890C);
/* 0x00 0xFDF1C0 ; 3F7C7 ; Calibration (6e). turn on IQ imbalance/Test mode */
phy_set_rf_data(phw_data, 0, (0<<24)|0xFDF1C0);
@@ -577,7 +577,7 @@ void _txqdac_dc_offset_cacellation_winbond(struct hw_data *phw_data)
phy_set_rf_data(phw_data, 11, (11<<24)|0x1901D6);
/* 0x05 0x24C60A ; 09318 ; Calibration (6c). setting TX-VGA gain: TXGCH=2 & GPK=110 --> to be optimized */
phy_set_rf_data(phw_data, 5, (5<<24)|0x24C48A);
- /* 0x06 0x06880C ; 01A20 ; Calibration (6d). RXGCH=00; RXGCL=100 000 (RXVGA=32) --> to be optimized */
+ /* 0x06 0x06880C ; 01A20 ; Calibration (6d). RXGCH=00; RXGCL=100 000 (RXVGA=32) --> to be optimized */
phy_set_rf_data(phw_data, 6, (6<<24)|0x06890C);
/* 0x00 0xFDF1C0 ; 3F7C7 ; Calibration (6e). turn on IQ imbalance/Test mode */
phy_set_rf_data(phw_data, 0, (0<<24)|0xFDF1C0);
@@ -974,7 +974,7 @@ void _tx_iq_calibration_winbond(struct hw_data *phw_data)
phy_set_rf_data(phw_data, 11, (11<<24)|0x19BDD6); /* 20060612.1.a 0x1905D6); */
/* 0x05 0x24C60A ; 09318 ; Calibration (6c). setting TX-VGA gain: TXGCH=2 & GPK=110 --> to be optimized */
phy_set_rf_data(phw_data, 5, (5<<24)|0x24C60A); /* 0x24C60A (high temperature) */
- /* 0x06 0x06880C ; 01A20 ; Calibration (6d). RXGCH=00; RXGCL=100 000 (RXVGA=32) --> to be optimized */
+ /* 0x06 0x06880C ; 01A20 ; Calibration (6d). RXGCH=00; RXGCL=100 000 (RXVGA=32) --> to be optimized */
phy_set_rf_data(phw_data, 6, (6<<24)|0x34880C); /* 20060612.1.a 0x06890C); */
/* 0x00 0xFDF1C0 ; 3F7C7 ; Calibration (6e). turn on IQ imbalance/Test mode */
phy_set_rf_data(phw_data, 0, (0<<24)|0xFDF1C0);
--
1.7.5.4
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH 9/9] Staging: Winbond: Reposition a curly bracket.
2011-08-16 0:24 [PATCH 1/9] Staging: Winbond: Fix case statements in wb35reg.c Akshay Joshi
` (6 preceding siblings ...)
2011-08-16 0:24 ` [PATCH 8/9] Staging: Winbond: Use tabs instead of spaces for indents Akshay Joshi
@ 2011-08-16 0:24 ` Akshay Joshi
2011-08-16 5:46 ` Pekka Enberg
2011-08-16 5:41 ` [PATCH 1/9] Staging: Winbond: Fix case statements in wb35reg.c Pekka Enberg
2011-08-23 22:27 ` Greg KH
9 siblings, 1 reply; 29+ messages in thread
From: Akshay Joshi @ 2011-08-16 0:24 UTC (permalink / raw)
To: Pavel Machek, Greg Kroah-Hartman, Pekka Enberg, Akshay Joshi,
Karthigan Srinivasan, devel, linux-kernel
The curly bracket preceding the body of a conditional statement should
be on the same line as the conditional statement according to the
kernel's coding style.
Signed-off-by: Akshay Joshi <me@akshayjoshi.com>
---
drivers/staging/winbond/wb35tx.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/winbond/wb35tx.c b/drivers/staging/winbond/wb35tx.c
index a06212a..20bf966 100644
--- a/drivers/staging/winbond/wb35tx.c
+++ b/drivers/staging/winbond/wb35tx.c
@@ -138,8 +138,7 @@ unsigned char Wb35Tx_initial(struct hw_data *pHwData)
return false;
pWb35Tx->Tx2Urb = usb_alloc_urb(0, GFP_ATOMIC);
- if (!pWb35Tx->Tx2Urb)
- {
+ if (!pWb35Tx->Tx2Urb) {
usb_free_urb(pWb35Tx->Tx4Urb);
return false;
}
--
1.7.5.4
^ permalink raw reply related [flat|nested] 29+ messages in thread
* Re: [PATCH 1/9] Staging: Winbond: Fix case statements in wb35reg.c.
2011-08-16 0:24 [PATCH 1/9] Staging: Winbond: Fix case statements in wb35reg.c Akshay Joshi
` (7 preceding siblings ...)
2011-08-16 0:24 ` [PATCH 9/9] Staging: Winbond: Reposition a curly bracket Akshay Joshi
@ 2011-08-16 5:41 ` Pekka Enberg
2011-08-23 22:27 ` Greg KH
9 siblings, 0 replies; 29+ messages in thread
From: Pekka Enberg @ 2011-08-16 5:41 UTC (permalink / raw)
To: Akshay Joshi
Cc: Pavel Machek, Greg Kroah-Hartman, Ilia Mirkin, devel, linux-kernel
On Tue, Aug 16, 2011 at 3:24 AM, Akshay Joshi <me@akshayjoshi.com> wrote:
> Split the case statement and the code that is executed if the condition
> is met so that it passes checkpatch.pl and conforms to the kernel code
> style.
>
> Signed-off-by: Akshay Joshi <me@akshayjoshi.com>
Reviewed-by: Pekka Enberg <penberg@kernel.org>
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH 2/9] Staging: Winbond: Fix pointer style in wb35tx.c.
2011-08-16 0:24 ` [PATCH 2/9] Staging: Winbond: Fix pointer style in wb35tx.c Akshay Joshi
@ 2011-08-16 5:41 ` Pekka Enberg
0 siblings, 0 replies; 29+ messages in thread
From: Pekka Enberg @ 2011-08-16 5:41 UTC (permalink / raw)
To: Akshay Joshi
Cc: Pavel Machek, Greg Kroah-Hartman, Karthigan Srinivasan, devel,
linux-kernel
On Tue, Aug 16, 2011 at 3:24 AM, Akshay Joshi <me@akshayjoshi.com> wrote:
> Pointers should be prefixed with a single space according to the kernel
> coding style.
>
> Signed-off-by: Akshay Joshi <me@akshayjoshi.com>
Reviewed-by: Pekka Enberg <penberg@kernel.org>
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH 3/9] Staging: Winbond: Fix space issues in wb35tx.c.
2011-08-16 0:24 ` [PATCH 3/9] Staging: Winbond: Fix space issues " Akshay Joshi
@ 2011-08-16 5:42 ` Pekka Enberg
0 siblings, 0 replies; 29+ messages in thread
From: Pekka Enberg @ 2011-08-16 5:42 UTC (permalink / raw)
To: Akshay Joshi
Cc: Pavel Machek, Greg Kroah-Hartman, Karthigan Srinivasan, devel,
linux-kernel
On Tue, Aug 16, 2011 at 3:24 AM, Akshay Joshi <me@akshayjoshi.com> wrote:
> Issues with spaces (such as not having spaces inside of square brackets,
> etc.) were fixed in the wb35tx.c file.
>
> Signed-off-by: Akshay Joshi <me@akshayjoshi.com>
Reviewed-by: Pekka Enberg <penberg@kernel.org>
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH 4/9] Staging: Winbond: Convert C99 style comments in Winbond.
2011-08-16 0:24 ` [PATCH 4/9] Staging: Winbond: Convert C99 style comments in Winbond Akshay Joshi
@ 2011-08-16 5:42 ` Pekka Enberg
2011-08-16 19:56 ` Gábor Stefanik
1 sibling, 0 replies; 29+ messages in thread
From: Pekka Enberg @ 2011-08-16 5:42 UTC (permalink / raw)
To: Akshay Joshi
Cc: Pavel Machek, Greg Kroah-Hartman, Karthigan Srinivasan, devel,
linux-kernel
On Tue, Aug 16, 2011 at 3:24 AM, Akshay Joshi <me@akshayjoshi.com> wrote:
> Converted all of the C99 style comments in the Winbond driver to the
> kernel-accepted multiline stlye.
>
> Signed-off-by: Akshay Joshi <me@akshayjoshi.com>
Reviewed-by: Pekka Enberg <penberg@kernel.org>
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH 5/9] Staging: Winbond: Fix spacing issues for spaces before tabs.
2011-08-16 0:24 ` [PATCH 5/9] Staging: Winbond: Fix spacing issues for spaces before tabs Akshay Joshi
@ 2011-08-16 5:43 ` Pekka Enberg
0 siblings, 0 replies; 29+ messages in thread
From: Pekka Enberg @ 2011-08-16 5:43 UTC (permalink / raw)
To: Akshay Joshi
Cc: Pavel Machek, Greg Kroah-Hartman, Ilia Mirkin, Andrew Morton,
Mike Frysinger, Karthigan Srinivasan, devel, linux-kernel
On Tue, Aug 16, 2011 at 3:24 AM, Akshay Joshi <me@akshayjoshi.com> wrote:
> Fix the spaces-before-tabs issues that occur within the Winbond driver
> code.
>
> Signed-off-by: Akshay Joshi <me@akshayjoshi.com>
Reviewed-by: Pekka Enberg <penberg@kernel.org>
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH 6/9] Staging: Winbond: Remove spacing issues related to pointers.
2011-08-16 0:24 ` [PATCH 6/9] Staging: Winbond: Remove spacing issues related to pointers Akshay Joshi
@ 2011-08-16 5:45 ` Pekka Enberg
0 siblings, 0 replies; 29+ messages in thread
From: Pekka Enberg @ 2011-08-16 5:45 UTC (permalink / raw)
To: Akshay Joshi; +Cc: Pavel Machek, Greg Kroah-Hartman, devel, linux-kernel
On Tue, Aug 16, 2011 at 3:24 AM, Akshay Joshi <me@akshayjoshi.com> wrote:
> This patch ensures that spacing around pointers is consistent and
> follows the kernel coding style.
>
> Signed-off-by: Akshay Joshi <me@akshayjoshi.com>
> ---
> drivers/staging/winbond/wb35rx_f.h | 4 ++--
> drivers/staging/winbond/wb35rx_s.h | 4 ++--
> drivers/staging/winbond/wb35tx_s.h | 4 ++--
> 3 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/staging/winbond/wb35rx_f.h b/drivers/staging/winbond/wb35rx_f.h
> index 4efc790..8f51136 100644
> --- a/drivers/staging/winbond/wb35rx_f.h
> +++ b/drivers/staging/winbond/wb35rx_f.h
> @@ -8,8 +8,8 @@
> * Interface function declare
> */
> unsigned char Wb35Rx_initial(struct hw_data *pHwData);
> -void Wb35Rx_destroy(struct hw_data * pHwData);
> -void Wb35Rx_stop(struct hw_data * pHwData);
> +void Wb35Rx_destroy(struct hw_data *pHwData);
> +void Wb35Rx_stop(struct hw_data *pHwData);
> void Wb35Rx_start(struct ieee80211_hw *hw);
>
> #endif
> diff --git a/drivers/staging/winbond/wb35rx_s.h b/drivers/staging/winbond/wb35rx_s.h
> index 949e4f5..e99475db 100644
> --- a/drivers/staging/winbond/wb35rx_s.h
> +++ b/drivers/staging/winbond/wb35rx_s.h
> @@ -35,9 +35,9 @@ struct wb35_rx {
> u32 Rx3UrbCancel;
>
> u32 LastR1; /* For RSSI reporting */
> - struct urb * RxUrb;
> + struct urb *RxUrb;
> u32 Ep3ErrorCount2; /* 20060625.1 Usbd for Rx DMA error count */
>
> int EP3VM_status;
> - u8 * pDRx;
> + u8 *pDRx;
> };
> diff --git a/drivers/staging/winbond/wb35tx_s.h b/drivers/staging/winbond/wb35tx_s.h
> index 83b4b0f..fda18d6 100644
> --- a/drivers/staging/winbond/wb35tx_s.h
> +++ b/drivers/staging/winbond/wb35tx_s.h
> @@ -31,8 +31,8 @@ struct wb35_tx {
> u32 EP4vm_state; /* for EP4vm state */
> u32 tx_halt; /* Stopping VM */
>
> - struct urb * Tx4Urb;
> - struct urb * Tx2Urb;
> + struct urb *Tx4Urb;
> + struct urb *Tx2Urb;
>
> int EP2VM_status;
> int EP4VM_status;
If you're doing this, can you please then fix up all the struct
members to be consistent? I personally prefer the perf and x86 style
where you align members like this (with tabs):
u32 EP4vm_state;
u32 tx_halt;
struct urb *Tx4Urb;
etc...
Pekka
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH 7/9] Staging: Winbond: Fix parentheses in returns.
2011-08-16 0:24 ` [PATCH 7/9] Staging: Winbond: Fix parentheses in returns Akshay Joshi
@ 2011-08-16 5:45 ` Pekka Enberg
0 siblings, 0 replies; 29+ messages in thread
From: Pekka Enberg @ 2011-08-16 5:45 UTC (permalink / raw)
To: Akshay Joshi
Cc: Pavel Machek, Greg Kroah-Hartman, Chihau Chau, devel, linux-kernel
On Tue, Aug 16, 2011 at 3:24 AM, Akshay Joshi <me@akshayjoshi.com> wrote:
> Removes parentheses when calling return, since return is not a function.
>
> Signed-off-by: Akshay Joshi <me@akshayjoshi.com>
Reviewed-by: Pekka Enberg <penberg@kernel.org>
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH 8/9] Staging: Winbond: Use tabs instead of spaces for indents.
2011-08-16 0:24 ` [PATCH 8/9] Staging: Winbond: Use tabs instead of spaces for indents Akshay Joshi
@ 2011-08-16 5:46 ` Pekka Enberg
0 siblings, 0 replies; 29+ messages in thread
From: Pekka Enberg @ 2011-08-16 5:46 UTC (permalink / raw)
To: Akshay Joshi
Cc: Pavel Machek, Greg Kroah-Hartman, Chihau Chau, devel, linux-kernel
On Tue, Aug 16, 2011 at 3:24 AM, Akshay Joshi <me@akshayjoshi.com> wrote:
> Replace some space indented lines with tab indented lines to follow the
> kernel code style.
>
> Signed-off-by: Akshay Joshi <me@akshayjoshi.com>
Reviewed-by: Pekka Enberg <penberg@kernel.org>
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH 9/9] Staging: Winbond: Reposition a curly bracket.
2011-08-16 0:24 ` [PATCH 9/9] Staging: Winbond: Reposition a curly bracket Akshay Joshi
@ 2011-08-16 5:46 ` Pekka Enberg
0 siblings, 0 replies; 29+ messages in thread
From: Pekka Enberg @ 2011-08-16 5:46 UTC (permalink / raw)
To: Akshay Joshi
Cc: Pavel Machek, Greg Kroah-Hartman, Karthigan Srinivasan, devel,
linux-kernel
On Tue, Aug 16, 2011 at 3:24 AM, Akshay Joshi <me@akshayjoshi.com> wrote:
> The curly bracket preceding the body of a conditional statement should
> be on the same line as the conditional statement according to the
> kernel's coding style.
>
> Signed-off-by: Akshay Joshi <me@akshayjoshi.com>
Reviewed-by: Pekka Enberg <penberg@kernel.org>
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH 4/9] Staging: Winbond: Convert C99 style comments in Winbond.
2011-08-16 0:24 ` [PATCH 4/9] Staging: Winbond: Convert C99 style comments in Winbond Akshay Joshi
2011-08-16 5:42 ` Pekka Enberg
@ 2011-08-16 19:56 ` Gábor Stefanik
2011-08-16 21:24 ` Pekka Enberg
1 sibling, 1 reply; 29+ messages in thread
From: Gábor Stefanik @ 2011-08-16 19:56 UTC (permalink / raw)
To: Akshay Joshi
Cc: Pavel Machek, Greg Kroah-Hartman, Pekka Enberg,
Karthigan Srinivasan, devel, linux-kernel
On Tue, Aug 16, 2011 at 2:24 AM, Akshay Joshi <me@akshayjoshi.com> wrote:
> Converted all of the C99 style comments in the Winbond driver to the
> kernel-accepted multiline stlye.
>
> Signed-off-by: Akshay Joshi <me@akshayjoshi.com>
> ---
> drivers/staging/winbond/wb35rx_f.h | 6 +-
> drivers/staging/winbond/wb35rx_s.h | 51 ++++++++++----------
> drivers/staging/winbond/wb35tx.c | 92 ++++++++++++++++++-----------------
> drivers/staging/winbond/wb35tx_s.h | 45 ++++++++---------
> 4 files changed, 96 insertions(+), 98 deletions(-)
>
> diff --git a/drivers/staging/winbond/wb35rx_f.h b/drivers/staging/winbond/wb35rx_f.h
> index 1fdf65e..bb408e9 100644
> --- a/drivers/staging/winbond/wb35rx_f.h
> +++ b/drivers/staging/winbond/wb35rx_f.h
> @@ -4,9 +4,9 @@
> #include <net/mac80211.h>
> #include "wbhal.h"
>
> -//====================================
> -// Interface function declare
> -//====================================
> +/*
> + * Interface function declare
> + */
> unsigned char Wb35Rx_initial( struct hw_data * pHwData );
> void Wb35Rx_destroy( struct hw_data * pHwData );
> void Wb35Rx_stop( struct hw_data * pHwData );
> diff --git a/drivers/staging/winbond/wb35rx_s.h b/drivers/staging/winbond/wb35rx_s.h
> index 4b03274..c896337 100644
> --- a/drivers/staging/winbond/wb35rx_s.h
> +++ b/drivers/staging/winbond/wb35rx_s.h
> @@ -1,43 +1,42 @@
> -//============================================================================
> -// wb35rx.h --
> -//============================================================================
> -
> -// Definition for this module used
> -#define MAX_USB_RX_BUFFER 4096 // This parameter must be 4096 931130.4.f
> -
> -#define MAX_USB_RX_BUFFER_NUMBER ETHERNET_RX_DESCRIPTORS // Maximum 254, 255 is RESERVED ID
> -#define RX_INTERFACE 0 // Interface 1
> -#define RX_PIPE 2 // Pipe 3
> -#define MAX_PACKET_SIZE 1600 //1568 // 8 + 1532 + 4 + 24(IV EIV MIC ICV CRC) for check DMA data 931130.4.g
> -#define RX_END_TAG 0x0badbeef
> -
> -
> -//====================================
> -// Internal variable for module
> -//====================================
> +/*============================================================================
> +/* wb35rx.h --
> +/*============================================================================
I'm pretty sure this is not an accepted kernel comment style.
> +
> +/* Definition for this module used */
> +#define MAX_USB_RX_BUFFER 4096 /* This parameter must be 4096 931130.4.f */
> +
> +#define MAX_USB_RX_BUFFER_NUMBER ETHERNET_RX_DESCRIPTORS /* Maximum 254, 255 is RESERVED ID */
> +#define RX_INTERFACE 0 /* Interface 1 */
> +#define RX_PIPE 2 /* Pipe 3 */
> +#define MAX_PACKET_SIZE 1600 /*1568: 8 + 1532 + 4 + 24(IV EIV MIC ICV CRC) for check DMA data 931130.4.g */
> +#define RX_END_TAG 0x0badbeef
> +
> +/*
> + * Internal variable for module
> + */
> struct wb35_rx {
> - u32 ByteReceived;// For calculating throughput of BulkIn
> - atomic_t RxFireCounter;// Does Wb35Rx module fire?
> + u32 ByteReceived;/* For calculating throughput of BulkIn */
> + atomic_t RxFireCounter;/* Does Wb35Rx module fire? */
>
> u8 RxBuffer[ MAX_USB_RX_BUFFER_NUMBER ][ ((MAX_USB_RX_BUFFER+3) & ~0x03 ) ];
> + /* Ownership of buffer 0: SW 1:HW */
> u16 RxBufferSize[ ((MAX_USB_RX_BUFFER_NUMBER+1) & ~0x01) ];
> - u8 RxOwner[ ((MAX_USB_RX_BUFFER_NUMBER+3) & ~0x03 ) ];//Ownership of buffer 0: SW 1:HW
> -
> - u32 RxProcessIndex;//The next index to process
> + u8 RxOwner[ ((MAX_USB_RX_BUFFER_NUMBER+3) & ~0x03 ) ];
> + u32 RxProcessIndex; /* The next index to process */
> u32 RxBufferId;
> u32 EP3vm_state;
>
> - u32 rx_halt; // For VM stopping
> + u32 rx_halt; /* For VM stopping */
>
> u16 MoreDataSize;
> u16 PacketSize;
>
> - u32 CurrentRxBufferId; // For complete routine usage
> + u32 CurrentRxBufferId; /* For complete routine usage */
> u32 Rx3UrbCancel;
>
> - u32 LastR1; // For RSSI reporting
> + u32 LastR1; /* For RSSI reporting */
> struct urb * RxUrb;
> - u32 Ep3ErrorCount2; // 20060625.1 Usbd for Rx DMA error count
> + u32 Ep3ErrorCount2; /* 20060625.1 Usbd for Rx DMA error count */
>
> int EP3VM_status;
> u8 * pDRx;
> diff --git a/drivers/staging/winbond/wb35tx.c b/drivers/staging/winbond/wb35tx.c
> index 49a43c1..a8dd4c9 100644
> --- a/drivers/staging/winbond/wb35tx.c
> +++ b/drivers/staging/winbond/wb35tx.c
> @@ -1,13 +1,13 @@
> -//============================================================================
> -// Copyright (c) 1996-2002 Winbond Electronic Corporation
> -//
> -// Module Name:
> -// Wb35Tx.c
> -//
> -// Abstract:
> -// Processing the Tx message and put into down layer
> -//
> -//============================================================================
> +/*============================================================================
> + * Copyright (c) 1996-2002 Winbond Electronic Corporation
> + *
> + * Module Name:
> + * Wb35Tx.c
> + *
> + * Abstract:
> + * Processing the Tx message and put into down layer
> + *
> +*/
> #include <linux/usb.h>
> #include <linux/gfp.h>
>
> @@ -33,20 +33,22 @@ static void Wb35Tx_complete(struct urb *pUrb)
> struct wb35_mds *pMds = &adapter->Mds;
>
> printk("wb35: tx complete\n");
> - // Variable setting
> + /* Variable setting */
> pWb35Tx->EP4vm_state = VM_COMPLETED;
> - pWb35Tx->EP4VM_status = pUrb->status; //Store the last result of Irp
> - pMds->TxOwner[pWb35Tx->TxSendIndex] = 0;// Set the owner. Free the owner bit always.
> + pWb35Tx->EP4VM_status = pUrb->status; /* Store the last result of Irp */
> + /* Set the owner. Free the owner bit always. */
> + pMds->TxOwner[pWb35Tx->TxSendIndex] = 0;
> pWb35Tx->TxSendIndex++;
> pWb35Tx->TxSendIndex %= MAX_USB_TX_BUFFER_NUMBER;
>
> - if (pHwData->SurpriseRemove) // Let WbWlanHalt to handle surprise remove
> + /* Let WbWlanHalt to handle surprise remove */
> + if (pHwData->SurpriseRemove)
> goto error;
>
> if (pWb35Tx->tx_halt)
> goto error;
>
> - // The URB is completed, check the result
> + /* The URB is completed, check the result */
> if (pWb35Tx->EP4VM_status != 0) {
> printk("URB submission failed\n");
> pWb35Tx->EP4vm_state = VM_STOP;
> @@ -79,15 +81,16 @@ static void Wb35Tx(struct wbsoft_priv *adapter)
> if (pWb35Tx->tx_halt)
> goto cleanup;
>
> - // Ownership checking
> + /* Ownership checking */
> SendIndex = pWb35Tx->TxSendIndex;
> - if (!pMds->TxOwner[SendIndex]) //No more data need to be sent, return immediately
> + if (!pMds->TxOwner[SendIndex])
> + /* No more data need to be sent, return immediately. */
> goto cleanup;
>
> pTxBufferAddress = pWb35Tx->TxBuffer[SendIndex];
> - //
> - // Issuing URB
> - //
> +
> + /* Issuing URB */
> +
> usb_fill_bulk_urb(pUrb, pHwData->udev,
> usb_sndbulkpipe(pHwData->udev, 4),
> pTxBufferAddress, pMds->TxBufferSize[SendIndex],
> @@ -100,7 +103,7 @@ static void Wb35Tx(struct wbsoft_priv *adapter)
> goto cleanup;
> }
>
> - // Check if driver needs issue Irp for EP2
> + /* Check if driver needs issue Irp for EP2 */
> pWb35Tx->TxFillCount += pMds->TxCountInBuffer[SendIndex];
> if (pWb35Tx->TxFillCount > 12)
> Wb35Tx_EP2VM_start(adapter);
> @@ -118,7 +121,7 @@ void Wb35Tx_start(struct wbsoft_priv *adapter)
> struct hw_data *pHwData = &adapter->sHwData;
> struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;
>
> - // Allow only one thread to run into function
> + /* Allow only one thread to run into function */
> if (atomic_inc_return(&pWb35Tx->TxFireCounter) == 1) {
> pWb35Tx->EP4vm_state = VM_RUNNING;
> Wb35Tx(adapter);
> @@ -144,32 +147,32 @@ unsigned char Wb35Tx_initial(struct hw_data *pHwData)
> return true;
> }
>
> -//======================================================
> void Wb35Tx_stop(struct hw_data *pHwData)
> {
> struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;
>
> - // Trying to canceling the Trp of EP2
> + /* Trying to canceling the Trp of EP2 */
> if (pWb35Tx->EP2vm_state == VM_RUNNING)
> - usb_unlink_urb(pWb35Tx->Tx2Urb); // Only use unlink, let Wb35Tx_destrot to free them
> + /* Only use unlink, let Wb35Tx_destroy to free them. */
> + usb_unlink_urb(pWb35Tx->Tx2Urb);
> pr_debug("EP2 Tx stop\n");
>
> - // Trying to canceling the Irp of EP4
> + /* Trying to canceling the Irp of EP4 */
> if (pWb35Tx->EP4vm_state == VM_RUNNING)
> - usb_unlink_urb(pWb35Tx->Tx4Urb); // Only use unlink, let Wb35Tx_destrot to free them
> + /* Only use unlink, let Wb35Tx_destroy to free them. */
> + usb_unlink_urb(pWb35Tx->Tx4Urb);
> pr_debug("EP4 Tx stop\n");
> }
>
> -//======================================================
> void Wb35Tx_destroy(struct hw_data *pHwData)
> {
> struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;
>
> - // Wait for VM stop
> + /* Wait for VM stop */
> do {
> - msleep(10); // Delay for waiting function enter 940623.1.a
> + msleep(10); /* Delay for waiting function enter 940623.1.a */
> } while ((pWb35Tx->EP2vm_state != VM_STOP) && (pWb35Tx->EP4vm_state != VM_STOP));
> - msleep(10); // Delay for waiting function enter 940623.1.b
> + msleep(10); /* Delay for waiting function enter 940623.1.b */
>
> if (pWb35Tx->Tx4Urb)
> usb_free_urb(pWb35Tx->Tx4Urb);
> @@ -210,34 +213,35 @@ static void Wb35Tx_EP2VM_complete(struct urb *pUrb)
> u16 InterruptInLength;
>
>
> - // Variable setting
> + /* Variable setting */
> pWb35Tx->EP2vm_state = VM_COMPLETED;
> pWb35Tx->EP2VM_status = pUrb->status;
>
> - // For Linux 2.4. Interrupt will always trigger
> - if (pHwData->SurpriseRemove) // Let WbWlanHalt to handle surprise remove
> + /* For Linux 2.4. Interrupt will always trigger */
> + if (pHwData->SurpriseRemove) /* Let WbWlanHalt to handle surprise remove */
> goto error;
>
> if (pWb35Tx->tx_halt)
> goto error;
>
> - //The Urb is completed, check the result
> + /* The Urb is completed, check the result */
> if (pWb35Tx->EP2VM_status != 0) {
> printk("EP2 IoCompleteRoutine return error\n");
> pWb35Tx->EP2vm_state = VM_STOP;
> goto error;
> }
>
> - // Update the Tx result
> + /* Update the Tx result */
> InterruptInLength = pUrb->actual_length;
> - // Modify for minimum memory access and DWORD alignment.
> - T02.value = cpu_to_le32(pltmp[0]) >> 8; // [31:8] -> [24:0]
> - InterruptInLength -= 1;// 20051221.1.c Modify the follow for more stable
> - InterruptInLength >>= 2; // InterruptInLength/4
> + /* Modify for minimum memory access and DWORD alignment. */
> + T02.value = cpu_to_le32(pltmp[0]) >> 8; /* [31:8] -> [24:0] */
> + /* 20051221.1.c Modify the follow for more stable */
> + InterruptInLength -= 1;
> + InterruptInLength >>= 2; /* InterruptInLength/4 */
> for (i = 1; i <= InterruptInLength; i++) {
> T02.value |= ((cpu_to_le32(pltmp[i]) & 0xff) << 24);
>
> - TSTATUS.value = T02.value; //20061009 anson's endian
> + TSTATUS.value = T02.value; /* 20061009 anson's endian */
> Mds_SendComplete(adapter, &TSTATUS);
> T02.value = cpu_to_le32(pltmp[i]) >> 8;
> }
> @@ -262,9 +266,7 @@ static void Wb35Tx_EP2VM(struct wbsoft_priv *adapter)
> if (pWb35Tx->tx_halt)
> goto error;
>
> - //
> - // Issuing URB
> - //
> + /* Issuing URB */
> usb_fill_int_urb(pUrb, pHwData->udev, usb_rcvintpipe(pHwData->udev, 2),
> pltmp, MAX_INTERRUPT_LENGTH, Wb35Tx_EP2VM_complete, adapter, 32);
>
> @@ -287,7 +289,7 @@ void Wb35Tx_EP2VM_start(struct wbsoft_priv *adapter)
> struct hw_data *pHwData = &adapter->sHwData;
> struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;
>
> - // Allow only one thread to run into function
> + /* Allow only one thread to run into function */
> if (atomic_inc_return(&pWb35Tx->TxResultCount) == 1) {
> pWb35Tx->EP2vm_state = VM_RUNNING;
> Wb35Tx_EP2VM(adapter);
> diff --git a/drivers/staging/winbond/wb35tx_s.h b/drivers/staging/winbond/wb35tx_s.h
> index f70f433..1befbcb 100644
> --- a/drivers/staging/winbond/wb35tx_s.h
> +++ b/drivers/staging/winbond/wb35tx_s.h
> @@ -3,36 +3,33 @@
>
> #include "mds_s.h"
>
> -//====================================
> -// IS89C35 Tx related definition
> -//====================================
> -#define TX_INTERFACE 0 // Interface 1
> -#define TX_PIPE 3 // endpoint 4
> -#define TX_INTERRUPT 1 // endpoint 2
> -#define MAX_INTERRUPT_LENGTH 64 // It must be 64 for EP2 hardware
> -
> -
> -
> -//====================================
> -// Internal variable for module
> -//====================================
> -
> +/*
> + * IS89C35 Tx related definition
> + */
> +#define TX_INTERFACE 0 /* Interface 1 */
> +#define TX_PIPE 3 /* endpoint 4 */
> +#define TX_INTERRUPT 1 /* endpoint 2 */
> +#define MAX_INTERRUPT_LENGTH 64 /* It must be 64 for EP2 hardware */
> +
> +/*
> + * Internal variable for module
> + */
>
> struct wb35_tx {
> - // For Tx buffer
> + /* For Tx buffer */
> u8 TxBuffer[ MAX_USB_TX_BUFFER_NUMBER ][ MAX_USB_TX_BUFFER ];
>
> - // For Interrupt pipe
> + /* For Interrupt pipe */
> u8 EP2_buf[MAX_INTERRUPT_LENGTH];
>
> - atomic_t TxResultCount;// For thread control of EP2 931130.4.m
> - atomic_t TxFireCounter;// For thread control of EP4 931130.4.n
> + atomic_t TxResultCount;/* For thread control of EP2 931130.4.m */
> + atomic_t TxFireCounter;/* For thread control of EP4 931130.4.n */
> u32 ByteTransfer;
>
> - u32 TxSendIndex;// The next index of Mds array to be sent
> - u32 EP2vm_state; // for EP2vm state
> - u32 EP4vm_state; // for EP4vm state
> - u32 tx_halt; // Stopping VM
> + u32 TxSendIndex;/* The next index of Mds array to be sent */
> + u32 EP2vm_state; /* for EP2vm state */
> + u32 EP4vm_state; /* for EP4vm state */
> + u32 tx_halt; /* Stopping VM */
>
> struct urb * Tx4Urb;
> struct urb * Tx2Urb;
> @@ -40,8 +37,8 @@ struct wb35_tx {
> int EP2VM_status;
> int EP4VM_status;
>
> - u32 TxFillCount; // 20060928
> - u32 TxTimer; // 20060928 Add if sending packet not great than 13
> + u32 TxFillCount; /* 20060928 */
> + u32 TxTimer; /* 20060928 Add if sending packet not great than 13 */
> };
>
> #endif
> --
> 1.7.5.4
>
> _______________________________________________
> devel mailing list
> devel@linuxdriverproject.org
> http://driverdev.linuxdriverproject.org/mailman/listinfo/devel
>
--
Vista: [V]iruses, [I]ntruders, [S]pyware, [T]rojans and [A]dware. :-)
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH 4/9] Staging: Winbond: Convert C99 style comments in Winbond.
2011-08-16 19:56 ` Gábor Stefanik
@ 2011-08-16 21:24 ` Pekka Enberg
2011-08-16 21:38 ` Gábor Stefanik
2011-08-16 21:43 ` Dan Carpenter
0 siblings, 2 replies; 29+ messages in thread
From: Pekka Enberg @ 2011-08-16 21:24 UTC (permalink / raw)
To: Gábor Stefanik
Cc: Akshay Joshi, Pavel Machek, Greg Kroah-Hartman,
Karthigan Srinivasan, devel, linux-kernel
2011/8/16 Gábor Stefanik <netrolller.3d@gmail.com>:
>> -
>> -//====================================
>> -// Internal variable for module
>> -//====================================
>> +/*============================================================================
>> +/* wb35rx.h --
>> +/*============================================================================
>
> I'm pretty sure this is not an accepted kernel comment style.
What's the problem? I think it's OK for this particular patch.
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH 4/9] Staging: Winbond: Convert C99 style comments in Winbond.
2011-08-16 21:24 ` Pekka Enberg
@ 2011-08-16 21:38 ` Gábor Stefanik
2011-08-16 21:40 ` Gábor Stefanik
2011-08-17 5:41 ` Pekka Enberg
2011-08-16 21:43 ` Dan Carpenter
1 sibling, 2 replies; 29+ messages in thread
From: Gábor Stefanik @ 2011-08-16 21:38 UTC (permalink / raw)
To: Pekka Enberg
Cc: Akshay Joshi, Pavel Machek, Greg Kroah-Hartman,
Karthigan Srinivasan, devel, linux-kernel
2011/8/16 Pekka Enberg <penberg@kernel.org>:
> 2011/8/16 Gábor Stefanik <netrolller.3d@gmail.com>:
>>> -
>>> -//====================================
>>> -// Internal variable for module
>>> -//====================================
>>> +/*============================================================================
>>> +/* wb35rx.h --
>>> +/*============================================================================
>>
>> I'm pretty sure this is not an accepted kernel comment style.
>
> What's the problem? I think it's OK for this particular patch.
>
The comments are not even valid C. The only reason why they do not
break is that they are immediately followed by another,
correctly-formatted (but separate) comment.
--
Vista: [V]iruses, [I]ntruders, [S]pyware, [T]rojans and [A]dware. :-)
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH 4/9] Staging: Winbond: Convert C99 style comments in Winbond.
2011-08-16 21:38 ` Gábor Stefanik
@ 2011-08-16 21:40 ` Gábor Stefanik
2011-08-17 5:41 ` Pekka Enberg
1 sibling, 0 replies; 29+ messages in thread
From: Gábor Stefanik @ 2011-08-16 21:40 UTC (permalink / raw)
To: Pekka Enberg
Cc: Akshay Joshi, Pavel Machek, Greg Kroah-Hartman,
Karthigan Srinivasan, devel, linux-kernel
2011/8/16 Gábor Stefanik <netrolller.3d@gmail.com>:
> 2011/8/16 Pekka Enberg <penberg@kernel.org>:
>> 2011/8/16 Gábor Stefanik <netrolller.3d@gmail.com>:
>>>> -
>>>> -//====================================
>>>> -// Internal variable for module
>>>> -//====================================
>>>> +/*============================================================================
>>>> +/* wb35rx.h --
>>>> +/*============================================================================
>>>
>>> I'm pretty sure this is not an accepted kernel comment style.
>>
>> What's the problem? I think it's OK for this particular patch.
>>
>
> The comments are not even valid C. The only reason why they do not
> break is that they are immediately followed by another,
> correctly-formatted (but separate) comment.
BTW, my suggested style here is the following:
/*============================================================================
* wb35rx.h --
*============================================================================*/
>
> --
> Vista: [V]iruses, [I]ntruders, [S]pyware, [T]rojans and [A]dware. :-)
>
--
Vista: [V]iruses, [I]ntruders, [S]pyware, [T]rojans and [A]dware. :-)
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH 4/9] Staging: Winbond: Convert C99 style comments in Winbond.
2011-08-16 21:24 ` Pekka Enberg
2011-08-16 21:38 ` Gábor Stefanik
@ 2011-08-16 21:43 ` Dan Carpenter
2011-08-17 0:19 ` Akshay Joshi
1 sibling, 1 reply; 29+ messages in thread
From: Dan Carpenter @ 2011-08-16 21:43 UTC (permalink / raw)
To: Pekka Enberg
Cc: Gábor Stefanik, devel, Greg Kroah-Hartman, Akshay Joshi,
linux-kernel, Karthigan Srinivasan, Pavel Machek
On Wed, Aug 17, 2011 at 12:24:06AM +0300, Pekka Enberg wrote:
> 2011/8/16 Gábor Stefanik <netrolller.3d@gmail.com>:
> >> -
> >> -//====================================
> >> -// Internal variable for module
> >> -//====================================
> >> +/*============================================================================
> >> +/* wb35rx.h --
> >> +/*============================================================================
> >
> > I'm pretty sure this is not an accepted kernel comment style.
>
> What's the problem? I think it's OK for this particular patch.
There are a five start open comment "/*" marks in a row that don't
have a matching close comment.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH 4/9] Staging: Winbond: Convert C99 style comments in Winbond.
2011-08-16 21:43 ` Dan Carpenter
@ 2011-08-17 0:19 ` Akshay Joshi
0 siblings, 0 replies; 29+ messages in thread
From: Akshay Joshi @ 2011-08-17 0:19 UTC (permalink / raw)
To: Dan Carpenter, Pekka Enberg, Gábor Stefanik, devel,
Greg Kroah-Hartman, linux-kernel, Karthigan Srinivasan,
Pavel Machek
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=UTF-8, Size: 1039 bytes --]
Sorry about that, everyone. I'll roll a fix in the next few hours.
Akshay
On Tue, Aug 16, 2011 at 5:43 PM, Dan Carpenter <error27@gmail.com> wrote:
> On Wed, Aug 17, 2011 at 12:24:06AM +0300, Pekka Enberg wrote:
>> 2011/8/16 Gábor Stefanik <netrolller.3d@gmail.com>:
>> >> -
>> >> -//====================================
>> >> -// Internal variable for module
>> >> -//====================================
>> >> +/*============================================================================
>> >> +/* wb35rx.h --
>> >> +/*============================================================================
>> >
>> > I'm pretty sure this is not an accepted kernel comment style.
>>
>> What's the problem? I think it's OK for this particular patch.
>
> There are a five start open comment "/*" marks in a row that don't
> have a matching close comment.
>
> regards,
> dan carpenter
>
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH 4/9] Staging: Winbond: Convert C99 style comments in Winbond.
2011-08-16 21:38 ` Gábor Stefanik
2011-08-16 21:40 ` Gábor Stefanik
@ 2011-08-17 5:41 ` Pekka Enberg
2011-08-17 19:15 ` Akshay Joshi
1 sibling, 1 reply; 29+ messages in thread
From: Pekka Enberg @ 2011-08-17 5:41 UTC (permalink / raw)
To: Gábor Stefanik
Cc: Akshay Joshi, Pavel Machek, Greg Kroah-Hartman,
Karthigan Srinivasan, devel, linux-kernel
On 8/17/11 12:38 AM, Gábor Stefanik wrote:
> 2011/8/16 Pekka Enberg<penberg@kernel.org>:
>> 2011/8/16 Gábor Stefanik<netrolller.3d@gmail.com>:
>>>> -
>>>> -//====================================
>>>> -// Internal variable for module
>>>> -//====================================
>>>> +/*============================================================================
>>>> +/* wb35rx.h --
>>>> +/*============================================================================
>>> I'm pretty sure this is not an accepted kernel comment style.
>> What's the problem? I think it's OK for this particular patch.
>>
> The comments are not even valid C. The only reason why they do not
> break is that they are immediately followed by another,
> correctly-formatted (but separate) comment.
Aah, amazing how I was able to miss that!
Akshay, I suppose you didn't compile-test the patches? Please don't
send patches like that on LKML. It's a huge waste of time for reviewers.
Pekka
^ permalink raw reply [flat|nested] 29+ messages in thread
* [PATCH 4/9] Staging: Winbond: Convert C99 style comments in Winbond.
2011-08-17 5:41 ` Pekka Enberg
@ 2011-08-17 19:15 ` Akshay Joshi
2011-08-17 19:17 ` Akshay Joshi
0 siblings, 1 reply; 29+ messages in thread
From: Akshay Joshi @ 2011-08-17 19:15 UTC (permalink / raw)
To: Pavel Machek, Greg Kroah-Hartman, Akshay Joshi, Pekka Enberg,
Karthigan Srinivasan, devel, linux-kernel
Cc: Dan Carpenter, Gabor Stefanik
Converted all of the C99 style comments in the Winbond driver to the
kernel-accepted multiline stlye.
Signed-off-by: Akshay Joshi <me@akshayjoshi.com>
---
drivers/staging/winbond/wb35rx_f.h | 6 +-
drivers/staging/winbond/wb35rx_s.h | 51 ++++++++++----------
drivers/staging/winbond/wb35tx.c | 92 ++++++++++++++++++-----------------
drivers/staging/winbond/wb35tx_s.h | 45 ++++++++---------
4 files changed, 96 insertions(+), 98 deletions(-)
diff --git a/drivers/staging/winbond/wb35rx_f.h b/drivers/staging/winbond/wb35rx_f.h
index 1fdf65e..bb408e9 100644
--- a/drivers/staging/winbond/wb35rx_f.h
+++ b/drivers/staging/winbond/wb35rx_f.h
@@ -4,9 +4,9 @@
#include <net/mac80211.h>
#include "wbhal.h"
-//====================================
-// Interface function declare
-//====================================
+/*
+ * Interface function declare
+ */
unsigned char Wb35Rx_initial( struct hw_data * pHwData );
void Wb35Rx_destroy( struct hw_data * pHwData );
void Wb35Rx_stop( struct hw_data * pHwData );
diff --git a/drivers/staging/winbond/wb35rx_s.h b/drivers/staging/winbond/wb35rx_s.h
index 4b03274..2681ffa 100644
--- a/drivers/staging/winbond/wb35rx_s.h
+++ b/drivers/staging/winbond/wb35rx_s.h
@@ -1,43 +1,42 @@
-//============================================================================
-// wb35rx.h --
-//============================================================================
-
-// Definition for this module used
-#define MAX_USB_RX_BUFFER 4096 // This parameter must be 4096 931130.4.f
-
-#define MAX_USB_RX_BUFFER_NUMBER ETHERNET_RX_DESCRIPTORS // Maximum 254, 255 is RESERVED ID
-#define RX_INTERFACE 0 // Interface 1
-#define RX_PIPE 2 // Pipe 3
-#define MAX_PACKET_SIZE 1600 //1568 // 8 + 1532 + 4 + 24(IV EIV MIC ICV CRC) for check DMA data 931130.4.g
-#define RX_END_TAG 0x0badbeef
-
-
-//====================================
-// Internal variable for module
-//====================================
+/*============================================================================
+ * wb35rx.h --
+ * ==========================================================================*/
+
+/* Definition for this module used */
+#define MAX_USB_RX_BUFFER 4096 /* This parameter must be 4096 931130.4.f */
+
+#define MAX_USB_RX_BUFFER_NUMBER ETHERNET_RX_DESCRIPTORS /* Maximum 254, 255 is RESERVED ID */
+#define RX_INTERFACE 0 /* Interface 1 */
+#define RX_PIPE 2 /* Pipe 3 */
+#define MAX_PACKET_SIZE 1600 /*1568: 8 + 1532 + 4 + 24(IV EIV MIC ICV CRC) for check DMA data 931130.4.g */
+#define RX_END_TAG 0x0badbeef
+
+/*
+ * Internal variable for module
+ */
struct wb35_rx {
- u32 ByteReceived;// For calculating throughput of BulkIn
- atomic_t RxFireCounter;// Does Wb35Rx module fire?
+ u32 ByteReceived;/* For calculating throughput of BulkIn */
+ atomic_t RxFireCounter;/* Does Wb35Rx module fire? */
u8 RxBuffer[ MAX_USB_RX_BUFFER_NUMBER ][ ((MAX_USB_RX_BUFFER+3) & ~0x03 ) ];
+ /* Ownership of buffer 0: SW 1:HW */
u16 RxBufferSize[ ((MAX_USB_RX_BUFFER_NUMBER+1) & ~0x01) ];
- u8 RxOwner[ ((MAX_USB_RX_BUFFER_NUMBER+3) & ~0x03 ) ];//Ownership of buffer 0: SW 1:HW
-
- u32 RxProcessIndex;//The next index to process
+ u8 RxOwner[ ((MAX_USB_RX_BUFFER_NUMBER+3) & ~0x03 ) ];
+ u32 RxProcessIndex; /* The next index to process */
u32 RxBufferId;
u32 EP3vm_state;
- u32 rx_halt; // For VM stopping
+ u32 rx_halt; /* For VM stopping */
u16 MoreDataSize;
u16 PacketSize;
- u32 CurrentRxBufferId; // For complete routine usage
+ u32 CurrentRxBufferId; /* For complete routine usage */
u32 Rx3UrbCancel;
- u32 LastR1; // For RSSI reporting
+ u32 LastR1; /* For RSSI reporting */
struct urb * RxUrb;
- u32 Ep3ErrorCount2; // 20060625.1 Usbd for Rx DMA error count
+ u32 Ep3ErrorCount2; /* 20060625.1 Usbd for Rx DMA error count */
int EP3VM_status;
u8 * pDRx;
diff --git a/drivers/staging/winbond/wb35tx.c b/drivers/staging/winbond/wb35tx.c
index 49a43c1..a8dd4c9 100644
--- a/drivers/staging/winbond/wb35tx.c
+++ b/drivers/staging/winbond/wb35tx.c
@@ -1,13 +1,13 @@
-//============================================================================
-// Copyright (c) 1996-2002 Winbond Electronic Corporation
-//
-// Module Name:
-// Wb35Tx.c
-//
-// Abstract:
-// Processing the Tx message and put into down layer
-//
-//============================================================================
+/*============================================================================
+ * Copyright (c) 1996-2002 Winbond Electronic Corporation
+ *
+ * Module Name:
+ * Wb35Tx.c
+ *
+ * Abstract:
+ * Processing the Tx message and put into down layer
+ *
+*/
#include <linux/usb.h>
#include <linux/gfp.h>
@@ -33,20 +33,22 @@ static void Wb35Tx_complete(struct urb *pUrb)
struct wb35_mds *pMds = &adapter->Mds;
printk("wb35: tx complete\n");
- // Variable setting
+ /* Variable setting */
pWb35Tx->EP4vm_state = VM_COMPLETED;
- pWb35Tx->EP4VM_status = pUrb->status; //Store the last result of Irp
- pMds->TxOwner[pWb35Tx->TxSendIndex] = 0;// Set the owner. Free the owner bit always.
+ pWb35Tx->EP4VM_status = pUrb->status; /* Store the last result of Irp */
+ /* Set the owner. Free the owner bit always. */
+ pMds->TxOwner[pWb35Tx->TxSendIndex] = 0;
pWb35Tx->TxSendIndex++;
pWb35Tx->TxSendIndex %= MAX_USB_TX_BUFFER_NUMBER;
- if (pHwData->SurpriseRemove) // Let WbWlanHalt to handle surprise remove
+ /* Let WbWlanHalt to handle surprise remove */
+ if (pHwData->SurpriseRemove)
goto error;
if (pWb35Tx->tx_halt)
goto error;
- // The URB is completed, check the result
+ /* The URB is completed, check the result */
if (pWb35Tx->EP4VM_status != 0) {
printk("URB submission failed\n");
pWb35Tx->EP4vm_state = VM_STOP;
@@ -79,15 +81,16 @@ static void Wb35Tx(struct wbsoft_priv *adapter)
if (pWb35Tx->tx_halt)
goto cleanup;
- // Ownership checking
+ /* Ownership checking */
SendIndex = pWb35Tx->TxSendIndex;
- if (!pMds->TxOwner[SendIndex]) //No more data need to be sent, return immediately
+ if (!pMds->TxOwner[SendIndex])
+ /* No more data need to be sent, return immediately. */
goto cleanup;
pTxBufferAddress = pWb35Tx->TxBuffer[SendIndex];
- //
- // Issuing URB
- //
+
+ /* Issuing URB */
+
usb_fill_bulk_urb(pUrb, pHwData->udev,
usb_sndbulkpipe(pHwData->udev, 4),
pTxBufferAddress, pMds->TxBufferSize[SendIndex],
@@ -100,7 +103,7 @@ static void Wb35Tx(struct wbsoft_priv *adapter)
goto cleanup;
}
- // Check if driver needs issue Irp for EP2
+ /* Check if driver needs issue Irp for EP2 */
pWb35Tx->TxFillCount += pMds->TxCountInBuffer[SendIndex];
if (pWb35Tx->TxFillCount > 12)
Wb35Tx_EP2VM_start(adapter);
@@ -118,7 +121,7 @@ void Wb35Tx_start(struct wbsoft_priv *adapter)
struct hw_data *pHwData = &adapter->sHwData;
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;
- // Allow only one thread to run into function
+ /* Allow only one thread to run into function */
if (atomic_inc_return(&pWb35Tx->TxFireCounter) == 1) {
pWb35Tx->EP4vm_state = VM_RUNNING;
Wb35Tx(adapter);
@@ -144,32 +147,32 @@ unsigned char Wb35Tx_initial(struct hw_data *pHwData)
return true;
}
-//======================================================
void Wb35Tx_stop(struct hw_data *pHwData)
{
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;
- // Trying to canceling the Trp of EP2
+ /* Trying to canceling the Trp of EP2 */
if (pWb35Tx->EP2vm_state == VM_RUNNING)
- usb_unlink_urb(pWb35Tx->Tx2Urb); // Only use unlink, let Wb35Tx_destrot to free them
+ /* Only use unlink, let Wb35Tx_destroy to free them. */
+ usb_unlink_urb(pWb35Tx->Tx2Urb);
pr_debug("EP2 Tx stop\n");
- // Trying to canceling the Irp of EP4
+ /* Trying to canceling the Irp of EP4 */
if (pWb35Tx->EP4vm_state == VM_RUNNING)
- usb_unlink_urb(pWb35Tx->Tx4Urb); // Only use unlink, let Wb35Tx_destrot to free them
+ /* Only use unlink, let Wb35Tx_destroy to free them. */
+ usb_unlink_urb(pWb35Tx->Tx4Urb);
pr_debug("EP4 Tx stop\n");
}
-//======================================================
void Wb35Tx_destroy(struct hw_data *pHwData)
{
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;
- // Wait for VM stop
+ /* Wait for VM stop */
do {
- msleep(10); // Delay for waiting function enter 940623.1.a
+ msleep(10); /* Delay for waiting function enter 940623.1.a */
} while ((pWb35Tx->EP2vm_state != VM_STOP) && (pWb35Tx->EP4vm_state != VM_STOP));
- msleep(10); // Delay for waiting function enter 940623.1.b
+ msleep(10); /* Delay for waiting function enter 940623.1.b */
if (pWb35Tx->Tx4Urb)
usb_free_urb(pWb35Tx->Tx4Urb);
@@ -210,34 +213,35 @@ static void Wb35Tx_EP2VM_complete(struct urb *pUrb)
u16 InterruptInLength;
- // Variable setting
+ /* Variable setting */
pWb35Tx->EP2vm_state = VM_COMPLETED;
pWb35Tx->EP2VM_status = pUrb->status;
- // For Linux 2.4. Interrupt will always trigger
- if (pHwData->SurpriseRemove) // Let WbWlanHalt to handle surprise remove
+ /* For Linux 2.4. Interrupt will always trigger */
+ if (pHwData->SurpriseRemove) /* Let WbWlanHalt to handle surprise remove */
goto error;
if (pWb35Tx->tx_halt)
goto error;
- //The Urb is completed, check the result
+ /* The Urb is completed, check the result */
if (pWb35Tx->EP2VM_status != 0) {
printk("EP2 IoCompleteRoutine return error\n");
pWb35Tx->EP2vm_state = VM_STOP;
goto error;
}
- // Update the Tx result
+ /* Update the Tx result */
InterruptInLength = pUrb->actual_length;
- // Modify for minimum memory access and DWORD alignment.
- T02.value = cpu_to_le32(pltmp[0]) >> 8; // [31:8] -> [24:0]
- InterruptInLength -= 1;// 20051221.1.c Modify the follow for more stable
- InterruptInLength >>= 2; // InterruptInLength/4
+ /* Modify for minimum memory access and DWORD alignment. */
+ T02.value = cpu_to_le32(pltmp[0]) >> 8; /* [31:8] -> [24:0] */
+ /* 20051221.1.c Modify the follow for more stable */
+ InterruptInLength -= 1;
+ InterruptInLength >>= 2; /* InterruptInLength/4 */
for (i = 1; i <= InterruptInLength; i++) {
T02.value |= ((cpu_to_le32(pltmp[i]) & 0xff) << 24);
- TSTATUS.value = T02.value; //20061009 anson's endian
+ TSTATUS.value = T02.value; /* 20061009 anson's endian */
Mds_SendComplete(adapter, &TSTATUS);
T02.value = cpu_to_le32(pltmp[i]) >> 8;
}
@@ -262,9 +266,7 @@ static void Wb35Tx_EP2VM(struct wbsoft_priv *adapter)
if (pWb35Tx->tx_halt)
goto error;
- //
- // Issuing URB
- //
+ /* Issuing URB */
usb_fill_int_urb(pUrb, pHwData->udev, usb_rcvintpipe(pHwData->udev, 2),
pltmp, MAX_INTERRUPT_LENGTH, Wb35Tx_EP2VM_complete, adapter, 32);
@@ -287,7 +289,7 @@ void Wb35Tx_EP2VM_start(struct wbsoft_priv *adapter)
struct hw_data *pHwData = &adapter->sHwData;
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;
- // Allow only one thread to run into function
+ /* Allow only one thread to run into function */
if (atomic_inc_return(&pWb35Tx->TxResultCount) == 1) {
pWb35Tx->EP2vm_state = VM_RUNNING;
Wb35Tx_EP2VM(adapter);
diff --git a/drivers/staging/winbond/wb35tx_s.h b/drivers/staging/winbond/wb35tx_s.h
index f70f433..1befbcb 100644
--- a/drivers/staging/winbond/wb35tx_s.h
+++ b/drivers/staging/winbond/wb35tx_s.h
@@ -3,36 +3,33 @@
#include "mds_s.h"
-//====================================
-// IS89C35 Tx related definition
-//====================================
-#define TX_INTERFACE 0 // Interface 1
-#define TX_PIPE 3 // endpoint 4
-#define TX_INTERRUPT 1 // endpoint 2
-#define MAX_INTERRUPT_LENGTH 64 // It must be 64 for EP2 hardware
-
-
-
-//====================================
-// Internal variable for module
-//====================================
-
+/*
+ * IS89C35 Tx related definition
+ */
+#define TX_INTERFACE 0 /* Interface 1 */
+#define TX_PIPE 3 /* endpoint 4 */
+#define TX_INTERRUPT 1 /* endpoint 2 */
+#define MAX_INTERRUPT_LENGTH 64 /* It must be 64 for EP2 hardware */
+
+/*
+ * Internal variable for module
+ */
struct wb35_tx {
- // For Tx buffer
+ /* For Tx buffer */
u8 TxBuffer[ MAX_USB_TX_BUFFER_NUMBER ][ MAX_USB_TX_BUFFER ];
- // For Interrupt pipe
+ /* For Interrupt pipe */
u8 EP2_buf[MAX_INTERRUPT_LENGTH];
- atomic_t TxResultCount;// For thread control of EP2 931130.4.m
- atomic_t TxFireCounter;// For thread control of EP4 931130.4.n
+ atomic_t TxResultCount;/* For thread control of EP2 931130.4.m */
+ atomic_t TxFireCounter;/* For thread control of EP4 931130.4.n */
u32 ByteTransfer;
- u32 TxSendIndex;// The next index of Mds array to be sent
- u32 EP2vm_state; // for EP2vm state
- u32 EP4vm_state; // for EP4vm state
- u32 tx_halt; // Stopping VM
+ u32 TxSendIndex;/* The next index of Mds array to be sent */
+ u32 EP2vm_state; /* for EP2vm state */
+ u32 EP4vm_state; /* for EP4vm state */
+ u32 tx_halt; /* Stopping VM */
struct urb * Tx4Urb;
struct urb * Tx2Urb;
@@ -40,8 +37,8 @@ struct wb35_tx {
int EP2VM_status;
int EP4VM_status;
- u32 TxFillCount; // 20060928
- u32 TxTimer; // 20060928 Add if sending packet not great than 13
+ u32 TxFillCount; /* 20060928 */
+ u32 TxTimer; /* 20060928 Add if sending packet not great than 13 */
};
#endif
--
1.7.5.4
^ permalink raw reply related [flat|nested] 29+ messages in thread
* Re: [PATCH 4/9] Staging: Winbond: Convert C99 style comments in Winbond.
2011-08-17 19:15 ` Akshay Joshi
@ 2011-08-17 19:17 ` Akshay Joshi
2011-08-17 21:08 ` Dan Carpenter
0 siblings, 1 reply; 29+ messages in thread
From: Akshay Joshi @ 2011-08-17 19:17 UTC (permalink / raw)
To: Pavel Machek, Greg Kroah-Hartman, Akshay Joshi, Pekka Enberg,
Karthigan Srinivasan, devel, linux-kernel
This updated patch should fix the comment concerns.
Pekka, I did compile-test it, but it slipped through since the comment
was followed by another comment and not a line of code.
Once again, sorry about that.
Akshay
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH 4/9] Staging: Winbond: Convert C99 style comments in Winbond.
2011-08-17 19:17 ` Akshay Joshi
@ 2011-08-17 21:08 ` Dan Carpenter
0 siblings, 0 replies; 29+ messages in thread
From: Dan Carpenter @ 2011-08-17 21:08 UTC (permalink / raw)
To: Akshay Joshi
Cc: Pavel Machek, Greg Kroah-Hartman, Pekka Enberg,
Karthigan Srinivasan, devel, linux-kernel
On Wed, Aug 17, 2011 at 03:17:01PM -0400, Akshay Joshi wrote:
> This updated patch should fix the comment concerns.
>
> Pekka, I did compile-test it, but it slipped through since the comment
> was followed by another comment and not a line of code.
>
It compiles correctly, but there is a gcc warning:
CC [M] drivers/staging/winbond/mds.o
In file included from drivers/staging/winbond/wbhal.h:361:0,
from drivers/staging/winbond/mds_f.h:4,
from drivers/staging/winbond/mds.c:1:
drivers/staging/winbond/wb35rx_s.h:2:1: warning: "/*" within comment
drivers/staging/winbond/wb35rx_s.h:3:1: warning: "/*" within comment
drivers/staging/winbond/wb35rx_s.h:5:1: warning: "/*" within comment
That's with gcc 4.5.1-4.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH 1/9] Staging: Winbond: Fix case statements in wb35reg.c.
2011-08-16 0:24 [PATCH 1/9] Staging: Winbond: Fix case statements in wb35reg.c Akshay Joshi
` (8 preceding siblings ...)
2011-08-16 5:41 ` [PATCH 1/9] Staging: Winbond: Fix case statements in wb35reg.c Pekka Enberg
@ 2011-08-23 22:27 ` Greg KH
9 siblings, 0 replies; 29+ messages in thread
From: Greg KH @ 2011-08-23 22:27 UTC (permalink / raw)
To: Akshay Joshi
Cc: Pavel Machek, Greg Kroah-Hartman, Pekka Enberg, Ilia Mirkin,
devel, linux-kernel
On Mon, Aug 15, 2011 at 08:24:27PM -0400, Akshay Joshi wrote:
> Split the case statement and the code that is executed if the condition
> is met so that it passes checkpatch.pl and conforms to the kernel code
> style.
Not quite.
Please put the 'break;' on a new line for every case statement.
Care to redo this whole series based on the review comments you got so
far and resend them?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 29+ messages in thread
end of thread, other threads:[~2011-08-23 22:28 UTC | newest]
Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-16 0:24 [PATCH 1/9] Staging: Winbond: Fix case statements in wb35reg.c Akshay Joshi
2011-08-16 0:24 ` [PATCH 2/9] Staging: Winbond: Fix pointer style in wb35tx.c Akshay Joshi
2011-08-16 5:41 ` Pekka Enberg
2011-08-16 0:24 ` [PATCH 3/9] Staging: Winbond: Fix space issues " Akshay Joshi
2011-08-16 5:42 ` Pekka Enberg
2011-08-16 0:24 ` [PATCH 4/9] Staging: Winbond: Convert C99 style comments in Winbond Akshay Joshi
2011-08-16 5:42 ` Pekka Enberg
2011-08-16 19:56 ` Gábor Stefanik
2011-08-16 21:24 ` Pekka Enberg
2011-08-16 21:38 ` Gábor Stefanik
2011-08-16 21:40 ` Gábor Stefanik
2011-08-17 5:41 ` Pekka Enberg
2011-08-17 19:15 ` Akshay Joshi
2011-08-17 19:17 ` Akshay Joshi
2011-08-17 21:08 ` Dan Carpenter
2011-08-16 21:43 ` Dan Carpenter
2011-08-17 0:19 ` Akshay Joshi
2011-08-16 0:24 ` [PATCH 5/9] Staging: Winbond: Fix spacing issues for spaces before tabs Akshay Joshi
2011-08-16 5:43 ` Pekka Enberg
2011-08-16 0:24 ` [PATCH 6/9] Staging: Winbond: Remove spacing issues related to pointers Akshay Joshi
2011-08-16 5:45 ` Pekka Enberg
2011-08-16 0:24 ` [PATCH 7/9] Staging: Winbond: Fix parentheses in returns Akshay Joshi
2011-08-16 5:45 ` Pekka Enberg
2011-08-16 0:24 ` [PATCH 8/9] Staging: Winbond: Use tabs instead of spaces for indents Akshay Joshi
2011-08-16 5:46 ` Pekka Enberg
2011-08-16 0:24 ` [PATCH 9/9] Staging: Winbond: Reposition a curly bracket Akshay Joshi
2011-08-16 5:46 ` Pekka Enberg
2011-08-16 5:41 ` [PATCH 1/9] Staging: Winbond: Fix case statements in wb35reg.c Pekka Enberg
2011-08-23 22:27 ` Greg KH
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.