* [patch] clocksource: clean up parse_pmtmr()
@ 2012-10-20 4:46 Dan Carpenter
2012-11-13 19:05 ` John Stultz
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2012-10-20 4:46 UTC (permalink / raw)
To: John Stultz; +Cc: Thomas Gleixner, open list, kernel-janitors
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.carpenter@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;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch] clocksource: clean up parse_pmtmr()
2012-10-20 4:46 [patch] clocksource: clean up parse_pmtmr() Dan Carpenter
@ 2012-11-13 19:05 ` John Stultz
0 siblings, 0 replies; 2+ messages in thread
From: John Stultz @ 2012-11-13 19:05 UTC (permalink / raw)
To: Dan Carpenter; +Cc: Thomas Gleixner, open list, kernel-janitors
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.carpenter@oracle.com>
Applied. Thanks!
-john
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-11-13 19:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-20 4:46 [patch] clocksource: clean up parse_pmtmr() Dan Carpenter
2012-11-13 19:05 ` John Stultz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).