Re: [PATCH v7 2/3] trivial: PM / Hibernate: clean up checkpatch in hibernate.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tuesday, February 04, 2014 04:06:42 PM Sebastian Capella wrote:
> Quoting Rafael J. Wysocki (2014-02-04 16:03:29)
> > On Tuesday, February 04, 2014 03:22:22 PM Sebastian Capella wrote:
> > > Quoting Sebastian Capella (2014-02-04 14:37:33)
> > > > Quoting Rafael J. Wysocki (2014-02-04 13:36:29)
> > > > > >  static int __init resumedelay_setup(char *str)
> > > > > >  {
> > > > > > -     resume_delay = simple_strtoul(str, NULL, 0);
> > > > > > +     int ret = kstrtoint(str, 0, &resume_delay);
> > > > > > +     /* mask must_check warn; on failure, leaves resume_delay unchanged */
> > > > > > +     (void)ret;
> > > 
> > > One unintended consequence of this change is that it'll now accept a
> > > negative integer parameter.
> > 
> > Well, what about using kstrtouint(), then?
> I was thinking of doing something like:
> 
> 	int delay, res;
> 	res = kstrtoint(str, 0, &delay);
> 	if (!res && delay >= 0)
> 		resume_delay = delay;
> 	return 1;

It uses simple_strtoul() for a reason.  You can change the type of resume_delay
to match, but the basic question is:

Why exactly do you want to change that thing?

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]