[OPW,kernel] Staging: rtl8188eu: rtw_debug: Replace sscanf with kstrto
diff mbox

Message ID 1414701326-14038-1-git-send-email-suryaseetharaman.9@gmail.com
State New, archived
Headers show

Commit Message

tssurya Oct. 30, 2014, 8:35 p.m. UTC
Removes the checkpatch warning:-
WARNING: Prefer kstrto<type> to single variable sscanf

Signed-off-by: Surya Seetharaman <suryaseetharaman.9@gmail.com>
---
 drivers/staging/rtl8188eu/core/rtw_debug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Greg KH Oct. 30, 2014, 8:38 p.m. UTC | #1
On Fri, Oct 31, 2014 at 02:05:26AM +0530, Surya Seetharaman wrote:
> Removes the checkpatch warning:-
> WARNING: Prefer kstrto<type> to single variable sscanf
> 
> Signed-off-by: Surya Seetharaman <suryaseetharaman.9@gmail.com>
> ---
>  drivers/staging/rtl8188eu/core/rtw_debug.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/rtl8188eu/core/rtw_debug.c b/drivers/staging/rtl8188eu/core/rtw_debug.c
> index 1f72f7d..ed6f3b8 100644
> --- a/drivers/staging/rtl8188eu/core/rtw_debug.c
> +++ b/drivers/staging/rtl8188eu/core/rtw_debug.c
> @@ -811,7 +811,7 @@ int proc_set_rssi_disp(struct file *file, const char __user *buffer,
>  	}
>  
>  	if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
> -		int num = sscanf(tmp, "%x", &enable);
> +		int num = kstrto(tmp, "%x", &enable);
>  
>  		if (num !=  1) {
>  			DBG_88E("invalid set_rssi_disp parameter!\n");

Did you compile this?  I haven't yet, but I really don't think it will
work...
Julia Lawall Oct. 30, 2014, 9:09 p.m. UTC | #2
On Fri, 31 Oct 2014, Surya Seetharaman wrote:

> Removes the checkpatch warning:-
> WARNING: Prefer kstrto<type> to single variable sscanf
> 
> Signed-off-by: Surya Seetharaman <suryaseetharaman.9@gmail.com>
> ---
>  drivers/staging/rtl8188eu/core/rtw_debug.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/rtl8188eu/core/rtw_debug.c b/drivers/staging/rtl8188eu/core/rtw_debug.c
> index 1f72f7d..ed6f3b8 100644
> --- a/drivers/staging/rtl8188eu/core/rtw_debug.c
> +++ b/drivers/staging/rtl8188eu/core/rtw_debug.c
> @@ -811,7 +811,7 @@ int proc_set_rssi_disp(struct file *file, const char __user *buffer,
>  	}
>  
>  	if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
> -		int num = sscanf(tmp, "%x", &enable);
> +		int num = kstrto(tmp, "%x", &enable);

I don't think there is any suc function as kstrto.  The message says 
kstrto<type>.  This is because there is eg kstrtoul.

It doesn't seem like you compiled the code.  If you think that you 
compiled the code, check whether you actually have a .o file corresponding 
to this file,  If not, you may need to adjust your configuration options.

julia

>  
>  		if (num !=  1) {
>  			DBG_88E("invalid set_rssi_disp parameter!\n");
> -- 
> 1.9.1
> 
> -- 
> You received this message because you are subscribed to the Google Groups "opw-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to opw-kernel+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

Patch
diff mbox

diff --git a/drivers/staging/rtl8188eu/core/rtw_debug.c b/drivers/staging/rtl8188eu/core/rtw_debug.c
index 1f72f7d..ed6f3b8 100644
--- a/drivers/staging/rtl8188eu/core/rtw_debug.c
+++ b/drivers/staging/rtl8188eu/core/rtw_debug.c
@@ -811,7 +811,7 @@  int proc_set_rssi_disp(struct file *file, const char __user *buffer,
 	}
 
 	if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
-		int num = sscanf(tmp, "%x", &enable);
+		int num = kstrto(tmp, "%x", &enable);
 
 		if (num !=  1) {
 			DBG_88E("invalid set_rssi_disp parameter!\n");