Re: [PATCH 4/5] staging: wilc1000: use pr_* instead of printk

2015-08-17 Thread Dan Carpenter
On Mon, Aug 17, 2015 at 01:59:44PM -0400, Raphaël Beamonte wrote:
> 2015-08-17 13:47 GMT-04:00 Dan Carpenter :
> >> - printk("[Sendconfigpkt]Get Timed out\n");
> >> + pr_debug("[Sendconfigpkt]Get Timed out\n");
> >
> >
> > Possibly pr_err()?
> 
> Yep. My mistake. I'll do the same for Set Timed Out also!
> 
> >> - printk("DBG [%s: %d]", __func__, __LINE__); \
> >> - printk(__VA_ARGS__);\
> >> + pr_debug("DBG [%s: %d]", __func__, __LINE__);   \
> >> + pr_debug(__VA_ARGS__);  \
> >
> > This is a behavior change, I think.  pr_debug() needs to be turned on?
> 
> Yes... I didn't pay attention to that! pr_debug needs -DDEBUG in the makefile.
> Should I use pr_info here? Or just acknowledge the behavior change for
> the moment,
> as the next aim is probably, as you said, to remove all the local
> debug code? (it is
> actually part of the TODO of this driver... So I could just work on that 
> next.)

I would probably just do the rest and leave this part as-is since you're
planning to redo it all anyway.  I guess just do stuff which is obvious
and hopefully more and more stuff will become obvious as you go along.
This is a lazy answer but I don't want to think about this driver very
hard...  :P

Also always try to order your patches from least controversial to most
controversial.  It makes it easier to redo things or sometimes Greg
applies the first part of a patch series.

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 4/5] staging: wilc1000: use pr_* instead of printk

2015-08-17 Thread Raphaël Beamonte
2015-08-17 13:47 GMT-04:00 Dan Carpenter :
>> - printk("[Sendconfigpkt]Get Timed out\n");
>> + pr_debug("[Sendconfigpkt]Get Timed out\n");
>
>
> Possibly pr_err()?

Yep. My mistake. I'll do the same for Set Timed Out also!

>> - printk("DBG [%s: %d]", __func__, __LINE__); \
>> - printk(__VA_ARGS__);\
>> + pr_debug("DBG [%s: %d]", __func__, __LINE__);   \
>> + pr_debug(__VA_ARGS__);  \
>
> This is a behavior change, I think.  pr_debug() needs to be turned on?

Yes... I didn't pay attention to that! pr_debug needs -DDEBUG in the makefile.
Should I use pr_info here? Or just acknowledge the behavior change for
the moment,
as the next aim is probably, as you said, to remove all the local
debug code? (it is
actually part of the TODO of this driver... So I could just work on that next.)

I'll include your other log level advices and send a new version.
Thanks for your
reviewing time!
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 4/5] staging: wilc1000: use pr_* instead of printk

2015-08-17 Thread Dan Carpenter
On Mon, Aug 17, 2015 at 12:08:36PM -0400, Raphaël Beamonte wrote:
> Signed-off-by: Raphaël Beamonte 
> ---
>  drivers/staging/wilc1000/coreconfigurator.c  |  4 ++--
>  drivers/staging/wilc1000/linux_wlan.c|  8 +++
>  drivers/staging/wilc1000/linux_wlan_common.h | 32 
> ++--
>  drivers/staging/wilc1000/linux_wlan_sdio.c   |  2 +-
>  drivers/staging/wilc1000/linux_wlan_spi.c|  2 +-
>  drivers/staging/wilc1000/wilc_debugfs.c  | 16 +++---
>  drivers/staging/wilc1000/wilc_exported_buf.c |  6 +++---
>  7 files changed, 35 insertions(+), 35 deletions(-)
> 
> diff --git a/drivers/staging/wilc1000/coreconfigurator.c 
> b/drivers/staging/wilc1000/coreconfigurator.c
> index c81c41d..0cbf4a9c 100644
> --- a/drivers/staging/wilc1000/coreconfigurator.c
> +++ b/drivers/staging/wilc1000/coreconfigurator.c
> @@ -2007,7 +2007,7 @@ s32 SendConfigPkt(u8 u8Mode, tstrWID *pstrWIDs,
>   
> pstrWIDs[counter].u16WIDid,
>   (counter == 
> u32WIDsCount - 1), drvHandler)) {
>   ret = -1;
> - printk("[Sendconfigpkt]Get Timed out\n");
> + pr_debug("[Sendconfigpkt]Get Timed out\n");


Possibly pr_err()?


>   break;
>   }
>   }
> @@ -2029,7 +2029,7 @@ s32 SendConfigPkt(u8 u8Mode, tstrWID *pstrWIDs,
>   
> pstrWIDs[counter].s32ValueSize,
>   (counter == 
> u32WIDsCount - 1), drvHandler)) {
>   ret = -1;
> - printk("[Sendconfigpkt]Set Timed out\n");
> + pr_debug("[Sendconfigpkt]Set Timed out\n");
>   break;
>   }
>   }
> diff --git a/drivers/staging/wilc1000/linux_wlan.c 
> b/drivers/staging/wilc1000/linux_wlan.c
> index 040e55d..1f32c36 100644
> --- a/drivers/staging/wilc1000/linux_wlan.c
> +++ b/drivers/staging/wilc1000/linux_wlan.c
> @@ -1306,7 +1306,7 @@ void wilc1000_wlan_deinit(linux_wlan_t *nic)
>  
>   if (g_linux_wlan->wilc1000_initialized) {
>  
> - printk("Deinitializing wilc1000  ...\n");
> + pr_info("Deinitializing wilc1000  ...\n");

debug.

>  
>   if (nic == NULL) {
>   PRINT_ER("nic is NULL\n");
> @@ -2565,8 +2565,8 @@ static int __init init_wilc_driver(void)
>   }
>  #endif
>  
> - printk("IN INIT FUNCTION\n");
> - printk("*** WILC1000 driver VERSION=[10.2] FW_VER=[10.2] ***\n");
> + pr_info("IN INIT FUNCTION\n");

debug.

> + pr_info("*** WILC1000 driver VERSION=[10.2] FW_VER=[10.2] ***\n");
>  
>   linux_wlan_device_power(1);
>   msleep(100);
> @@ -2662,7 +2662,7 @@ static void __exit exit_wilc_driver(void)
>   kfree(g_linux_wlan);
>   g_linux_wlan = NULL;
>   }
> - printk("Module_exit Done.\n");
> + pr_info("Module_exit Done.\n");

debug.

>  
>  #if defined(WILC_DEBUGFS)
>   wilc_debugfs_remove();
> diff --git a/drivers/staging/wilc1000/linux_wlan_common.h 
> b/drivers/staging/wilc1000/linux_wlan_common.h
> index e6ebf3e..14743ae 100644
> --- a/drivers/staging/wilc1000/linux_wlan_common.h
> +++ b/drivers/staging/wilc1000/linux_wlan_common.h
> @@ -54,8 +54,8 @@ extern atomic_t DEBUG_LEVEL;
>   do {\
>   if ((atomic_read(&DEBUG_LEVEL) & DEBUG) &&  \
>  ((atomic_read(®ION)) & (region))) {   \
> - printk("DBG [%s: %d]", __func__, __LINE__); \
> - printk(__VA_ARGS__);\
> + pr_debug("DBG [%s: %d]", __func__, __LINE__);   \
> + pr_debug(__VA_ARGS__);  \

This is a behavior change, I think.  pr_debug() needs to be turned on?

>   }   \
>   } while (0)
>  
> @@ -63,8 +63,8 @@ extern atomic_t DEBUG_LEVEL;
>   do {\
>   if ((atomic_read(&DEBUG_LEVEL) & INFO) &&   \
>  ((atomic_read(®ION)) & (region))) {   \
> - printk("INFO [%s]", __func__);  \
> - printk(__VA_ARGS__);\
> + pr_info("INFO [%s]", __func__); \
> + pr_info(__VA_ARGS__);   \
>   }   \
>   } while (0)
>  
> @@ -72,16 +72,16 @@ extern atomic_t DEBUG_LEVEL;
>   do {   

[PATCH 4/5] staging: wilc1000: use pr_* instead of printk

2015-08-17 Thread Raphaël Beamonte
Signed-off-by: Raphaël Beamonte 
---
 drivers/staging/wilc1000/coreconfigurator.c  |  4 ++--
 drivers/staging/wilc1000/linux_wlan.c|  8 +++
 drivers/staging/wilc1000/linux_wlan_common.h | 32 ++--
 drivers/staging/wilc1000/linux_wlan_sdio.c   |  2 +-
 drivers/staging/wilc1000/linux_wlan_spi.c|  2 +-
 drivers/staging/wilc1000/wilc_debugfs.c  | 16 +++---
 drivers/staging/wilc1000/wilc_exported_buf.c |  6 +++---
 7 files changed, 35 insertions(+), 35 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.c 
b/drivers/staging/wilc1000/coreconfigurator.c
index c81c41d..0cbf4a9c 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -2007,7 +2007,7 @@ s32 SendConfigPkt(u8 u8Mode, tstrWID *pstrWIDs,

pstrWIDs[counter].u16WIDid,
(counter == 
u32WIDsCount - 1), drvHandler)) {
ret = -1;
-   printk("[Sendconfigpkt]Get Timed out\n");
+   pr_debug("[Sendconfigpkt]Get Timed out\n");
break;
}
}
@@ -2029,7 +2029,7 @@ s32 SendConfigPkt(u8 u8Mode, tstrWID *pstrWIDs,

pstrWIDs[counter].s32ValueSize,
(counter == 
u32WIDsCount - 1), drvHandler)) {
ret = -1;
-   printk("[Sendconfigpkt]Set Timed out\n");
+   pr_debug("[Sendconfigpkt]Set Timed out\n");
break;
}
}
diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index 040e55d..1f32c36 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1306,7 +1306,7 @@ void wilc1000_wlan_deinit(linux_wlan_t *nic)
 
if (g_linux_wlan->wilc1000_initialized) {
 
-   printk("Deinitializing wilc1000  ...\n");
+   pr_info("Deinitializing wilc1000  ...\n");
 
if (nic == NULL) {
PRINT_ER("nic is NULL\n");
@@ -2565,8 +2565,8 @@ static int __init init_wilc_driver(void)
}
 #endif
 
-   printk("IN INIT FUNCTION\n");
-   printk("*** WILC1000 driver VERSION=[10.2] FW_VER=[10.2] ***\n");
+   pr_info("IN INIT FUNCTION\n");
+   pr_info("*** WILC1000 driver VERSION=[10.2] FW_VER=[10.2] ***\n");
 
linux_wlan_device_power(1);
msleep(100);
@@ -2662,7 +2662,7 @@ static void __exit exit_wilc_driver(void)
kfree(g_linux_wlan);
g_linux_wlan = NULL;
}
-   printk("Module_exit Done.\n");
+   pr_info("Module_exit Done.\n");
 
 #if defined(WILC_DEBUGFS)
wilc_debugfs_remove();
diff --git a/drivers/staging/wilc1000/linux_wlan_common.h 
b/drivers/staging/wilc1000/linux_wlan_common.h
index e6ebf3e..14743ae 100644
--- a/drivers/staging/wilc1000/linux_wlan_common.h
+++ b/drivers/staging/wilc1000/linux_wlan_common.h
@@ -54,8 +54,8 @@ extern atomic_t DEBUG_LEVEL;
do {\
if ((atomic_read(&DEBUG_LEVEL) & DEBUG) &&  \
   ((atomic_read(®ION)) & (region))) {   \
-   printk("DBG [%s: %d]", __func__, __LINE__); \
-   printk(__VA_ARGS__);\
+   pr_debug("DBG [%s: %d]", __func__, __LINE__);   \
+   pr_debug(__VA_ARGS__);  \
}   \
} while (0)
 
@@ -63,8 +63,8 @@ extern atomic_t DEBUG_LEVEL;
do {\
if ((atomic_read(&DEBUG_LEVEL) & INFO) &&   \
   ((atomic_read(®ION)) & (region))) {   \
-   printk("INFO [%s]", __func__);  \
-   printk(__VA_ARGS__);\
+   pr_info("INFO [%s]", __func__); \
+   pr_info(__VA_ARGS__);   \
}   \
} while (0)
 
@@ -72,16 +72,16 @@ extern atomic_t DEBUG_LEVEL;
do {\
if ((atomic_read(&DEBUG_LEVEL) & WRN) &&\
   ((atomic_read(®ION)) & (region))) {   \
-   printk("WRN [%s: %d]", __func__, __LINE__); \
-   printk(__VA_ARGS__