mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Alex Williamson <alex.williamson@hp.com>
Cc: Matthew Wilcox <willy@debian.org>,
	John Belmonte <john@neggie.net>,
	acpi-devel@lists.sourceforge.net,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [ACPI] Re: [PATCH] filling in ACPI method access via sysfs namespace
Date: Thu, 6 May 2004 12:02:10 +0200	[thread overview]
Message-ID: <20040506100210.GA194@elf.ucw.cz> (raw)
In-Reply-To: <1081740686.1715.20.camel@debian>

Hi!

> > It seems unintuitive that you have to read the file for the method to
> > take effect.  How about having the write function invoke the method and
> > (if there is a result) store it for later read-back via the read function?
> > It should be discarded on close, of course.  A read() on a file with
> > no stored result should invoke the ACPI method (on the assumption this
> > is a parameter-less method) and return the result directly.  Closing a
> > file should discard any result from the method.
> 
>    How's this?  It behaves the way you described, but might be doing
> some questionable things with the buffer to get there.  Is there a
> better place to store the return data than back into the buf passed to
> write() (aka file->private_data)?  Without adding callbacks to
> open/close, I'm not sure how else we can dispose of the results on
> close.  Thanks,


> +	/*
> +	 * For convenience, handle cases where the last argument
> +	 * is too small.
> +	 */
> +	count = length / sizeof(union acpi_object);
> +	if (length % sizeof(union acpi_object))
> +		count++;
> +
> +	if (count) {
> +		size = sizeof(struct acpi_object_list) +
> +		       ((count - 1) * sizeof(union acpi_object *));

This probably makes it *way* too implementation dependand.
								Pavel
-- 
When do you have heart between your knees?

  parent reply	other threads:[~2004-05-07 14:27 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-08 19:49 Alex Williamson
2004-04-09 22:21 ` Alex Williamson
2004-04-10  1:52   ` [ACPI] " John Belmonte
2004-04-10  3:12     ` Alex Williamson
2004-04-10  5:31       ` John Belmonte
2004-04-10 20:42         ` Alex Williamson
2004-04-11  3:20           ` Alex Williamson
2004-04-11 22:29             ` Matthew Wilcox
2004-04-12  3:31               ` Alex Williamson
2004-04-19 15:45                 ` Alex Williamson
2004-05-06 10:02                 ` Pavel Machek [this message]
2004-04-10  5:32       ` Alex Williamson
     [not found] <fa.n5srcao.1k1orra@ifi.uio.no>
     [not found] ` <fa.e0sva3e.u5k09i@ifi.uio.no>
2004-04-12  4:13   ` Andy Lutomirski
2004-04-12  4:32     ` Alex Williamson

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=20040506100210.GA194@elf.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=acpi-devel@lists.sourceforge.net \
    --cc=alex.williamson@hp.com \
    --cc=john@neggie.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=willy@debian.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

Powered by JetHome