staging: hp100: Remove spaces and extra blank lines
cover staging: hp100: Remove spaces and extra blank lines
This patchset properly indents the multiline comments, add blank line between end of multiline comment "*/" and function definition, correct typo in comment,remove space after * in pointer declarations,add space after "," in function arguments and remove space after opening parenthesis "(" in if statement for the same file hp100.c present under drivers/staging/hp directory.
Soumyajit Deb (6):
staging: hp100: Properly indent the multiline comment
staging: hp100: Add blank line between end of comment and function
definition
Correct typo in the comment
staging: hp100: Remove space after * in pointer declaration.
Staging: hp100: Add space after "," in function arguments.
staging: hp100: Remove space after opening parenthesis "("
drivers/staging/hp/hp100.c | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-)
Signature · 1 line
2.17.1
PATCH 1/6 staging: hp100: Properly indent the multiline comment
Shifted the end of multiline comment "*/" to next line. Reported by checkpatch.pl
--- drivers/staging/hp/hp100.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/staging/hp/hp100.c +3 -1
@@ -262,7 +262,9 @@ static void hp100_RegisterDump(struct net_device *dev);* This work *only* for memory fragments part of lp->page_vaddr, * because it was properly DMA allocated via pci_alloc_consistent(), * so we just need to "retrieve" the original mapping to bus/phys/dma -* address - Jean II */ +* address - Jean II +*/ +static inline dma_addr_t virt_to_whatever (struct net_device *dev,u32 *ptr) {struct hp100_private *lp =netdev_priv (dev);
Signature · 1 line
2.17.1
Greg KH
maintainerRe: [PATCH 1/6] staging: hp100: Properly indent the multiline comment
Quoted 13 lines · Soumyajit Deb
Shifted the end of multiline comment "*/" to next line. Reported by checkpatch.pl
Signed-off-by Soumyajit Deb <[email protected]>--- drivers/staging/hp/hp100.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/staging/hp/hp100.c +0
-0
drivers/staging/hp/hp100.c static void hp100_RegisterDump(struct net_device *dev); · line 267
Quoted 7 lines
drivers/staging/hp/hp100.c +3
-1@@ -262,7 +262,9 @@ static void hp100_RegisterDump(struct net_device *dev);* This work *only* for memory fragments part of lp->page_vaddr, * because it was properly DMA allocated via pci_alloc_consistent(), * so we just need to "retrieve" the original mapping to bus/phys/dma -* address - Jean II */ +* address - Jean II +*/ +
Why did you add the blank line here? The comment is describing the function:
drivers/staging/hp/hp100.c static void hp100_RegisterDump(struct net_device *dev); · line 268
Quoted 1 line
drivers/staging/hp/hp100.c +0
-0static inline dma_addr_t virt_to_whatever (struct net_device *dev,u32 *ptr)
So it should be right up next to it.
thanks,
greg k-h
A message that is not in the archive (sent off-list or not yet received): CAMS7mKDKRoNEGZbaLf5pkLfU=e9RZp17DJx1TEyyJsWW18gvBw@mail.gmail.com
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [PATCH 1/6] staging: hp100: Properly indent the multiline comment
Sorry,I didn't know that reply has to be on the mailing list too. Will keep that in mind from now on.
Thank you.
Quoted 32 lines · Greg KH
Quoted 2 lines · Soumyajit Deb
Okay, I will remove the blank line and send the v2 of this patch. Thank You
<snip>
For some reason you sent this only to me, which is a bit rude to everyone else on the mailing list. I'll be glad to respond if you resend it to everyone.
thanks,
greg k-h
Great question, care to ask this on the XXXXXXXX mailing list and CC me? That
way I can answer it in public to enable everyone else to know the answer, and
let the search engines pick it up.Also, please read the following two links on why it is not good to directly email people:
http://www.arm.linux.org.uk/news/?newsitem=11 http://www.eyrie.org/~eagle/faqs/questions.htmlthanks,
greg k-h
PATCH 2/6 staging: hp100: Add blank line between end of comment and function definition
In reply to Soumyajit DebAdd blank line after end of multiline comment "*/" and start of function definition for better readability of the code.
Reported by checkpatch.pl
--- drivers/staging/hp/hp100.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/staging/hp/hp100.c +11 -0
@@ -348,6 +348,7 @@ static __init int hp100_isa_probe1(struct net_device *dev, int ioaddr) err:return -ENODEV ; } +/* * Probe for ISA board. * EISA and PCI are handled by device infrastructure.
@@ -1095,6 +1096,7 @@ static int hp100_open(struct net_device *dev) }/* The close function is called when the interface is to be brought down */ +static int hp100_close (struct net_device *dev) {int ioaddr = dev->base_addr;
@@ -1128,6 +1130,7 @@ static int hp100_close(struct net_device *dev)/* * Configure the PDL Rx rings and LAN */ +static void hp100_init_pdls (struct net_device *dev) {struct hp100_private *lp =netdev_priv (dev);
@@ -1177,6 +1180,7 @@ static void hp100_init_pdls(struct net_device *dev)/* These functions "format" the entries in the pdl structure */ /* They return how much memory the fragments need. */ +static int hp100_init_rxpdl (struct net_device *dev, registerhp100_ring_t * ringptr, registeru32 * pdlptr)
@@ -1226,6 +1230,7 @@ static int hp100_init_txpdl(struct net_device *dev,* Returns: 0 if unable to allocate skb_buff * 1 if successful */ +static int hp100_build_rx_pdl (hp100_ring_t * ringptr,struct net_device *dev) {
@@ -1308,6 +1313,7 @@ static int hp100_build_rx_pdl(hp100_ring_t * ringptr,* b. Put the physical address of the buffer into the PDL. * c. Output physical address of PDL to adapter. */ +static void hp100_rxfill (struct net_device *dev) {int ioaddr = dev->base_addr;
@@ -1455,6 +1461,7 @@ static int hp100_check_lan(struct net_device *dev)*/ /* tx function for busmaster mode */ +static netdev_tx_t hp100_start_xmit_bm (struct sk_buff *skb,struct net_device *dev) {
@@ -1570,6 +1577,7 @@ static netdev_tx_t hp100_start_xmit_bm(struct sk_buff *skb,* * Needs the PERFORMANCE page selected. */ +static void hp100_clean_txring (struct net_device *dev) {struct hp100_private *lp =netdev_priv (dev);
@@ -1605,6 +1613,7 @@ static void hp100_clean_txring(struct net_device *dev) }/* tx function for slave modes */ +static netdev_tx_t hp100_start_xmit (struct sk_buff *skb,struct net_device *dev) {
@@ -1838,6 +1847,7 @@ static void hp100_rx(struct net_device *dev)/* * Receive Function for Busmaster Mode */ +static void hp100_rx_bm (struct net_device *dev) {int ioaddr = dev->base_addr;
@@ -2408,6 +2418,7 @@ static void hp100_load_eeprom(struct net_device *dev, u_short probe_ioaddr)* LAN_100 - Connected to 100Mbit/s network * LAN_ERR - not connected or 100Mbit/s Hub down */ +static int hp100_sense_lan (struct net_device *dev) {int ioaddr = dev->base_addr;
Signature · 1 line
2.17.1
Greg KH
maintainerRe: [PATCH 2/6] staging: hp100: Add blank line between end of comment and function definition
Quoted 22 lines · Soumyajit Deb
Add blank line after end of multiline comment "*/" and start of function definition for better readability of the code.
Reported by checkpatch.plSigned-off-by Soumyajit Deb <[email protected]>--- drivers/staging/hp/hp100.c | 11 +++++++++++ 1 file changed, 11 insertions(+)drivers/staging/hp/hp100.c +1
-0@@ -348,6 +348,7 @@ static __init int hp100_isa_probe1(struct net_device *dev, int ioaddr) err:return -ENODEV ; } +/* * Probe for ISA board. * EISA and PCI are handled by device infrastructure.
drivers/staging/hp/hp100.c static int hp100_open(struct net_device *dev) · line 1100
Quoted 5 lines
drivers/staging/hp/hp100.c +1
-0@@ -1095,6 +1096,7 @@ static int hp100_open(struct net_device *dev) }/* The close function is called when the interface is to be brought down */ +static int hp100_close (struct net_device *dev)
No, please do not add a blank line here, the comment describes the function. Not very well, but that's a different story :)
thanks,
greg k-h
PATCH 3/6 staging: hp100: Correct typo in the comment
In reply to Soumyajit DebCorrect typo in the comment by changing "overriden" to "overridden". Reported by checkpatch.pl
--- drivers/staging/hp/hp100.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/hp/hp100.c +1 -1
@@ -2443,7 +2443,7 @@ static int hp100_sense_lan(struct net_device *dev)if (val_10 &HP100_AUI_ST ) {/* have we BNC or AUI onboard? */ /* -* This can be overriden by dos utility, so if this has no effect, +* This can be overridden by dos utility, so if this has no effect, * perhaps you need to download that utility from HP and set card * back to "auto detect". */
Signature · 1 line
2.17.1
PATCH 4/6 staging: hp100: Remove space after * in pointer declaration.
In reply to Soumyajit DebRemove space after * in pointer declaration to improve code readability and to adhere to the standard coding style.
Reported by checkpatch.pl
--- drivers/staging/hp/hp100.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/staging/hp/hp100.c +5 -5
@@ -1182,8 +1182,8 @@ static void hp100_init_pdls(struct net_device *dev)/* They return how much memory the fragments need. */ static int hp100_init_rxpdl (struct net_device *dev, - registerhp100_ring_t * ringptr, - registeru32 * pdlptr) + registerhp100_ring_t *ringptr, + registeru32 *pdlptr) {/* pdlptr is starting address for this pdl */
@@ -1210,8 +1210,8 @@ static int hp100_init_rxpdl(struct net_device *dev, }static int hp100_init_txpdl (struct net_device *dev, - registerhp100_ring_t * ringptr, - registeru32 * pdlptr) + registerhp100_ring_t *ringptr, + registeru32 *pdlptr) {if (0 != (((unsigned long ) pdlptr) &0xf ))printk ("hp100: %s: Init txpdl: Unaligned pdlptr 0x%lx.\n" , dev->name, (unsigned long ) pdlptr);
@@ -1231,7 +1231,7 @@ static int hp100_init_txpdl(struct net_device *dev,* 1 if successful */ -static int hp100_build_rx_pdl (hp100_ring_t * ringptr, +static int hp100_build_rx_pdl (hp100_ring_t *ringptr,struct net_device *dev) {#ifdef HP100_DEBUG_B
Signature · 1 line
2.17.1
PATCH 5/6 Staging: hp100: Add space after "," in function arguments.
In reply to Soumyajit DebAdd space after "," in function arguments to improve code readability. Reported by checkpatch.pl
--- drivers/staging/hp/hp100.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/hp/hp100.c +2 -2
@@ -1804,7 +1804,7 @@ static void hp100_rx(struct net_device *dev)u_char *ptr; -skb_reserve (skb,2 ); +skb_reserve (skb,2 );/* ptr to start of the sk_buff data area */ skb_put (skb, pkt_len);
@@ -1812,7 +1812,7 @@ static void hp100_rx(struct net_device *dev)/* Now transfer the data from the card into that area */ if (lp->mode ==2 ) -memcpy_fromio (ptr, lp->mem_ptr_virt,pkt_len); +memcpy_fromio (ptr, lp->mem_ptr_virt, pkt_len);else /* io mapped */ insl (ioaddr +HP100_REG_DATA32 , ptr, pkt_len >>2 );
Signature · 1 line
2.17.1
PATCH 6/6 staging: hp100: Remove space after opening parenthesis "("
In reply to Soumyajit DebRemove space after opening parenthesis in if statement to improve code readability and to adhere to the standard coding style. Reported by checkpatch.pl
--- drivers/staging/hp/hp100.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/hp/hp100.c +1 -1
@@ -2455,7 +2455,7 @@ static int hp100_sense_lan(struct net_device *dev) }/* Those cards don't have a 100 Mbit connector */ - if ( !strcmp(lp->id, "HWP1920") || + if (!strcmp(lp->id, "HWP1920") || (lp->pci_dev && lp->pci_dev->vendor == PCI_VENDOR_ID && (lp->pci_dev->device == PCI_DEVICE_ID_HP_J2970A ||
Signature · 1 line
2.17.1