Skip to content

Commit

Permalink
clocksource: clean up parse_pmtmr()
Browse files Browse the repository at this point in the history
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>
Signed-off-by: John Stultz <john.stultz@linaro.org>
  • Loading branch information
Dan Carpenter authored and John Stultz committed Nov 13, 2012
1 parent a1c2d60 commit 60e3bf1
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions drivers/clocksource/acpi_pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 60e3bf1

Please sign in to comment.