staging/et131x: fix checkpatch warnings
PATCH 1/1 staging/et131x: fix checkpatch warnings
The below checkpatch warns was fixed,
drivers/staging/et131x/et131x.c:89: WARNING: quoted string split across lines drivers/staging/et131x/et131x.c:2557: WARNING: Prefer pr_info(... to printk(KERN_INFO, ... drivers/staging/et131x/et131x.c:2578: WARNING: Prefer pr_info(... to printk(KERN_INFO, ... drivers/staging/et131x/et131x.c:2972: WARNING: suspect code indent for conditional statements (8, 8) drivers/staging/et131x/et131x.c:4330: WARNING: quoted string split across lines drivers/staging/et131x/et131x.c:5192: WARNING: Prefer pr_info(... to printk(KERN_INFO, ...
And added pr_fmt.
--- drivers/staging/et131x/et131x.c | 24 ++++++++++++------------ 1 files changed, 12 insertions(+), 12 deletions(-)
drivers/staging/et131x/et131x.c +12 -12
@@ -53,6 +53,8 @@* */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/pci.h> #include <linux/init.h> #include <linux/module.h>
@@ -85,8 +87,7 @@MODULE_AUTHOR ("Victor Soriano <[email protected]>" );MODULE_AUTHOR ("Mark Einon <[email protected]>" );MODULE_LICENSE ("Dual BSD/GPL" ); -MODULE_DESCRIPTION ("10/100/1000 Base-T Ethernet Driver " -"for the ET1310 by Agere Systems" ); +MODULE_DESCRIPTION ("10/100/1000 Base-T Ethernet Driver for the ET1310 by Agere Systems" );/* EEPROM defines */ #define MAX_NUM_REGISTER_POLLS 1000
@@ -2554,8 +2555,8 @@ static int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter) "Cannot alloc memory for Packet Status Ring\n");return -ENOMEM ; } -printk (KERN_INFO "Packet Status Ring %lx\n" , - (unsigned long ) rx_ring->ps_ring_physaddr); +pr_info ("Packet Status Ring %lx\n" , + (unsigned long ) rx_ring->ps_ring_physaddr);/* * NOTE : dma_alloc_coherent(), used above to alloc DMA regions,
@@ -2575,7 +2576,7 @@ static int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter)return -ENOMEM ; } rx_ring->num_rfd =NIC_DEFAULT_NUM_RFD ; -printk (KERN_INFO "PRS %lx\n" , (unsigned long )rx_ring->rx_status_bus); +pr_info ("PRS %lx\n" , (unsigned long )rx_ring->rx_status_bus);/* Recv * kmem_cache_create initializes a lookaside list. After successful
@@ -2967,11 +2968,10 @@ static struct rfd *nic_rx_pkts(struct et131x_adapter *adapter) (ring_index == 0 && buff_index > rx_local->fbr[1]->num_entries - 1) || (ring_index == 1 && - buff_index > rx_local->fbr[0]->num_entries - 1)) + buff_index > rx_local->fbr[0]->num_entries - 1)) {#else - if (ring_index != 1 || buff_index > rx_local->fbr[0]->num_entries - 1) +if (ring_index !=1 || buff_index > rx_local->fbr[0 ]->num_entries -1 ) {#endif - {/* Illegal buffer or ring index cannot be used by S/W*/ dev_err (&adapter->pdev->dev, "NICRxPkts PSR Entry %d indicates "
@@ -4326,8 +4326,8 @@ static int et131x_mii_probe(struct net_device *netdev) phydev->advertising = phydev->supported; adapter->phydev = phydev; -dev_info (&adapter->pdev->dev,"attached PHY driver [%s] " -"(mii_bus:phy_addr=%s)\n" , +dev_info (&adapter->pdev->dev, +"attached PHY driver [%s] (mii_bus:phy_addr=%s)\n" , phydev->drv->name,dev_name (&phydev->dev));return 0 ;
@@ -5189,8 +5189,8 @@ static int et131x_set_mac_addr(struct net_device *netdev, void *new_mac)memcpy (netdev->dev_addr, address->sa_data, netdev->addr_len); -printk (KERN_INFO "%s: Setting MAC address to %pM\n" , - netdev->name, netdev->dev_addr); +pr_info ("%s: Setting MAC address to %pM\n" , + netdev->name, netdev->dev_addr);/* Free Rx DMA memory */ et131x_adapter_memory_free (adapter);
Signature · 1 line
1.7.5.4
PATCH 1/1 staging/et131x: fix checkpatch warnings
The below checkpatch warns was fixed,
drivers/staging/et131x/et131x.c:2556: WARNING: Prefer pr_info(... to printk(KERN_INFO, ... drivers/staging/et131x/et131x.c:2577: WARNING: Prefer pr_info(... to printk(KERN_INFO, ... drivers/staging/et131x/et131x.c:5189: WARNING: Prefer pr_info(... to printk(KERN_INFO, ...
And added pr_fmt.
--- drivers/staging/et131x/et131x.c | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-)
drivers/staging/et131x/et131x.c +7 -5
@@ -53,6 +53,8 @@* */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/pci.h> #include <linux/init.h> #include <linux/module.h>
@@ -2553,8 +2555,8 @@ static int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter) "Cannot alloc memory for Packet Status Ring\n");return -ENOMEM ; } -printk (KERN_INFO "Packet Status Ring %lx\n" , - (unsigned long ) rx_ring->ps_ring_physaddr); +pr_info ("Packet Status Ring %lx\n" , + (unsigned long ) rx_ring->ps_ring_physaddr);/* * NOTE : dma_alloc_coherent(), used above to alloc DMA regions,
@@ -2574,7 +2576,7 @@ static int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter)return -ENOMEM ; } rx_ring->num_rfd =NIC_DEFAULT_NUM_RFD ; -printk (KERN_INFO "PRS %lx\n" , (unsigned long )rx_ring->rx_status_bus); +pr_info ("PRS %lx\n" , (unsigned long )rx_ring->rx_status_bus);/* Recv * kmem_cache_create initializes a lookaside list. After successful
@@ -5186,8 +5188,8 @@ static int et131x_set_mac_addr(struct net_device *netdev, void *new_mac)memcpy (netdev->dev_addr, address->sa_data, netdev->addr_len); -printk (KERN_INFO "%s: Setting MAC address to %pM\n" , - netdev->name, netdev->dev_addr); +pr_info ("%s: Setting MAC address to %pM\n" , + netdev->name, netdev->dev_addr);/* Free Rx DMA memory */ et131x_adapter_memory_free (adapter);
Signature · 1 line
1.7.5.4
Quoted 1 line · Toshiaki Yamane
Signed-off-by Toshiaki Yamane <[email protected]>
Hello. Just some trivial notes:
drivers/staging/et131x/et131x.c
Quoted 1 line
drivers/staging/et131x/et131x.c +0
-0
[]
drivers/staging/et131x/et131x.c static int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter)
Quoted 1 line
drivers/staging/et131x/et131x.c +0
-0@@ -2553,8 +2555,8 @@ static int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter)
[]
drivers/staging/et131x/et131x.c static int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter)
Quoted 5 lines
drivers/staging/et131x/et131x.c +2
-2-printk (KERN_INFO "Packet Status Ring %lx\n" , - (unsigned long ) rx_ring->ps_ring_physaddr); +pr_info ("Packet Status Ring %lx\n" , + (unsigned long ) rx_ring->ps_ring_physaddr);@@ -2574,7 +2576,7 @@ static int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter)
[]
drivers/staging/et131x/et131x.c static int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter) · line 2579
Quoted 2 lines
drivers/staging/et131x/et131x.c +1
-1-printk (KERN_INFO "PRS %lx\n" , (unsigned long )rx_ring->rx_status_bus); +pr_info ("PRS %lx\n" , (unsigned long )rx_ring->rx_status_bus);
These might as well use %p without a cast to unsigned long
pr_info("Packet Status Ring: %p\n", rx_ring->ps_ring_phydaddr);
[]
pr_info("PRS: %p\n", rx_ring->rx_status_bus);[]
drivers/staging/et131x/et131x.c static int et131x_set_mac_addr(struct net_device *netdev, void *new_mac)
Quoted 1 line
drivers/staging/et131x/et131x.c +0
-0@@ -5186,8 +5188,8 @@ static int et131x_set_mac_addr(struct net_device *netdev, void *new_mac)
[]
drivers/staging/et131x/et131x.c static int et131x_set_mac_addr(struct net_device *netdev, void *new_mac) · line 5192
Quoted 4 lines
drivers/staging/et131x/et131x.c +2
-2-printk (KERN_INFO "%s: Setting MAC address to %pM\n" , - netdev->name, netdev->dev_addr); +pr_info ("%s: Setting MAC address to %pM\n" , + netdev->name, netdev->dev_addr);
Please use netdev_<level> when there is a
struct net_device * available.
netdev_info(netdev, "Setting MAC address to %pM\n", netdev->dev_addr);
Thanks for you reply.
I will fix netdev_info only, because I don't know if I should use "%p".
Quoted 37 lines · Joe Perches
Quoted 1 line · Toshiaki Yamane
Signed-off-by Toshiaki Yamane <[email protected]>Hello. Just some trivial notes:
drivers/staging/et131x/et131x.c
Quoted 1 line
drivers/staging/et131x/et131x.c +0
-0[]
drivers/staging/et131x/et131x.c static int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter)
Quoted 1 line
drivers/staging/et131x/et131x.c +0
-0@@ -2553,8 +2555,8 @@ static int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter)[]
drivers/staging/et131x/et131x.c static int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter)
Quoted 5 lines
drivers/staging/et131x/et131x.c +2
-2-printk (KERN_INFO "Packet Status Ring %lx\n" , - (unsigned long ) rx_ring->ps_ring_physaddr); +pr_info ("Packet Status Ring %lx\n" , + (unsigned long ) rx_ring->ps_ring_physaddr);@@ -2574,7 +2576,7 @@ static int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter)[]
drivers/staging/et131x/et131x.c static int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter) · line 2579
Quoted 2 lines
drivers/staging/et131x/et131x.c +1
-1-printk (KERN_INFO "PRS %lx\n" , (unsigned long )rx_ring->rx_status_bus); +pr_info ("PRS %lx\n" , (unsigned long )rx_ring->rx_status_bus);These might as well use %p without a cast to unsigned long
pr_info("Packet Status Ring: %p\n", rx_ring->ps_ring_phydaddr); [] pr_info("PRS: %p\n", rx_ring->rx_status_bus);[]
drivers/staging/et131x/et131x.c static int et131x_set_mac_addr(struct net_device *netdev, void *new_mac)
Quoted 1 line
drivers/staging/et131x/et131x.c +0
-0@@ -5186,8 +5188,8 @@ static int et131x_set_mac_addr(struct net_device *netdev, void *new_mac)[]
drivers/staging/et131x/et131x.c static int et131x_set_mac_addr(struct net_device *netdev, void *new_mac) · line 5192
Quoted 4 lines
drivers/staging/et131x/et131x.c +2
-2-printk (KERN_INFO "%s: Setting MAC address to %pM\n" , - netdev->name, netdev->dev_addr); +pr_info ("%s: Setting MAC address to %pM\n" , + netdev->name, netdev->dev_addr);Please use netdev_<level> when there is a
structnet_device* available.netdev_info(netdev, "Setting MAC address to %pM\n", netdev->dev_addr);
Signature · 10 lines
Regards, . . ... Yamane Toshiaki [email protected]
Quoted 3 lines · Toshiaki Yamane
Thanks for you reply.
I will fix
netdev_infoonly, because I don't know if I should use "%p".
OK, fyi: it turns out ps_ring_physaddr and rx_status_bus are both dma_addr_t so both should be emitted with %ull and cast to (unsigned long long) or (u64).
Quoted 9 lines · Joe Perches
Quoted 3 lines · Toshiaki Yamane
Thanks for you reply.
I will fix
netdev_infoonly, because I don't know if I should use "%p".OK, fyi: it turns out
ps_ring_physaddrandrx_status_busare bothdma_addr_tso both should be emitted with %ull and cast to (unsigned long long) or (u64).
Thanks for your reply.
%ullx ?
pr_info("Packet Status Ring: %ullx\n", (unsigned long
long)rx_ring->ps_ring_phydaddr);
Quoted 6 lines · Toshiaki Yamane
Quoted 3 lines · Joe Perches
OK, fyi: it turns out
ps_ring_physaddrandrx_status_busare bothdma_addr_tso both should be emitted with %ull and cast to (unsigned long long) or (u64).Thanks for your reply.
%ullx ?
My fault, dunno what I was thinking, just %llx
cheers, Joe
Quoted 5 lines · Joe Perches
Quoted 4 lines · Toshiaki Yamane
Quoted 3 lines · Joe Perches
OK, fyi: it turns out
ps_ring_physaddrandrx_status_busare bothdma_addr_tso both should be emitted with %ull and cast to (unsigned long long) or (u64).
Quoted 7 lines
Quoted 2 lines
Thanks for your reply.
%ullx ?My fault, dunno what I was thinking, just %llx
cheers, Joe
Thanks!
I will try to fix it.
Signature · 10 lines
Regards, . . ... Yamane Toshiaki [email protected]
PATCH 1/1 staging/et131x: fix checkpatch warnings
In reply to Toshiaki YamaneThe below checkpatch warns was fixed,
drivers/staging/et131x/et131x.c:2556: WARNING: Prefer pr_info(... to printk(KERN_INFO, ... drivers/staging/et131x/et131x.c:2577: WARNING: Prefer pr_info(... to printk(KERN_INFO, ... drivers/staging/et131x/et131x.c:5189: WARNING: Prefer pr_info(... to printk(KERN_INFO, ...
And fixed below,
-converted printk to netdev_info
-added pr_fmt
--- drivers/staging/et131x/et131x.c | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-)
drivers/staging/et131x/et131x.c +7 -5
@@ -53,6 +53,8 @@* */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/pci.h> #include <linux/init.h> #include <linux/module.h>
@@ -2553,8 +2555,8 @@ static int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter) "Cannot alloc memory for Packet Status Ring\n");return -ENOMEM ; } -printk (KERN_INFO "Packet Status Ring %lx\n" , - (unsigned long ) rx_ring->ps_ring_physaddr); +pr_info ("Packet Status Ring %lx\n" , + (unsigned long ) rx_ring->ps_ring_physaddr);/* * NOTE : dma_alloc_coherent(), used above to alloc DMA regions,
@@ -2574,7 +2576,7 @@ static int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter)return -ENOMEM ; } rx_ring->num_rfd =NIC_DEFAULT_NUM_RFD ; -printk (KERN_INFO "PRS %lx\n" , (unsigned long )rx_ring->rx_status_bus); +pr_info ("PRS %lx\n" , (unsigned long )rx_ring->rx_status_bus);/* Recv * kmem_cache_create initializes a lookaside list. After successful
@@ -5186,8 +5188,8 @@ static int et131x_set_mac_addr(struct net_device *netdev, void *new_mac)memcpy (netdev->dev_addr, address->sa_data, netdev->addr_len); -printk (KERN_INFO "%s: Setting MAC address to %pM\n" , - netdev->name, netdev->dev_addr); +netdev_info (netdev,"Setting MAC address to %pM\n" , + netdev->dev_addr);/* Free Rx DMA memory */ et131x_adapter_memory_free (adapter);
Signature · 1 line
1.7.5.4
PATCH 1/1 staging/et131x: fix checkpatch warnings
In reply to Toshiaki YamaneThe below checkpatch warns was fixed,
drivers/staging/et131x/et131x.c:2556: WARNING: Prefer pr_info(... to printk(KERN_INFO, ... drivers/staging/et131x/et131x.c:2577: WARNING: Prefer pr_info(... to printk(KERN_INFO, ... drivers/staging/et131x/et131x.c:5189: WARNING: Prefer pr_info(... to printk(KERN_INFO, ...
And fixed below,
-added pr_fmt
-fixed printk formats for dma_addr_t
-converted printk to netdev_info
--- drivers/staging/et131x/et131x.c | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-)
drivers/staging/et131x/et131x.c +7 -5
@@ -53,6 +53,8 @@* */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/pci.h> #include <linux/init.h> #include <linux/module.h>
@@ -2553,8 +2555,8 @@ static int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter) "Cannot alloc memory for Packet Status Ring\n");return -ENOMEM ; } -printk (KERN_INFO "Packet Status Ring %lx\n" , - (unsigned long ) rx_ring->ps_ring_physaddr); +pr_info ("Packet Status Ring %llx\n" , + (unsigned long long ) rx_ring->ps_ring_physaddr);/* * NOTE : dma_alloc_coherent(), used above to alloc DMA regions,
@@ -2574,7 +2576,7 @@ static int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter)return -ENOMEM ; } rx_ring->num_rfd =NIC_DEFAULT_NUM_RFD ; -printk (KERN_INFO "PRS %lx\n" , (unsigned long )rx_ring->rx_status_bus); +pr_info ("PRS %llx\n" , (unsigned long long )rx_ring->rx_status_bus);/* Recv * kmem_cache_create initializes a lookaside list. After successful
@@ -5186,8 +5188,8 @@ static int et131x_set_mac_addr(struct net_device *netdev, void *new_mac)memcpy (netdev->dev_addr, address->sa_data, netdev->addr_len); -printk (KERN_INFO "%s: Setting MAC address to %pM\n" , - netdev->name, netdev->dev_addr); +netdev_info (netdev,"Setting MAC address to %pM\n" , + netdev->dev_addr);/* Free Rx DMA memory */ et131x_adapter_memory_free (adapter);
Signature · 1 line
1.7.5.4