[PATCH] clean up a compile time warning in the use of strict_strtol but that waspassing an s32 * when it should be passing a long *

From: mgross
Date: Mon May 23 2011 - 10:14:09 EST


---
kernel/pm_qos_params.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/kernel/pm_qos_params.c b/kernel/pm_qos_params.c
index d61ecf3..dd37c56 100644
--- a/kernel/pm_qos_params.c
+++ b/kernel/pm_qos_params.c
@@ -405,6 +405,7 @@ static ssize_t pm_qos_power_write(struct file *filp, const char __user *buf,
size_t count, loff_t *f_pos)
{
s32 value;
+ long safe_int;
int x;
char ascii_value[11];
struct pm_qos_request_list *pm_qos_req;
@@ -417,10 +418,11 @@ static ssize_t pm_qos_power_write(struct file *filp, const char __user *buf,
ascii_value[count] = 0;
if (copy_from_user(ascii_value, buf, count))
return -EFAULT;
- if ((x=strict_strtol(ascii_value, 16, &value)) != 0){
- pr_debug("%s, 0x%x, 0x%x\n",ascii_value, value, x);
+ if ((x=strict_strtol(ascii_value, 16, &safe_int)) != 0){
+ pr_debug("%s, 0x%lx, 0x%x\n",ascii_value, safe_int, x);
return -EINVAL;
}
+ value = (s32) safe_int;
} else
return -EINVAL;

--
1.7.4.1

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