* [PATCH 0/6] beeceem: Checkpatch cleanups in InterfaceRx.c
@ 2014-01-08 22:15 Matthias Oefelein
2014-01-08 22:15 ` [PATCH 1/6] beeceem: Fix missing spaces around operators and unwanted spaces around semicolons " Matthias Oefelein
` (5 more replies)
0 siblings, 6 replies; 8+ messages in thread
From: Matthias Oefelein @ 2014-01-08 22:15 UTC (permalink / raw)
To: ma.oefelein; +Cc: linux-kernel, linux-kernel, gregkh, lisa, devel, linux-kernel
This patch series eliminates several issues in InterfaceRx.c of the beeceem driver that have been reported by checkpatch.
The following issues are taken care of:
- Missing spaces around operators
- Prohibited spaces before semicolons
- Missing spaces between function arguments
- Tab/intendation mishaps
- Missing spaces at opening parentheses
- Unwanted newlines before opening braces of conditional statements
- C99 comments
Lines with lengths over 80 characters still remain.
No functional changes have been made.
--
1.8.1.2
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/6] beeceem: Fix missing spaces around operators and unwanted spaces around semicolons in InterfaceRx.c
2014-01-08 22:15 [PATCH 0/6] beeceem: Checkpatch cleanups in InterfaceRx.c Matthias Oefelein
@ 2014-01-08 22:15 ` Matthias Oefelein
2014-01-08 22:15 ` [PATCH 2/6] beeceem: Fix missing spaces between function arguments " Matthias Oefelein
` (4 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Matthias Oefelein @ 2014-01-08 22:15 UTC (permalink / raw)
To: ma.oefelein; +Cc: linux-kernel, linux-kernel, gregkh, lisa, devel, linux-kernel
Checkpatch reports missing spaces around operators; this patch introduces spaces where needed.
Spaces before semicolons are prohibited by the official coding style guidelines, those have been fixed as well.
Signed-off-by: Matthias Oefelein <ma.oefelein@arcor.de>
Signed-off-by: Ralph Mueck <linux-kernel@rmueck.de>
---
drivers/staging/bcm/InterfaceRx.c | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/drivers/staging/bcm/InterfaceRx.c b/drivers/staging/bcm/InterfaceRx.c
index f2973f5..55f7436 100644
--- a/drivers/staging/bcm/InterfaceRx.c
+++ b/drivers/staging/bcm/InterfaceRx.c
@@ -2,9 +2,9 @@
static int SearchVcid(struct bcm_mini_adapter *Adapter,unsigned short usVcid)
{
- int iIndex=0;
+ int iIndex = 0;
- for(iIndex=(NO_OF_QUEUES-1);iIndex>=0;iIndex--)
+ for(iIndex = (NO_OF_QUEUES-1); iIndex >= 0; iIndex--)
if(Adapter->PackInfo[iIndex].usVCID_Value == usVcid)
return iIndex;
return NO_OF_QUEUES+1;
@@ -24,7 +24,7 @@ GetBulkInRcb(struct bcm_interface_adapter *psIntfAdapter)
index = atomic_read(&psIntfAdapter->uCurrRcb);
pRcb = &psIntfAdapter->asUsbRcb[index];
pRcb->bUsed = TRUE;
- pRcb->psIntfAdapter= psIntfAdapter;
+ pRcb->psIntfAdapter = psIntfAdapter;
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_RX, RX_DPC, DBG_LVL_ALL, "Got Rx desc %d used %d",
index, atomic_read(&psIntfAdapter->uNumRcbUsed));
index = (index + 1) % MAXIMUM_USB_RCB;
@@ -40,7 +40,7 @@ static void read_bulk_callback(struct urb *urb)
struct sk_buff *skb = NULL;
bool bHeaderSupressionEnabled = false;
int QueueIndex = NO_OF_QUEUES + 1;
- UINT uiIndex=0;
+ UINT uiIndex = 0;
int process_done = 1;
//int idleflag = 0 ;
struct bcm_usb_rcb *pRcb = (struct bcm_usb_rcb *)urb->context;
@@ -66,7 +66,7 @@ static void read_bulk_callback(struct urb *urb)
{
if(urb->status == -EPIPE)
{
- Adapter->bEndPointHalted = TRUE ;
+ Adapter->bEndPointHalted = TRUE;
wake_up(&Adapter->tx_packet_wait_queue);
}
else
@@ -75,14 +75,14 @@ static void read_bulk_callback(struct urb *urb)
}
pRcb->bUsed = false;
atomic_dec(&psIntfAdapter->uNumRcbUsed);
- urb->status = STATUS_SUCCESS ;
- return ;
+ urb->status = STATUS_SUCCESS;
+ return;
}
if(Adapter->bDoSuspend && (Adapter->bPreparingForLowPowerMode))
{
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_RX, RX_DPC, DBG_LVL_ALL,"device is going in low power mode while PMU option selected..hence rx packet should not be process");
- return ;
+ return;
}
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_RX, RX_DPC, DBG_LVL_ALL, "Read back done len %d\n", pLeader->PLength);
@@ -149,8 +149,8 @@ static void read_bulk_callback(struct urb *urb)
/* currently skb->len has extra ETH_HLEN bytes in the beginning */
skb_put (skb, pLeader->PLength + ETH_HLEN);
- Adapter->PackInfo[QueueIndex].uiTotalRxBytes+=pLeader->PLength;
- Adapter->PackInfo[QueueIndex].uiThisPeriodRxBytes+= pLeader->PLength;
+ Adapter->PackInfo[QueueIndex].uiTotalRxBytes += pLeader->PLength;
+ Adapter->PackInfo[QueueIndex].uiThisPeriodRxBytes += pLeader->PLength;
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_RX, RX_DATA, DBG_LVL_ALL, "Received Data pkt of len :0x%X", pLeader->PLength);
if(netif_running(Adapter->dev))
@@ -169,7 +169,7 @@ static void read_bulk_callback(struct urb *urb)
(*(skb->data+11))++;
*(skb->data+12) = 0x08;
*(skb->data+13) = 0x00;
- pLeader->PLength+=ETH_HLEN;
+ pLeader->PLength += ETH_HLEN;
}
skb->protocol = eth_type_trans(skb, Adapter->dev);
@@ -184,7 +184,7 @@ static void read_bulk_callback(struct urb *urb)
++Adapter->dev->stats.rx_packets;
Adapter->dev->stats.rx_bytes += pLeader->PLength;
- for(uiIndex = 0 ; uiIndex < MIBS_MAX_HIST_ENTRIES ; uiIndex++)
+ for(uiIndex = 0; uiIndex < MIBS_MAX_HIST_ENTRIES; uiIndex++)
{
if((pLeader->PLength <= MIBS_PKTSIZEHIST_RANGE*(uiIndex+1))
&& (pLeader->PLength > MIBS_PKTSIZEHIST_RANGE*(uiIndex)))
@@ -217,7 +217,7 @@ static int ReceiveRcb(struct bcm_interface_adapter *psIntfAdapter, struct bcm_us
//if this return value is because of pipe halt. need to clear this.
if(retval == -EPIPE)
{
- psIntfAdapter->psAdapter->bEndPointHalted = TRUE ;
+ psIntfAdapter->psAdapter->bEndPointHalted = TRUE;
wake_up(&psIntfAdapter->psAdapter->tx_packet_wait_queue);
}
--
1.8.1.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/6] beeceem: Fix missing spaces between function arguments in InterfaceRx.c
2014-01-08 22:15 [PATCH 0/6] beeceem: Checkpatch cleanups in InterfaceRx.c Matthias Oefelein
2014-01-08 22:15 ` [PATCH 1/6] beeceem: Fix missing spaces around operators and unwanted spaces around semicolons " Matthias Oefelein
@ 2014-01-08 22:15 ` Matthias Oefelein
2014-01-08 22:15 ` [PATCH 3/6] beeceem: Fix broken indentations " Matthias Oefelein
` (3 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Matthias Oefelein @ 2014-01-08 22:15 UTC (permalink / raw)
To: ma.oefelein; +Cc: linux-kernel, linux-kernel, gregkh, lisa, devel, linux-kernel
This fix adds missing spaces after commas in function calls/definitions.
Signed-off-by: Matthias Oefelein <ma.oefelein@arcor.de>
Signed-off-by: Ralph Mueck <linux-kernel@rmueck.de>
---
drivers/staging/bcm/InterfaceRx.c | 34 +++++++++++++++++-----------------
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/drivers/staging/bcm/InterfaceRx.c b/drivers/staging/bcm/InterfaceRx.c
index 55f7436..aa1df66 100644
--- a/drivers/staging/bcm/InterfaceRx.c
+++ b/drivers/staging/bcm/InterfaceRx.c
@@ -1,6 +1,6 @@
#include "headers.h"
-static int SearchVcid(struct bcm_mini_adapter *Adapter,unsigned short usVcid)
+static int SearchVcid(struct bcm_mini_adapter *Adapter, unsigned short usVcid)
{
int iIndex = 0;
@@ -25,7 +25,7 @@ GetBulkInRcb(struct bcm_interface_adapter *psIntfAdapter)
pRcb = &psIntfAdapter->asUsbRcb[index];
pRcb->bUsed = TRUE;
pRcb->psIntfAdapter = psIntfAdapter;
- BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_RX, RX_DPC, DBG_LVL_ALL, "Got Rx desc %d used %d",
+ BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_RX, RX_DPC, DBG_LVL_ALL, "Got Rx desc %d used %d",
index, atomic_read(&psIntfAdapter->uNumRcbUsed));
index = (index + 1) % MAXIMUM_USB_RCB;
atomic_set(&psIntfAdapter->uCurrRcb, index);
@@ -71,7 +71,7 @@ static void read_bulk_callback(struct urb *urb)
}
else
{
- BCM_DEBUG_PRINT(Adapter,DBG_TYPE_RX, RX_DPC, DBG_LVL_ALL,"Rx URB has got cancelled. status :%d", urb->status);
+ BCM_DEBUG_PRINT(Adapter, DBG_TYPE_RX, RX_DPC, DBG_LVL_ALL, "Rx URB has got cancelled. status :%d", urb->status);
}
pRcb->bUsed = false;
atomic_dec(&psIntfAdapter->uNumRcbUsed);
@@ -81,18 +81,18 @@ static void read_bulk_callback(struct urb *urb)
if(Adapter->bDoSuspend && (Adapter->bPreparingForLowPowerMode))
{
- BCM_DEBUG_PRINT(Adapter,DBG_TYPE_RX, RX_DPC, DBG_LVL_ALL,"device is going in low power mode while PMU option selected..hence rx packet should not be process");
+ BCM_DEBUG_PRINT(Adapter, DBG_TYPE_RX, RX_DPC, DBG_LVL_ALL, "device is going in low power mode while PMU option selected..hence rx packet should not be process");
return;
}
- BCM_DEBUG_PRINT(Adapter,DBG_TYPE_RX, RX_DPC, DBG_LVL_ALL, "Read back done len %d\n", pLeader->PLength);
+ BCM_DEBUG_PRINT(Adapter, DBG_TYPE_RX, RX_DPC, DBG_LVL_ALL, "Read back done len %d\n", pLeader->PLength);
if(!pLeader->PLength)
{
- BCM_DEBUG_PRINT(Adapter,DBG_TYPE_RX, RX_DPC, DBG_LVL_ALL, "Leader Length 0");
+ BCM_DEBUG_PRINT(Adapter, DBG_TYPE_RX, RX_DPC, DBG_LVL_ALL, "Leader Length 0");
atomic_dec(&psIntfAdapter->uNumRcbUsed);
return;
}
- BCM_DEBUG_PRINT(Adapter,DBG_TYPE_RX, RX_DPC, DBG_LVL_ALL, "Leader Status:0x%hX, Length:0x%hX, VCID:0x%hX", pLeader->Status,pLeader->PLength,pLeader->Vcid);
+ BCM_DEBUG_PRINT(Adapter, DBG_TYPE_RX, RX_DPC, DBG_LVL_ALL, "Leader Status:0x%hX, Length:0x%hX, VCID:0x%hX", pLeader->Status, pLeader->PLength, pLeader->Vcid);
if(MAX_CNTL_PKT_SIZE < pLeader->PLength)
{
if (netif_msg_rx_err(Adapter))
@@ -103,7 +103,7 @@ static void read_bulk_callback(struct urb *urb)
return;
}
- QueueIndex = SearchVcid( Adapter,pLeader->Vcid);
+ QueueIndex = SearchVcid( Adapter, pLeader->Vcid);
if(QueueIndex < NO_OF_QUEUES)
{
bHeaderSupressionEnabled =
@@ -115,7 +115,7 @@ static void read_bulk_callback(struct urb *urb)
skb = dev_alloc_skb (pLeader->PLength + SKB_RESERVE_PHS_BYTES + SKB_RESERVE_ETHERNET_HEADER);//2 //2 for allignment
if(!skb)
{
- BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "NO SKBUFF!!! Dropping the Packet");
+ BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "NO SKBUFF!!! Dropping the Packet");
atomic_dec(&psIntfAdapter->uNumRcbUsed);
return;
}
@@ -123,14 +123,14 @@ static void read_bulk_callback(struct urb *urb)
if((ntohs(pLeader->Vcid) == VCID_CONTROL_PACKET) ||
(!(pLeader->Status >= 0x20 && pLeader->Status <= 0x3F)))
{
- BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_RX, RX_CTRL, DBG_LVL_ALL, "Received control pkt...");
+ BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_RX, RX_CTRL, DBG_LVL_ALL, "Received control pkt...");
*(PUSHORT)skb->data = pLeader->Status;
memcpy(skb->data+sizeof(USHORT), urb->transfer_buffer +
(sizeof(struct bcm_leader)), pLeader->PLength);
skb->len = pLeader->PLength + sizeof(USHORT);
spin_lock(&Adapter->control_queue_lock);
- ENQUEUEPACKET(Adapter->RxControlHead,Adapter->RxControlTail,skb);
+ ENQUEUEPACKET(Adapter->RxControlHead, Adapter->RxControlTail, skb);
spin_unlock(&Adapter->control_queue_lock);
atomic_inc(&Adapter->cntrlpktCnt);
@@ -142,7 +142,7 @@ static void read_bulk_callback(struct urb *urb)
* Data Packet, Format a proper Ethernet Header
* and give it to the stack
*/
- BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_RX, RX_DATA, DBG_LVL_ALL, "Received Data pkt...");
+ BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_RX, RX_DATA, DBG_LVL_ALL, "Received Data pkt...");
skb_reserve(skb, 2 + SKB_RESERVE_PHS_BYTES);
memcpy(skb->data+ETH_HLEN, (PUCHAR)urb->transfer_buffer + sizeof(struct bcm_leader), pLeader->PLength);
skb->dev = Adapter->dev;
@@ -151,14 +151,14 @@ static void read_bulk_callback(struct urb *urb)
skb_put (skb, pLeader->PLength + ETH_HLEN);
Adapter->PackInfo[QueueIndex].uiTotalRxBytes += pLeader->PLength;
Adapter->PackInfo[QueueIndex].uiThisPeriodRxBytes += pLeader->PLength;
- BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_RX, RX_DATA, DBG_LVL_ALL, "Received Data pkt of len :0x%X", pLeader->PLength);
+ BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_RX, RX_DATA, DBG_LVL_ALL, "Received Data pkt of len :0x%X", pLeader->PLength);
if(netif_running(Adapter->dev))
{
/* Moving ahead by ETH_HLEN to the data ptr as received from FW */
skb_pull(skb, ETH_HLEN);
PHSReceive(Adapter, pLeader->Vcid, skb, &skb->len,
- NULL,bHeaderSupressionEnabled);
+ NULL, bHeaderSupressionEnabled);
if(!Adapter->PackInfo[QueueIndex].bEthCSSupport)
{
@@ -177,7 +177,7 @@ static void read_bulk_callback(struct urb *urb)
}
else
{
- BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_RX, RX_DATA, DBG_LVL_ALL, "i/f not up hance freeing SKB...");
+ BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_RX, RX_DATA, DBG_LVL_ALL, "i/f not up hance freeing SKB...");
dev_kfree_skb(skb);
}
@@ -213,7 +213,7 @@ static int ReceiveRcb(struct bcm_interface_adapter *psIntfAdapter, struct bcm_us
retval = usb_submit_urb(urb, GFP_ATOMIC);
if (retval)
{
- BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_RX, RX_DPC, DBG_LVL_ALL, "failed submitting read urb, error %d", retval);
+ BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_RX, RX_DPC, DBG_LVL_ALL, "failed submitting read urb, error %d", retval);
//if this return value is because of pipe halt. need to clear this.
if(retval == -EPIPE)
{
@@ -252,7 +252,7 @@ bool InterfaceRx (struct bcm_interface_adapter *psIntfAdapter)
pRcb = GetBulkInRcb(psIntfAdapter);
if(pRcb == NULL)
{
- BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_PRINTK, 0, 0, "Unable to get Rcb pointer");
+ BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_PRINTK, 0, 0, "Unable to get Rcb pointer");
return false;
}
//atomic_inc(&psIntfAdapter->uNumRcbUsed);
--
1.8.1.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 3/6] beeceem: Fix broken indentations in InterfaceRx.c
2014-01-08 22:15 [PATCH 0/6] beeceem: Checkpatch cleanups in InterfaceRx.c Matthias Oefelein
2014-01-08 22:15 ` [PATCH 1/6] beeceem: Fix missing spaces around operators and unwanted spaces around semicolons " Matthias Oefelein
2014-01-08 22:15 ` [PATCH 2/6] beeceem: Fix missing spaces between function arguments " Matthias Oefelein
@ 2014-01-08 22:15 ` Matthias Oefelein
2014-01-08 22:15 ` [PATCH 4/6] beeceem: Fix whitespace issues at opening parentheses " Matthias Oefelein
` (2 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Matthias Oefelein @ 2014-01-08 22:15 UTC (permalink / raw)
To: ma.oefelein; +Cc: linux-kernel, linux-kernel, gregkh, lisa, devel, linux-kernel
Checkpatch reports a lot of spaces at the beginning of lines and other wrong indentations. This patch fixes these issues.
Signed-off-by: Matthias Oefelein <ma.oefelein@arcor.de>
Signed-off-by: Ralph Mueck <linux-kernel@rmueck.de>
---
drivers/staging/bcm/InterfaceRx.c | 55 ++++++++++++++++++---------------------
1 file changed, 26 insertions(+), 29 deletions(-)
diff --git a/drivers/staging/bcm/InterfaceRx.c b/drivers/staging/bcm/InterfaceRx.c
index aa1df66..5ebcf9b 100644
--- a/drivers/staging/bcm/InterfaceRx.c
+++ b/drivers/staging/bcm/InterfaceRx.c
@@ -19,14 +19,14 @@ GetBulkInRcb(struct bcm_interface_adapter *psIntfAdapter)
UINT index = 0;
if((atomic_read(&psIntfAdapter->uNumRcbUsed) < MAXIMUM_USB_RCB) &&
- (psIntfAdapter->psAdapter->StopAllXaction == false))
+ (psIntfAdapter->psAdapter->StopAllXaction == false))
{
index = atomic_read(&psIntfAdapter->uCurrRcb);
pRcb = &psIntfAdapter->asUsbRcb[index];
pRcb->bUsed = TRUE;
pRcb->psIntfAdapter = psIntfAdapter;
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_RX, RX_DPC, DBG_LVL_ALL, "Got Rx desc %d used %d",
- index, atomic_read(&psIntfAdapter->uNumRcbUsed));
+ index, atomic_read(&psIntfAdapter->uNumRcbUsed));
index = (index + 1) % MAXIMUM_USB_RCB;
atomic_set(&psIntfAdapter->uCurrRcb, index);
atomic_inc(&psIntfAdapter->uNumRcbUsed);
@@ -52,13 +52,12 @@ static void read_bulk_callback(struct urb *urb)
pr_info(PFX "%s: rx urb status %d length %d\n",
Adapter->dev->name, urb->status, urb->actual_length);
- if((Adapter->device_removed == TRUE) ||
- (TRUE == Adapter->bEndPointHalted) ||
- (0 == urb->actual_length)
- )
+ if((Adapter->device_removed == TRUE) ||
+ (TRUE == Adapter->bEndPointHalted) ||
+ (0 == urb->actual_length))
{
- pRcb->bUsed = false;
- atomic_dec(&psIntfAdapter->uNumRcbUsed);
+ pRcb->bUsed = false;
+ atomic_dec(&psIntfAdapter->uNumRcbUsed);
return;
}
@@ -74,7 +73,7 @@ static void read_bulk_callback(struct urb *urb)
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_RX, RX_DPC, DBG_LVL_ALL, "Rx URB has got cancelled. status :%d", urb->status);
}
pRcb->bUsed = false;
- atomic_dec(&psIntfAdapter->uNumRcbUsed);
+ atomic_dec(&psIntfAdapter->uNumRcbUsed);
urb->status = STATUS_SUCCESS;
return;
}
@@ -119,14 +118,14 @@ static void read_bulk_callback(struct urb *urb)
atomic_dec(&psIntfAdapter->uNumRcbUsed);
return;
}
- /* If it is a control Packet, then call handle_bcm_packet ()*/
+ /* If it is a control Packet, then call handle_bcm_packet ()*/
if((ntohs(pLeader->Vcid) == VCID_CONTROL_PACKET) ||
- (!(pLeader->Status >= 0x20 && pLeader->Status <= 0x3F)))
+ (!(pLeader->Status >= 0x20 && pLeader->Status <= 0x3F)))
{
- BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_RX, RX_CTRL, DBG_LVL_ALL, "Received control pkt...");
+ BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_RX, RX_CTRL, DBG_LVL_ALL, "Received control pkt...");
*(PUSHORT)skb->data = pLeader->Status;
- memcpy(skb->data+sizeof(USHORT), urb->transfer_buffer +
- (sizeof(struct bcm_leader)), pLeader->PLength);
+ memcpy(skb->data+sizeof(USHORT), urb->transfer_buffer +
+ (sizeof(struct bcm_leader)), pLeader->PLength);
skb->len = pLeader->PLength + sizeof(USHORT);
spin_lock(&Adapter->control_queue_lock);
@@ -139,10 +138,10 @@ static void read_bulk_callback(struct urb *urb)
else
{
/*
- * Data Packet, Format a proper Ethernet Header
- * and give it to the stack
- */
- BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_RX, RX_DATA, DBG_LVL_ALL, "Received Data pkt...");
+ * Data Packet, Format a proper Ethernet Header
+ * and give it to the stack
+ */
+ BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_RX, RX_DATA, DBG_LVL_ALL, "Received Data pkt...");
skb_reserve(skb, 2 + SKB_RESERVE_PHS_BYTES);
memcpy(skb->data+ETH_HLEN, (PUCHAR)urb->transfer_buffer + sizeof(struct bcm_leader), pLeader->PLength);
skb->dev = Adapter->dev;
@@ -151,14 +150,14 @@ static void read_bulk_callback(struct urb *urb)
skb_put (skb, pLeader->PLength + ETH_HLEN);
Adapter->PackInfo[QueueIndex].uiTotalRxBytes += pLeader->PLength;
Adapter->PackInfo[QueueIndex].uiThisPeriodRxBytes += pLeader->PLength;
- BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_RX, RX_DATA, DBG_LVL_ALL, "Received Data pkt of len :0x%X", pLeader->PLength);
+ BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_RX, RX_DATA, DBG_LVL_ALL, "Received Data pkt of len :0x%X", pLeader->PLength);
if(netif_running(Adapter->dev))
{
/* Moving ahead by ETH_HLEN to the data ptr as received from FW */
skb_pull(skb, ETH_HLEN);
PHSReceive(Adapter, pLeader->Vcid, skb, &skb->len,
- NULL, bHeaderSupressionEnabled);
+ NULL, bHeaderSupressionEnabled);
if(!Adapter->PackInfo[QueueIndex].bEthCSSupport)
{
@@ -177,7 +176,7 @@ static void read_bulk_callback(struct urb *urb)
}
else
{
- BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_RX, RX_DATA, DBG_LVL_ALL, "i/f not up hance freeing SKB...");
+ BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_RX, RX_DATA, DBG_LVL_ALL, "i/f not up hance freeing SKB...");
dev_kfree_skb(skb);
}
@@ -186,12 +185,12 @@ static void read_bulk_callback(struct urb *urb)
for(uiIndex = 0; uiIndex < MIBS_MAX_HIST_ENTRIES; uiIndex++)
{
- if((pLeader->PLength <= MIBS_PKTSIZEHIST_RANGE*(uiIndex+1))
- && (pLeader->PLength > MIBS_PKTSIZEHIST_RANGE*(uiIndex)))
+ if((pLeader->PLength <= MIBS_PKTSIZEHIST_RANGE*(uiIndex+1)) &&
+ (pLeader->PLength > MIBS_PKTSIZEHIST_RANGE*(uiIndex)))
Adapter->aRxPktSizeHist[uiIndex]++;
}
}
- Adapter->PrevNumRecvDescs++;
+ Adapter->PrevNumRecvDescs++;
pRcb->bUsed = false;
atomic_dec(&psIntfAdapter->uNumRcbUsed);
}
@@ -201,10 +200,8 @@ static int ReceiveRcb(struct bcm_interface_adapter *psIntfAdapter, struct bcm_us
struct urb *urb = pRcb->urb;
int retval = 0;
- usb_fill_bulk_urb(urb, psIntfAdapter->udev, usb_rcvbulkpipe(
- psIntfAdapter->udev, psIntfAdapter->sBulkIn.bulk_in_endpointAddr),
- urb->transfer_buffer, BCM_USB_MAX_READ_LENGTH, read_bulk_callback,
- pRcb);
+ usb_fill_bulk_urb(urb, psIntfAdapter->udev, usb_rcvbulkpipe(psIntfAdapter->udev, psIntfAdapter->sBulkIn.bulk_in_endpointAddr),
+ urb->transfer_buffer, BCM_USB_MAX_READ_LENGTH, read_bulk_callback, pRcb);
if(false == psIntfAdapter->psAdapter->device_removed &&
false == psIntfAdapter->psAdapter->bEndPointHalted &&
false == psIntfAdapter->bSuspended &&
@@ -258,7 +255,7 @@ bool InterfaceRx (struct bcm_interface_adapter *psIntfAdapter)
//atomic_inc(&psIntfAdapter->uNumRcbUsed);
ReceiveRcb(psIntfAdapter, pRcb);
RxDescCount--;
- }
+ }
return TRUE;
}
--
1.8.1.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 4/6] beeceem: Fix whitespace issues at opening parentheses in InterfaceRx.c
2014-01-08 22:15 [PATCH 0/6] beeceem: Checkpatch cleanups in InterfaceRx.c Matthias Oefelein
` (2 preceding siblings ...)
2014-01-08 22:15 ` [PATCH 3/6] beeceem: Fix broken indentations " Matthias Oefelein
@ 2014-01-08 22:15 ` Matthias Oefelein
2014-01-08 22:15 ` [PATCH 5/6] beeceem: Fix newline issues at opening braces of conditional statements " Matthias Oefelein
2014-01-08 22:15 ` [PATCH 6/6] beeceem: Replace C99 comments with C89 ones and remove unneeded comments " Matthias Oefelein
5 siblings, 0 replies; 8+ messages in thread
From: Matthias Oefelein @ 2014-01-08 22:15 UTC (permalink / raw)
To: ma.oefelein; +Cc: linux-kernel, linux-kernel, gregkh, lisa, devel, linux-kernel
Most spaces before opening parentheses (where required) are missing here.
This patch adds spaces at the appropriate spots.
Signed-off-by: Matthias Oefelein <ma.oefelein@arcor.de>
Signed-off-by: Ralph Mueck <linux-kernel@rmueck.de>
---
drivers/staging/bcm/InterfaceRx.c | 64 +++++++++++++++++++--------------------
1 file changed, 32 insertions(+), 32 deletions(-)
diff --git a/drivers/staging/bcm/InterfaceRx.c b/drivers/staging/bcm/InterfaceRx.c
index 5ebcf9b..12921a4 100644
--- a/drivers/staging/bcm/InterfaceRx.c
+++ b/drivers/staging/bcm/InterfaceRx.c
@@ -4,8 +4,8 @@ static int SearchVcid(struct bcm_mini_adapter *Adapter, unsigned short usVcid)
{
int iIndex = 0;
- for(iIndex = (NO_OF_QUEUES-1); iIndex >= 0; iIndex--)
- if(Adapter->PackInfo[iIndex].usVCID_Value == usVcid)
+ for (iIndex = (NO_OF_QUEUES-1); iIndex >= 0; iIndex--)
+ if (Adapter->PackInfo[iIndex].usVCID_Value == usVcid)
return iIndex;
return NO_OF_QUEUES+1;
@@ -18,8 +18,8 @@ GetBulkInRcb(struct bcm_interface_adapter *psIntfAdapter)
struct bcm_usb_rcb *pRcb = NULL;
UINT index = 0;
- if((atomic_read(&psIntfAdapter->uNumRcbUsed) < MAXIMUM_USB_RCB) &&
- (psIntfAdapter->psAdapter->StopAllXaction == false))
+ if ((atomic_read(&psIntfAdapter->uNumRcbUsed) < MAXIMUM_USB_RCB) &&
+ (psIntfAdapter->psAdapter->StopAllXaction == false))
{
index = atomic_read(&psIntfAdapter->uCurrRcb);
pRcb = &psIntfAdapter->asUsbRcb[index];
@@ -52,18 +52,18 @@ static void read_bulk_callback(struct urb *urb)
pr_info(PFX "%s: rx urb status %d length %d\n",
Adapter->dev->name, urb->status, urb->actual_length);
- if((Adapter->device_removed == TRUE) ||
- (TRUE == Adapter->bEndPointHalted) ||
- (0 == urb->actual_length))
+ if ((Adapter->device_removed == TRUE) ||
+ (TRUE == Adapter->bEndPointHalted) ||
+ (0 == urb->actual_length))
{
pRcb->bUsed = false;
atomic_dec(&psIntfAdapter->uNumRcbUsed);
return;
}
- if(urb->status != STATUS_SUCCESS)
+ if (urb->status != STATUS_SUCCESS)
{
- if(urb->status == -EPIPE)
+ if (urb->status == -EPIPE)
{
Adapter->bEndPointHalted = TRUE;
wake_up(&Adapter->tx_packet_wait_queue);
@@ -78,21 +78,21 @@ static void read_bulk_callback(struct urb *urb)
return;
}
- if(Adapter->bDoSuspend && (Adapter->bPreparingForLowPowerMode))
+ if (Adapter->bDoSuspend && (Adapter->bPreparingForLowPowerMode))
{
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_RX, RX_DPC, DBG_LVL_ALL, "device is going in low power mode while PMU option selected..hence rx packet should not be process");
return;
}
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_RX, RX_DPC, DBG_LVL_ALL, "Read back done len %d\n", pLeader->PLength);
- if(!pLeader->PLength)
+ if (!pLeader->PLength)
{
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_RX, RX_DPC, DBG_LVL_ALL, "Leader Length 0");
atomic_dec(&psIntfAdapter->uNumRcbUsed);
return;
}
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_RX, RX_DPC, DBG_LVL_ALL, "Leader Status:0x%hX, Length:0x%hX, VCID:0x%hX", pLeader->Status, pLeader->PLength, pLeader->Vcid);
- if(MAX_CNTL_PKT_SIZE < pLeader->PLength)
+ if (MAX_CNTL_PKT_SIZE < pLeader->PLength)
{
if (netif_msg_rx_err(Adapter))
pr_info(PFX "%s: corrupted leader length...%d\n",
@@ -102,8 +102,8 @@ static void read_bulk_callback(struct urb *urb)
return;
}
- QueueIndex = SearchVcid( Adapter, pLeader->Vcid);
- if(QueueIndex < NO_OF_QUEUES)
+ QueueIndex = SearchVcid(Adapter, pLeader->Vcid);
+ if (QueueIndex < NO_OF_QUEUES)
{
bHeaderSupressionEnabled =
Adapter->PackInfo[QueueIndex].bHeaderSuppressionEnabled;
@@ -111,16 +111,16 @@ static void read_bulk_callback(struct urb *urb)
bHeaderSupressionEnabled & Adapter->bPHSEnabled;
}
- skb = dev_alloc_skb (pLeader->PLength + SKB_RESERVE_PHS_BYTES + SKB_RESERVE_ETHERNET_HEADER);//2 //2 for allignment
- if(!skb)
+ skb = dev_alloc_skb(pLeader->PLength + SKB_RESERVE_PHS_BYTES + SKB_RESERVE_ETHERNET_HEADER);//2 //2 for allignment
+ if (!skb)
{
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "NO SKBUFF!!! Dropping the Packet");
atomic_dec(&psIntfAdapter->uNumRcbUsed);
return;
}
/* If it is a control Packet, then call handle_bcm_packet ()*/
- if((ntohs(pLeader->Vcid) == VCID_CONTROL_PACKET) ||
- (!(pLeader->Status >= 0x20 && pLeader->Status <= 0x3F)))
+ if ((ntohs(pLeader->Vcid) == VCID_CONTROL_PACKET) ||
+ (!(pLeader->Status >= 0x20 && pLeader->Status <= 0x3F)))
{
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_RX, RX_CTRL, DBG_LVL_ALL, "Received control pkt...");
*(PUSHORT)skb->data = pLeader->Status;
@@ -147,19 +147,19 @@ static void read_bulk_callback(struct urb *urb)
skb->dev = Adapter->dev;
/* currently skb->len has extra ETH_HLEN bytes in the beginning */
- skb_put (skb, pLeader->PLength + ETH_HLEN);
+ skb_put(skb, pLeader->PLength + ETH_HLEN);
Adapter->PackInfo[QueueIndex].uiTotalRxBytes += pLeader->PLength;
Adapter->PackInfo[QueueIndex].uiThisPeriodRxBytes += pLeader->PLength;
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_RX, RX_DATA, DBG_LVL_ALL, "Received Data pkt of len :0x%X", pLeader->PLength);
- if(netif_running(Adapter->dev))
+ if (netif_running(Adapter->dev))
{
/* Moving ahead by ETH_HLEN to the data ptr as received from FW */
skb_pull(skb, ETH_HLEN);
PHSReceive(Adapter, pLeader->Vcid, skb, &skb->len,
NULL, bHeaderSupressionEnabled);
- if(!Adapter->PackInfo[QueueIndex].bEthCSSupport)
+ if (!Adapter->PackInfo[QueueIndex].bEthCSSupport)
{
skb_push(skb, ETH_HLEN);
@@ -183,10 +183,10 @@ static void read_bulk_callback(struct urb *urb)
++Adapter->dev->stats.rx_packets;
Adapter->dev->stats.rx_bytes += pLeader->PLength;
- for(uiIndex = 0; uiIndex < MIBS_MAX_HIST_ENTRIES; uiIndex++)
+ for (uiIndex = 0; uiIndex < MIBS_MAX_HIST_ENTRIES; uiIndex++)
{
- if((pLeader->PLength <= MIBS_PKTSIZEHIST_RANGE*(uiIndex+1)) &&
- (pLeader->PLength > MIBS_PKTSIZEHIST_RANGE*(uiIndex)))
+ if ((pLeader->PLength <= MIBS_PKTSIZEHIST_RANGE*(uiIndex+1)) &&
+ (pLeader->PLength > MIBS_PKTSIZEHIST_RANGE*(uiIndex)))
Adapter->aRxPktSizeHist[uiIndex]++;
}
}
@@ -202,17 +202,17 @@ static int ReceiveRcb(struct bcm_interface_adapter *psIntfAdapter, struct bcm_us
usb_fill_bulk_urb(urb, psIntfAdapter->udev, usb_rcvbulkpipe(psIntfAdapter->udev, psIntfAdapter->sBulkIn.bulk_in_endpointAddr),
urb->transfer_buffer, BCM_USB_MAX_READ_LENGTH, read_bulk_callback, pRcb);
- if(false == psIntfAdapter->psAdapter->device_removed &&
- false == psIntfAdapter->psAdapter->bEndPointHalted &&
- false == psIntfAdapter->bSuspended &&
- false == psIntfAdapter->bPreparingForBusSuspend)
+ if (false == psIntfAdapter->psAdapter->device_removed &&
+ false == psIntfAdapter->psAdapter->bEndPointHalted &&
+ false == psIntfAdapter->bSuspended &&
+ false == psIntfAdapter->bPreparingForBusSuspend)
{
retval = usb_submit_urb(urb, GFP_ATOMIC);
if (retval)
{
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_RX, RX_DPC, DBG_LVL_ALL, "failed submitting read urb, error %d", retval);
//if this return value is because of pipe halt. need to clear this.
- if(retval == -EPIPE)
+ if (retval == -EPIPE)
{
psIntfAdapter->psAdapter->bEndPointHalted = TRUE;
wake_up(&psIntfAdapter->psAdapter->tx_packet_wait_queue);
@@ -237,17 +237,17 @@ Return: TRUE - If Rx was successful.
Other - If an error occurred.
*/
-bool InterfaceRx (struct bcm_interface_adapter *psIntfAdapter)
+bool InterfaceRx(struct bcm_interface_adapter *psIntfAdapter)
{
USHORT RxDescCount = NUM_RX_DESC - atomic_read(&psIntfAdapter->uNumRcbUsed);
struct bcm_usb_rcb *pRcb = NULL;
// RxDescCount = psIntfAdapter->psAdapter->CurrNumRecvDescs -
// psIntfAdapter->psAdapter->PrevNumRecvDescs;
- while(RxDescCount)
+ while (RxDescCount)
{
pRcb = GetBulkInRcb(psIntfAdapter);
- if(pRcb == NULL)
+ if (pRcb == NULL)
{
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_PRINTK, 0, 0, "Unable to get Rcb pointer");
return false;
--
1.8.1.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 5/6] beeceem: Fix newline issues at opening braces of conditional statements in InterfaceRx.c
2014-01-08 22:15 [PATCH 0/6] beeceem: Checkpatch cleanups in InterfaceRx.c Matthias Oefelein
` (3 preceding siblings ...)
2014-01-08 22:15 ` [PATCH 4/6] beeceem: Fix whitespace issues at opening parentheses " Matthias Oefelein
@ 2014-01-08 22:15 ` Matthias Oefelein
2014-01-08 23:58 ` Greg KH
2014-01-08 22:15 ` [PATCH 6/6] beeceem: Replace C99 comments with C89 ones and remove unneeded comments " Matthias Oefelein
5 siblings, 1 reply; 8+ messages in thread
From: Matthias Oefelein @ 2014-01-08 22:15 UTC (permalink / raw)
To: ma.oefelein; +Cc: linux-kernel, linux-kernel, gregkh, lisa, devel, linux-kernel
In InterfaceRx.c, opening braces of (if-)conditionals are mostly dislocated, meaning they are found behind an extra line break after the conditional statement.
This patch moves the opening braces accordingly as specified by the official conding style guidelines.
Signed-off-by: Matthias Oefelein <ma.oefelein@arcor.de>
Signed-off-by: Ralph Mueck <linux-kernel@rmueck.de>
---
drivers/staging/bcm/InterfaceRx.c | 66 +++++++++++++--------------------------
1 file changed, 21 insertions(+), 45 deletions(-)
diff --git a/drivers/staging/bcm/InterfaceRx.c b/drivers/staging/bcm/InterfaceRx.c
index 12921a4..b556d73 100644
--- a/drivers/staging/bcm/InterfaceRx.c
+++ b/drivers/staging/bcm/InterfaceRx.c
@@ -19,8 +19,7 @@ GetBulkInRcb(struct bcm_interface_adapter *psIntfAdapter)
UINT index = 0;
if ((atomic_read(&psIntfAdapter->uNumRcbUsed) < MAXIMUM_USB_RCB) &&
- (psIntfAdapter->psAdapter->StopAllXaction == false))
- {
+ (psIntfAdapter->psAdapter->StopAllXaction == false)) {
index = atomic_read(&psIntfAdapter->uCurrRcb);
pRcb = &psIntfAdapter->asUsbRcb[index];
pRcb->bUsed = TRUE;
@@ -54,22 +53,17 @@ static void read_bulk_callback(struct urb *urb)
if ((Adapter->device_removed == TRUE) ||
(TRUE == Adapter->bEndPointHalted) ||
- (0 == urb->actual_length))
- {
+ (0 == urb->actual_length)) {
pRcb->bUsed = false;
atomic_dec(&psIntfAdapter->uNumRcbUsed);
return;
}
- if (urb->status != STATUS_SUCCESS)
- {
- if (urb->status == -EPIPE)
- {
+ if (urb->status != STATUS_SUCCESS) {
+ if (urb->status == -EPIPE) {
Adapter->bEndPointHalted = TRUE;
wake_up(&Adapter->tx_packet_wait_queue);
- }
- else
- {
+ } else {
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_RX, RX_DPC, DBG_LVL_ALL, "Rx URB has got cancelled. status :%d", urb->status);
}
pRcb->bUsed = false;
@@ -78,22 +72,19 @@ static void read_bulk_callback(struct urb *urb)
return;
}
- if (Adapter->bDoSuspend && (Adapter->bPreparingForLowPowerMode))
- {
+ if (Adapter->bDoSuspend && (Adapter->bPreparingForLowPowerMode)) {
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_RX, RX_DPC, DBG_LVL_ALL, "device is going in low power mode while PMU option selected..hence rx packet should not be process");
return;
}
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_RX, RX_DPC, DBG_LVL_ALL, "Read back done len %d\n", pLeader->PLength);
- if (!pLeader->PLength)
- {
+ if (!pLeader->PLength) {
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_RX, RX_DPC, DBG_LVL_ALL, "Leader Length 0");
atomic_dec(&psIntfAdapter->uNumRcbUsed);
return;
}
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_RX, RX_DPC, DBG_LVL_ALL, "Leader Status:0x%hX, Length:0x%hX, VCID:0x%hX", pLeader->Status, pLeader->PLength, pLeader->Vcid);
- if (MAX_CNTL_PKT_SIZE < pLeader->PLength)
- {
+ if (MAX_CNTL_PKT_SIZE < pLeader->PLength) {
if (netif_msg_rx_err(Adapter))
pr_info(PFX "%s: corrupted leader length...%d\n",
Adapter->dev->name, pLeader->PLength);
@@ -103,8 +94,7 @@ static void read_bulk_callback(struct urb *urb)
}
QueueIndex = SearchVcid(Adapter, pLeader->Vcid);
- if (QueueIndex < NO_OF_QUEUES)
- {
+ if (QueueIndex < NO_OF_QUEUES) {
bHeaderSupressionEnabled =
Adapter->PackInfo[QueueIndex].bHeaderSuppressionEnabled;
bHeaderSupressionEnabled =
@@ -112,16 +102,14 @@ static void read_bulk_callback(struct urb *urb)
}
skb = dev_alloc_skb(pLeader->PLength + SKB_RESERVE_PHS_BYTES + SKB_RESERVE_ETHERNET_HEADER);//2 //2 for allignment
- if (!skb)
- {
+ if (!skb) {
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "NO SKBUFF!!! Dropping the Packet");
atomic_dec(&psIntfAdapter->uNumRcbUsed);
return;
}
/* If it is a control Packet, then call handle_bcm_packet ()*/
if ((ntohs(pLeader->Vcid) == VCID_CONTROL_PACKET) ||
- (!(pLeader->Status >= 0x20 && pLeader->Status <= 0x3F)))
- {
+ (!(pLeader->Status >= 0x20 && pLeader->Status <= 0x3F))) {
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_RX, RX_CTRL, DBG_LVL_ALL, "Received control pkt...");
*(PUSHORT)skb->data = pLeader->Status;
memcpy(skb->data+sizeof(USHORT), urb->transfer_buffer +
@@ -134,9 +122,7 @@ static void read_bulk_callback(struct urb *urb)
atomic_inc(&Adapter->cntrlpktCnt);
wake_up(&Adapter->process_rx_cntrlpkt);
- }
- else
- {
+ } else {
/*
* Data Packet, Format a proper Ethernet Header
* and give it to the stack
@@ -152,15 +138,13 @@ static void read_bulk_callback(struct urb *urb)
Adapter->PackInfo[QueueIndex].uiThisPeriodRxBytes += pLeader->PLength;
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_RX, RX_DATA, DBG_LVL_ALL, "Received Data pkt of len :0x%X", pLeader->PLength);
- if (netif_running(Adapter->dev))
- {
+ if (netif_running(Adapter->dev)) {
/* Moving ahead by ETH_HLEN to the data ptr as received from FW */
skb_pull(skb, ETH_HLEN);
PHSReceive(Adapter, pLeader->Vcid, skb, &skb->len,
NULL, bHeaderSupressionEnabled);
- if (!Adapter->PackInfo[QueueIndex].bEthCSSupport)
- {
+ if (!Adapter->PackInfo[QueueIndex].bEthCSSupport) {
skb_push(skb, ETH_HLEN);
memcpy(skb->data, skb->dev->dev_addr, 6);
@@ -173,9 +157,7 @@ static void read_bulk_callback(struct urb *urb)
skb->protocol = eth_type_trans(skb, Adapter->dev);
process_done = netif_rx(skb);
- }
- else
- {
+ } else {
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_RX, RX_DATA, DBG_LVL_ALL, "i/f not up hance freeing SKB...");
dev_kfree_skb(skb);
}
@@ -183,8 +165,7 @@ static void read_bulk_callback(struct urb *urb)
++Adapter->dev->stats.rx_packets;
Adapter->dev->stats.rx_bytes += pLeader->PLength;
- for (uiIndex = 0; uiIndex < MIBS_MAX_HIST_ENTRIES; uiIndex++)
- {
+ for (uiIndex = 0; uiIndex < MIBS_MAX_HIST_ENTRIES; uiIndex++) {
if ((pLeader->PLength <= MIBS_PKTSIZEHIST_RANGE*(uiIndex+1)) &&
(pLeader->PLength > MIBS_PKTSIZEHIST_RANGE*(uiIndex)))
Adapter->aRxPktSizeHist[uiIndex]++;
@@ -205,15 +186,12 @@ static int ReceiveRcb(struct bcm_interface_adapter *psIntfAdapter, struct bcm_us
if (false == psIntfAdapter->psAdapter->device_removed &&
false == psIntfAdapter->psAdapter->bEndPointHalted &&
false == psIntfAdapter->bSuspended &&
- false == psIntfAdapter->bPreparingForBusSuspend)
- {
+ false == psIntfAdapter->bPreparingForBusSuspend) {
retval = usb_submit_urb(urb, GFP_ATOMIC);
- if (retval)
- {
+ if (retval) {
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_RX, RX_DPC, DBG_LVL_ALL, "failed submitting read urb, error %d", retval);
//if this return value is because of pipe halt. need to clear this.
- if (retval == -EPIPE)
- {
+ if (retval == -EPIPE) {
psIntfAdapter->psAdapter->bEndPointHalted = TRUE;
wake_up(&psIntfAdapter->psAdapter->tx_packet_wait_queue);
}
@@ -244,11 +222,9 @@ bool InterfaceRx(struct bcm_interface_adapter *psIntfAdapter)
// RxDescCount = psIntfAdapter->psAdapter->CurrNumRecvDescs -
// psIntfAdapter->psAdapter->PrevNumRecvDescs;
- while (RxDescCount)
- {
+ while (RxDescCount) {
pRcb = GetBulkInRcb(psIntfAdapter);
- if (pRcb == NULL)
- {
+ if (pRcb == NULL) {
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_PRINTK, 0, 0, "Unable to get Rcb pointer");
return false;
}
--
1.8.1.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 6/6] beeceem: Replace C99 comments with C89 ones and remove unneeded comments in InterfaceRx.c
2014-01-08 22:15 [PATCH 0/6] beeceem: Checkpatch cleanups in InterfaceRx.c Matthias Oefelein
` (4 preceding siblings ...)
2014-01-08 22:15 ` [PATCH 5/6] beeceem: Fix newline issues at opening braces of conditional statements " Matthias Oefelein
@ 2014-01-08 22:15 ` Matthias Oefelein
5 siblings, 0 replies; 8+ messages in thread
From: Matthias Oefelein @ 2014-01-08 22:15 UTC (permalink / raw)
To: ma.oefelein; +Cc: linux-kernel, linux-kernel, gregkh, lisa, devel, linux-kernel
This patch replaces C99-style with C89-style comments.
Additionally, code fragments that have been commented out are removed; the same applies to meaningless comments.
Signed-off-by: Matthias Oefelein <ma.oefelein@arcor.de>
Signed-off-by: Ralph Mueck <linux-kernel@rmueck.de>
---
drivers/staging/bcm/InterfaceRx.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/bcm/InterfaceRx.c b/drivers/staging/bcm/InterfaceRx.c
index b556d73..1fba7d8 100644
--- a/drivers/staging/bcm/InterfaceRx.c
+++ b/drivers/staging/bcm/InterfaceRx.c
@@ -41,7 +41,6 @@ static void read_bulk_callback(struct urb *urb)
int QueueIndex = NO_OF_QUEUES + 1;
UINT uiIndex = 0;
int process_done = 1;
- //int idleflag = 0 ;
struct bcm_usb_rcb *pRcb = (struct bcm_usb_rcb *)urb->context;
struct bcm_interface_adapter *psIntfAdapter = pRcb->psIntfAdapter;
struct bcm_mini_adapter *Adapter = psIntfAdapter->psAdapter;
@@ -101,7 +100,7 @@ static void read_bulk_callback(struct urb *urb)
bHeaderSupressionEnabled & Adapter->bPHSEnabled;
}
- skb = dev_alloc_skb(pLeader->PLength + SKB_RESERVE_PHS_BYTES + SKB_RESERVE_ETHERNET_HEADER);//2 //2 for allignment
+ skb = dev_alloc_skb(pLeader->PLength + SKB_RESERVE_PHS_BYTES + SKB_RESERVE_ETHERNET_HEADER);
if (!skb) {
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "NO SKBUFF!!! Dropping the Packet");
atomic_dec(&psIntfAdapter->uNumRcbUsed);
@@ -190,7 +189,7 @@ static int ReceiveRcb(struct bcm_interface_adapter *psIntfAdapter, struct bcm_us
retval = usb_submit_urb(urb, GFP_ATOMIC);
if (retval) {
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_RX, RX_DPC, DBG_LVL_ALL, "failed submitting read urb, error %d", retval);
- //if this return value is because of pipe halt. need to clear this.
+ /* if this return value is because of pipe halt. need to clear this. */
if (retval == -EPIPE) {
psIntfAdapter->psAdapter->bEndPointHalted = TRUE;
wake_up(&psIntfAdapter->psAdapter->tx_packet_wait_queue);
@@ -220,15 +219,12 @@ bool InterfaceRx(struct bcm_interface_adapter *psIntfAdapter)
USHORT RxDescCount = NUM_RX_DESC - atomic_read(&psIntfAdapter->uNumRcbUsed);
struct bcm_usb_rcb *pRcb = NULL;
-// RxDescCount = psIntfAdapter->psAdapter->CurrNumRecvDescs -
-// psIntfAdapter->psAdapter->PrevNumRecvDescs;
while (RxDescCount) {
pRcb = GetBulkInRcb(psIntfAdapter);
if (pRcb == NULL) {
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_PRINTK, 0, 0, "Unable to get Rcb pointer");
return false;
}
- //atomic_inc(&psIntfAdapter->uNumRcbUsed);
ReceiveRcb(psIntfAdapter, pRcb);
RxDescCount--;
}
--
1.8.1.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 5/6] beeceem: Fix newline issues at opening braces of conditional statements in InterfaceRx.c
2014-01-08 22:15 ` [PATCH 5/6] beeceem: Fix newline issues at opening braces of conditional statements " Matthias Oefelein
@ 2014-01-08 23:58 ` Greg KH
0 siblings, 0 replies; 8+ messages in thread
From: Greg KH @ 2014-01-08 23:58 UTC (permalink / raw)
To: Matthias Oefelein; +Cc: devel, lisa, linux-kernel, linux-kernel, linux-kernel
On Wed, Jan 08, 2014 at 11:15:09PM +0100, Matthias Oefelein wrote:
> In InterfaceRx.c, opening braces of (if-)conditionals are mostly dislocated, meaning they are found behind an extra line break after the conditional statement.
> This patch moves the opening braces accordingly as specified by the official conding style guidelines.
Please properly line-wrap your changelog comments at 72 columns like git
asks you to when you type them in...
thanks,
greg k-h
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2014-01-08 23:58 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-08 22:15 [PATCH 0/6] beeceem: Checkpatch cleanups in InterfaceRx.c Matthias Oefelein
2014-01-08 22:15 ` [PATCH 1/6] beeceem: Fix missing spaces around operators and unwanted spaces around semicolons " Matthias Oefelein
2014-01-08 22:15 ` [PATCH 2/6] beeceem: Fix missing spaces between function arguments " Matthias Oefelein
2014-01-08 22:15 ` [PATCH 3/6] beeceem: Fix broken indentations " Matthias Oefelein
2014-01-08 22:15 ` [PATCH 4/6] beeceem: Fix whitespace issues at opening parentheses " Matthias Oefelein
2014-01-08 22:15 ` [PATCH 5/6] beeceem: Fix newline issues at opening braces of conditional statements " Matthias Oefelein
2014-01-08 23:58 ` Greg KH
2014-01-08 22:15 ` [PATCH 6/6] beeceem: Replace C99 comments with C89 ones and remove unneeded comments " Matthias Oefelein
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.