public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Zhang Rui <rui.zhang@intel.com>
To: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: linux-acpi@vger.kernel.org, lenb@kernel.org
Subject: Re: [PATCH 0/8] [-mm] ACPI: add ACPI device sysfs interface
Date: Wed, 21 Mar 2007 15:17:01 +0800	[thread overview]
Message-ID: <1174461421.8833.103.camel@localhost.localdomain> (raw)
In-Reply-To: <20070320153105.GD13042@khazad-dum.debian.net>

On Tue, 2007-03-20 at 12:31 -0300, Henrique de Moraes Holschuh wrote:
> On Tue, 20 Mar 2007, Zhang Rui wrote:
> > Add sysfs interface for ACPI devices.
> 
> While doing the ibm-acpi sysfs work (not submitted yet), I have found I need
> something like this to properly parse simple ulongs from sysfs:
> 
> static int parse_strtoul(const char *buf,
> 		unsigned long max, unsigned long *value)
> {
> 	char *endp;
> 
> 	*value = simple_strtoul(buf, &endp, 0);
> 	while (*endp && isspace(*endp))
> 		endp++;
> 	if (*endp || *value > max)
> 		return -EINVAL;
> 
> 	return 0;
> }
> 
Sounds nice.
But I think it can work better without the parameter "max".
Not all of the .store functions have "max" limit, e.g. the thermal
polling_freq, while some of them may need "max" and "min" limit both,
like fan state (0/3).
So why not just get the value and let the .store function judge it? :)

Thanks,
Rui.

  reply	other threads:[~2007-03-21  7:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-20  9:21 [PATCH 0/8] [-mm] ACPI: add ACPI device sysfs interface Zhang Rui
2007-03-20 15:31 ` Henrique de Moraes Holschuh
2007-03-21  7:17   ` Zhang Rui [this message]
2007-03-21 19:11     ` Henrique de Moraes Holschuh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1174461421.8833.103.camel@localhost.localdomain \
    --to=rui.zhang@intel.com \
    --cc=hmh@hmh.eng.br \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox