public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Patrick Mochel <mochel-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
To: Randy Dunlap <randy_d_dunlap-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	pcihpd-discuss-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	kristen.c.accardi-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
	len.brown-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
	gregkh-l3A5Bk7waGM@public.gmane.org,
	robert.moore-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org
Subject: Re: [PATCH 1/2] make acpi_path_name() global (v2)
Date: Mon, 19 Dec 2005 14:19:25 -0800	[thread overview]
Message-ID: <20051219221925.GA20943@linux.intel.com> (raw)
In-Reply-To: <20051219115435.13ea7bed.randy_d_dunlap-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>

On Mon, Dec 19, 2005 at 11:54:35AM -0800, Randy Dunlap wrote:
> From: Randy Dunlap <randy_d_dunlap-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
> 
> Make acpi_path_name() usable by everyone.
> I need this for adding SATA suspend/resume ACPI support.

I liked the first one better, and I think it was more appropriate, 
given its users: 

It's a function that is used by code outside of drivers/acpi/, so it
seems that it should use semantics that are common to the rest of the
kernel, and not expose/require any internal data structures than what is 
necessary (like struct acpi_buffer). 

It seems like that is the point of the ACPI OSL - to provide functions
that are stylistically and semantically familiar to the rest OS for 
which to interface with the ACPICA. In the case of Linux and this 
function, that would be more like providing an interface that you did
before - returning a char * that the caller has to free.

Note that Kristen made an argument that it's a burden on the caller,
and a source for memory leak bugs. That's a valid concern, but there
are many examples of similar interfaces (think strdup(3) or kstrdup()),
and the effects can be mitigated by proper documentation. For the 
kernel, one could potentially integrate a check for that type of bad
programming into sparse.. Besides, making the caller understand 
enough of the semantics of the ACPICA to initialize and tear down
the acpi_buffer is arguably a much larger burden than knowing you 
have to free the string returned..

Thanks,


	Patrick



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click

  parent reply	other threads:[~2005-12-19 22:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-19 19:54 [PATCH 1/2] make acpi_path_name() global (v2) Randy Dunlap
     [not found] ` <20051219115435.13ea7bed.randy_d_dunlap-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2005-12-19 20:43   ` Kristen Accardi
2005-12-19 22:19   ` Patrick Mochel [this message]
     [not found]     ` <20051219221925.GA20943-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2005-12-19 21:19       ` Randy Dunlap

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=20051219221925.GA20943@linux.intel.com \
    --to=mochel-vuqaysv1563yd54fqh9/ca@public.gmane.org \
    --cc=acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=gregkh-l3A5Bk7waGM@public.gmane.org \
    --cc=kristen.c.accardi-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=len.brown-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=pcihpd-discuss-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=randy_d_dunlap-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
    --cc=robert.moore-ral2JQCrhuEAvxtiuMwx3w@public.gmane.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