Thread (9 messages) flat view 9 messages, 3 authors, 2014-07-22

Re: [PATCH net-next v2 1/2] ethernet: realtek: use module_pci_driver

From: Varka Bhadram <hidden>
Date: 2014-07-22 15:03:53

On Tuesday 22 July 2014 08:31 PM, Sergei Shtylyov wrote:
On 07/22/2014 06:43 PM, Varka Bhadram wrote:
quoted
quoted
quoted
From: Varka Bhadram <redacted>
quoted
quoted
quoted
This patch converts to use the macro module_pci_driver, which makes
the code smaller and simpler.
quoted
quoted
quoted
Signed-off-by: Varka Bhadram <redacted>
---
  drivers/net/ethernet/realtek/8139cp.c |   22 ++--------------------
  1 file changed, 2 insertions(+), 20 deletions(-)
quoted
quoted
quoted
diff --git a/drivers/net/ethernet/realtek/8139cp.c
b/drivers/net/ethernet/realtek/8139cp.c
index 2bc728e..9fb68b9 100644
--- a/drivers/net/ethernet/realtek/8139cp.c
+++ b/drivers/net/ethernet/realtek/8139cp.c
@@ -1887,11 +1887,7 @@ static int cp_init_one (struct pci_dev 
*pdev, const
struct pci_device_id *ent)
      resource_size_t pciaddr;
      unsigned int addr_len, i, pci_using_dac;

-#ifndef MODULE
-    static int version_printed;
-    if (version_printed++ == 0)
-        pr_info("%s", version);
-#endif
+    pr_info("%s", version);
quoted
quoted
   Use pr_info_once().
quoted
quoted
WBR, Sergei
quoted
I am going to utilize the removed code by removing the #ifndef MODULE...
quoted
It will be like:

     static int version_printed;

     if (version_printed++ == 0)
         pr_info("%s", version);
   pr_info_once() is much shorter and the effect is the same.

WBR, Sergei
Thanks for your suggestion. I will do this in next version.


-- 
Regards,
Varka Bhadram
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help