* [PATCH] staging: bcm: Arp.c: Checkpatch.pl fix
@ 2010-11-16 1:14 Audun Hoem
0 siblings, 0 replies; 3+ messages in thread
From: Audun Hoem @ 2010-11-16 1:14 UTC (permalink / raw)
To: gregkh; +Cc: devel, linux-kernel, Audun Hoem
Cleaned up the coding style. 80 line length limit warnings are in a comment.
Signed-off-by: Audun Hoem <audun.hoem@gmail.com>
---
drivers/staging/bcm/Arp.c | 63 ++++++++++++++++++++------------------------
1 files changed, 29 insertions(+), 34 deletions(-)
diff --git a/drivers/staging/bcm/Arp.c b/drivers/staging/bcm/Arp.c
index d60d859..6526270 100644
--- a/drivers/staging/bcm/Arp.c
+++ b/drivers/staging/bcm/Arp.c
@@ -10,57 +10,52 @@
* Function - reply_to_arp_request()
*
* Description - When this host tries to broadcast ARP request packet through
- * the virtual interface (veth0), reply directly to upper layer.
- * This function allocates a new skb for ARP reply packet,
- * fills in the fields of the packet and then sends it to
- * upper layer.
+ * the virtual interface (veth0), reply directly to upper layer.
+ * This function allocates a new skb for ARP reply packet,
+ * fills in the fields of the packet and then sends it to
+ * upper layer.
*
* Parameters - skb: Pointer to sk_buff structure of the ARP request pkt.
*
* Returns - None
* =========================================================================*/
-VOID
-reply_to_arp_request(struct sk_buff *skb)
+void reply_to_arp_request(struct sk_buff *skb)
{
- PMINI_ADAPTER Adapter;
- struct ArpHeader *pArpHdr = NULL;
- struct ethhdr *pethhdr = NULL;
- UCHAR uiIPHdr[4];
+ PMINI_ADAPTER Adapter;
+ struct ArpHeader *pArpHdr = NULL;
+ struct ethhdr *pethhdr = NULL;
+ UCHAR uiIPHdr[4];
/* Check for valid skb */
- if(skb == NULL)
- {
- BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "Invalid skb: Cannot reply to ARP request\n");
+ if (skb == NULL) {
+ BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "Invalid skb: Cannot reply to ARP request\n");
return;
}
Adapter = GET_BCM_ADAPTER(skb->dev);
/* Print the ARP Request Packet */
- BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, ARP_RESP, DBG_LVL_ALL, "ARP Packet Dump :");
- BCM_DEBUG_PRINT_BUFFER(Adapter,DBG_TYPE_TX, ARP_RESP, DBG_LVL_ALL, (PUCHAR)(skb->data), skb->len);
+ BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, ARP_RESP, DBG_LVL_ALL, "ARP Packet Dump :");
+ BCM_DEBUG_PRINT_BUFFER(Adapter, DBG_TYPE_TX, ARP_RESP, DBG_LVL_ALL, (PUCHAR)(skb->data), skb->len);
/*
* Extract the Ethernet Header and Arp Payload including Header
- */
+ */
pethhdr = (struct ethhdr *)skb->data;
pArpHdr = (struct ArpHeader *)(skb->data+ETH_HLEN);
- if(Adapter->bETHCSEnabled)
- {
- if(memcmp(pethhdr->h_source, Adapter->dev->dev_addr, ETH_ALEN))
- {
+ if (Adapter->bETHCSEnabled) {
+ if (memcmp(pethhdr->h_source, Adapter->dev->dev_addr, ETH_ALEN)) {
bcm_kfree_skb(skb);
return;
}
}
- // Set the Ethernet Header First.
+ /* Set the Ethernet Header First. */
memcpy(pethhdr->h_dest, pethhdr->h_source, ETH_ALEN);
- if(!memcmp(pethhdr->h_source, Adapter->dev->dev_addr, ETH_ALEN))
- {
+ if (!memcmp(pethhdr->h_source, Adapter->dev->dev_addr, ETH_ALEN))
pethhdr->h_source[5]++;
- }
+
/* Set the reply to ARP Reply */
pArpHdr->arp.ar_op = ntohs(ARPOP_REPLY);
@@ -69,25 +64,25 @@ reply_to_arp_request(struct sk_buff *skb)
memcpy(pArpHdr->ar_sha, pethhdr->h_source, ETH_ALEN);
memcpy(pArpHdr->ar_tha, pethhdr->h_dest, ETH_ALEN);
- // Swapping the IP Adddress
- memcpy(uiIPHdr,pArpHdr->ar_sip,4);
- memcpy(pArpHdr->ar_sip,pArpHdr->ar_tip,4);
- memcpy(pArpHdr->ar_tip,uiIPHdr,4);
+ /* Swapping the IP Adddress */
+ memcpy(uiIPHdr, pArpHdr->ar_sip, 4);
+ memcpy(pArpHdr->ar_sip, pArpHdr->ar_tip, 4);
+ memcpy(pArpHdr->ar_tip, uiIPHdr, 4);
/* Print the ARP Reply Packet */
- BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, ARP_RESP, DBG_LVL_ALL, "ARP REPLY PACKET: ");
+ BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, ARP_RESP, DBG_LVL_ALL, "ARP REPLY PACKET: ");
/* Send the Packet to upper layer */
- BCM_DEBUG_PRINT_BUFFER(Adapter,DBG_TYPE_TX, ARP_RESP, DBG_LVL_ALL, (PUCHAR)(skb->data), skb->len);
+ BCM_DEBUG_PRINT_BUFFER(Adapter, DBG_TYPE_TX, ARP_RESP, DBG_LVL_ALL, (PUCHAR)(skb->data), skb->len);
- skb->protocol = eth_type_trans(skb,skb->dev);
+ skb->protocol = eth_type_trans(skb, skb->dev);
skb->pkt_type = PACKET_HOST;
-// skb->mac.raw=skb->data+LEADER_SIZE;
- skb_set_mac_header (skb, LEADER_SIZE);
+ /* skb->mac.raw=skb->data+LEADER_SIZE; */
+ skb_set_mac_header(skb, LEADER_SIZE);
netif_rx(skb);
- BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, ARP_RESP, DBG_LVL_ALL, "<=============\n");
+ BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, ARP_RESP, DBG_LVL_ALL, "<=============\n");
return;
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] staging: bcm: Arp.c: Checkpatch.pl fix
2010-11-16 1:14 Audun Hoem
@ 2010-11-16 20:08 ` Greg KH
0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2010-11-16 20:08 UTC (permalink / raw)
To: Audun Hoem; +Cc: gregkh, devel, linux-kernel
On Tue, Nov 16, 2010 at 02:14:48AM +0100, Audun Hoem wrote:
> Cleaned up the coding style. 80 line length limit warnings are in a comment.
>
> Signed-off-by: Audun Hoem <audun.hoem@gmail.com>
> ---
> drivers/staging/bcm/Arp.c | 63 ++++++++++++++++++++------------------------
This file is no longer in the linux-next tree so I can't apply this
patch :)
Care to resync and send patches only on the linux-next tree?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] staging: bcm: Arp.c: Checkpatch.pl fix
@ 2010-11-16 1:14 Audun Hoem
2010-11-16 20:08 ` Greg KH
0 siblings, 1 reply; 3+ messages in thread
From: Audun Hoem @ 2010-11-16 1:14 UTC (permalink / raw)
To: gregkh; +Cc: devel, linux-kernel, Audun Hoem
Cleaned up the coding style. 80 line length limit warnings are in a comment.
Signed-off-by: Audun Hoem <audun.hoem@gmail.com>
---
drivers/staging/bcm/Arp.c | 63 ++++++++++++++++++++------------------------
1 files changed, 29 insertions(+), 34 deletions(-)
diff --git a/drivers/staging/bcm/Arp.c b/drivers/staging/bcm/Arp.c
index d60d859..6526270 100644
--- a/drivers/staging/bcm/Arp.c
+++ b/drivers/staging/bcm/Arp.c
@@ -10,57 +10,52 @@
* Function - reply_to_arp_request()
*
* Description - When this host tries to broadcast ARP request packet through
- * the virtual interface (veth0), reply directly to upper layer.
- * This function allocates a new skb for ARP reply packet,
- * fills in the fields of the packet and then sends it to
- * upper layer.
+ * the virtual interface (veth0), reply directly to upper layer.
+ * This function allocates a new skb for ARP reply packet,
+ * fills in the fields of the packet and then sends it to
+ * upper layer.
*
* Parameters - skb: Pointer to sk_buff structure of the ARP request pkt.
*
* Returns - None
* =========================================================================*/
-VOID
-reply_to_arp_request(struct sk_buff *skb)
+void reply_to_arp_request(struct sk_buff *skb)
{
- PMINI_ADAPTER Adapter;
- struct ArpHeader *pArpHdr = NULL;
- struct ethhdr *pethhdr = NULL;
- UCHAR uiIPHdr[4];
+ PMINI_ADAPTER Adapter;
+ struct ArpHeader *pArpHdr = NULL;
+ struct ethhdr *pethhdr = NULL;
+ UCHAR uiIPHdr[4];
/* Check for valid skb */
- if(skb == NULL)
- {
- BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "Invalid skb: Cannot reply to ARP request\n");
+ if (skb == NULL) {
+ BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "Invalid skb: Cannot reply to ARP request\n");
return;
}
Adapter = GET_BCM_ADAPTER(skb->dev);
/* Print the ARP Request Packet */
- BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, ARP_RESP, DBG_LVL_ALL, "ARP Packet Dump :");
- BCM_DEBUG_PRINT_BUFFER(Adapter,DBG_TYPE_TX, ARP_RESP, DBG_LVL_ALL, (PUCHAR)(skb->data), skb->len);
+ BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, ARP_RESP, DBG_LVL_ALL, "ARP Packet Dump :");
+ BCM_DEBUG_PRINT_BUFFER(Adapter, DBG_TYPE_TX, ARP_RESP, DBG_LVL_ALL, (PUCHAR)(skb->data), skb->len);
/*
* Extract the Ethernet Header and Arp Payload including Header
- */
+ */
pethhdr = (struct ethhdr *)skb->data;
pArpHdr = (struct ArpHeader *)(skb->data+ETH_HLEN);
- if(Adapter->bETHCSEnabled)
- {
- if(memcmp(pethhdr->h_source, Adapter->dev->dev_addr, ETH_ALEN))
- {
+ if (Adapter->bETHCSEnabled) {
+ if (memcmp(pethhdr->h_source, Adapter->dev->dev_addr, ETH_ALEN)) {
bcm_kfree_skb(skb);
return;
}
}
- // Set the Ethernet Header First.
+ /* Set the Ethernet Header First. */
memcpy(pethhdr->h_dest, pethhdr->h_source, ETH_ALEN);
- if(!memcmp(pethhdr->h_source, Adapter->dev->dev_addr, ETH_ALEN))
- {
+ if (!memcmp(pethhdr->h_source, Adapter->dev->dev_addr, ETH_ALEN))
pethhdr->h_source[5]++;
- }
+
/* Set the reply to ARP Reply */
pArpHdr->arp.ar_op = ntohs(ARPOP_REPLY);
@@ -69,25 +64,25 @@ reply_to_arp_request(struct sk_buff *skb)
memcpy(pArpHdr->ar_sha, pethhdr->h_source, ETH_ALEN);
memcpy(pArpHdr->ar_tha, pethhdr->h_dest, ETH_ALEN);
- // Swapping the IP Adddress
- memcpy(uiIPHdr,pArpHdr->ar_sip,4);
- memcpy(pArpHdr->ar_sip,pArpHdr->ar_tip,4);
- memcpy(pArpHdr->ar_tip,uiIPHdr,4);
+ /* Swapping the IP Adddress */
+ memcpy(uiIPHdr, pArpHdr->ar_sip, 4);
+ memcpy(pArpHdr->ar_sip, pArpHdr->ar_tip, 4);
+ memcpy(pArpHdr->ar_tip, uiIPHdr, 4);
/* Print the ARP Reply Packet */
- BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, ARP_RESP, DBG_LVL_ALL, "ARP REPLY PACKET: ");
+ BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, ARP_RESP, DBG_LVL_ALL, "ARP REPLY PACKET: ");
/* Send the Packet to upper layer */
- BCM_DEBUG_PRINT_BUFFER(Adapter,DBG_TYPE_TX, ARP_RESP, DBG_LVL_ALL, (PUCHAR)(skb->data), skb->len);
+ BCM_DEBUG_PRINT_BUFFER(Adapter, DBG_TYPE_TX, ARP_RESP, DBG_LVL_ALL, (PUCHAR)(skb->data), skb->len);
- skb->protocol = eth_type_trans(skb,skb->dev);
+ skb->protocol = eth_type_trans(skb, skb->dev);
skb->pkt_type = PACKET_HOST;
-// skb->mac.raw=skb->data+LEADER_SIZE;
- skb_set_mac_header (skb, LEADER_SIZE);
+ /* skb->mac.raw=skb->data+LEADER_SIZE; */
+ skb_set_mac_header(skb, LEADER_SIZE);
netif_rx(skb);
- BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, ARP_RESP, DBG_LVL_ALL, "<=============\n");
+ BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, ARP_RESP, DBG_LVL_ALL, "<=============\n");
return;
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-11-16 20:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-16 1:14 [PATCH] staging: bcm: Arp.c: Checkpatch.pl fix Audun Hoem
2010-11-16 1:14 Audun Hoem
2010-11-16 20:08 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).