Re: [patch] clocksource: clean up parse_pmtmr()

2012-11-13 Thread John Stultz

On 10/19/2012 09:46 PM, Dan Carpenter wrote:

I changed the strict_strtoul() to kstrtouint().  That has the check
for UINT_MAX built in to it so the ifdefs can be removed.  Also
I changed a printk() to pr_info().

Signed-off-by: Dan Carpenter 

Applied. Thanks!
-john

--
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] clocksource: clean up parse_pmtmr()

2012-11-13 Thread John Stultz

On 10/19/2012 09:46 PM, Dan Carpenter wrote:

I changed the strict_strtoul() to kstrtouint().  That has the check
for UINT_MAX built in to it so the ifdefs can be removed.  Also
I changed a printk() to pr_info().

Signed-off-by: Dan Carpenter dan.carpen...@oracle.com

Applied. Thanks!
-john

--
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/


[patch] clocksource: clean up parse_pmtmr()

2012-10-19 Thread Dan Carpenter
I changed the strict_strtoul() to kstrtouint().  That has the check
for UINT_MAX built in to it so the ifdefs can be removed.  Also
I changed a printk() to pr_info().

Signed-off-by: Dan Carpenter 

diff --git a/drivers/clocksource/acpi_pm.c b/drivers/clocksource/acpi_pm.c
index 6b5cf02..5d1b926 100644
--- a/drivers/clocksource/acpi_pm.c
+++ b/drivers/clocksource/acpi_pm.c
@@ -233,16 +233,15 @@ fs_initcall(init_acpi_pm_clocksource);
  */
 static int __init parse_pmtmr(char *arg)
 {
-   unsigned long base;
+   unsigned int base;
+   int ret;
 
-   if (strict_strtoul(arg, 16, ))
-   return -EINVAL;
-#ifdef CONFIG_X86_64
-   if (base > UINT_MAX)
-   return -ERANGE;
-#endif
-   printk(KERN_INFO "PMTMR IOPort override: 0x%04x -> 0x%04lx\n",
-  pmtmr_ioport, base);
+   ret = kstrtouint(arg, 16, );
+   if (ret)
+   return ret;
+
+   pr_info("PMTMR IOPort override: 0x%04x -> 0x%04x\n", pmtmr_ioport,
+   base);
pmtmr_ioport = base;
 
return 1;
--
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/


[patch] clocksource: clean up parse_pmtmr()

2012-10-19 Thread Dan Carpenter
I changed the strict_strtoul() to kstrtouint().  That has the check
for UINT_MAX built in to it so the ifdefs can be removed.  Also
I changed a printk() to pr_info().

Signed-off-by: Dan Carpenter dan.carpen...@oracle.com

diff --git a/drivers/clocksource/acpi_pm.c b/drivers/clocksource/acpi_pm.c
index 6b5cf02..5d1b926 100644
--- a/drivers/clocksource/acpi_pm.c
+++ b/drivers/clocksource/acpi_pm.c
@@ -233,16 +233,15 @@ fs_initcall(init_acpi_pm_clocksource);
  */
 static int __init parse_pmtmr(char *arg)
 {
-   unsigned long base;
+   unsigned int base;
+   int ret;
 
-   if (strict_strtoul(arg, 16, base))
-   return -EINVAL;
-#ifdef CONFIG_X86_64
-   if (base  UINT_MAX)
-   return -ERANGE;
-#endif
-   printk(KERN_INFO PMTMR IOPort override: 0x%04x - 0x%04lx\n,
-  pmtmr_ioport, base);
+   ret = kstrtouint(arg, 16, base);
+   if (ret)
+   return ret;
+
+   pr_info(PMTMR IOPort override: 0x%04x - 0x%04x\n, pmtmr_ioport,
+   base);
pmtmr_ioport = base;
 
return 1;
--
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/