All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Zefan <lizf@cn.fujitsu.com>
To: "Thomas, Sujith" <sujith.thomas@intel.com>
Cc: "Zhang, Rui" <rui.zhang@intel.com>,
	Randy Dunlap <randy.dunlap@oracle.com>,
	sam@ravnborg.org, lenb@kernel.org, linux-acpi@vger.kernel.org,
	linux-pm@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 9/10] introduce intel_menlow platform specific driver
Date: Mon, 21 Jan 2008 13:45:42 +0800	[thread overview]
Message-ID: <47943186.8030001@cn.fujitsu.com> (raw)
In-Reply-To: <05B550FD4BD2014E841D83547B6260080281A8A8@bgsmsx411.gar.corp.intel.com>

>>> +static int __init intel_menlow_module_init(void)
>>> +{
>>> +	int result = -ENODEV;
>>> +	acpi_status status;
>>> +	unsigned long enable;
>>> +
>>> +	if (acpi_disabled)
>>> +		return result;
>>> +
>>> +	/* Looking for the \_TZ.GSTS method */
>>> +	status = acpi_evaluate_integer(NULL, BIOS_ENABLED, NULL, &enable);
>>> +	if (ACPI_FAILURE(status) || !enable)
>>> +		return -ENODEV;
>>> +
>>> +	/* Looking for ACPI device MEM0 with hardware id INT0002 */
>>> +	result = acpi_bus_register_driver(&intel_menlow_memory_driver);
>>> +	if (result)
>>> +		return result;
>>> +
>>> +	/* Looking for sensors in each ACPI thermal zone */
>>> +	status = acpi_walk_namespace(ACPI_TYPE_THERMAL, ACPI_ROOT_OBJECT,
>>> +				     ACPI_UINT32_MAX,
>>> +				     intel_menlow_register_sensor, NULL, NULL);
>>> +	if (ACPI_FAILURE(status))
>>> +		result = -ENODEV;
>>> +
>> It seems to me this should be 'return -ENODEV;'
>>
>> You can just eliminate variable result, because result will be
>> -ENODEV only.
> I disagree. "result" is required to store the return value from acpi_bus_register_driver which may be different from ENODEV. Otherwise it's all -ENODEV.
> 
> :-Sujith

Indead, I overlooked it.

But the above 'result = -ENODEV;' should be 'return -ENODEV;', right?

>>> +	return 0;
>>> +}


  reply	other threads:[~2008-01-21  5:46 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-17  7:51 [PATCH 9/10] introduce intel_menlow platform specific driver Zhang Rui
2008-01-17  8:18 ` Sam Ravnborg
2008-01-17  8:18 ` Sam Ravnborg
2008-01-17 17:20 ` Randy Dunlap
2008-01-17 19:51   ` Len Brown
2008-01-17 19:51   ` Len Brown
2008-01-17 20:51     ` Randy Dunlap
2008-01-17 20:51     ` Randy Dunlap
2008-01-18  3:32   ` Zhang Rui
2008-01-18  3:55     ` Li Zefan
2008-01-18  3:55       ` Li Zefan
2008-01-21  5:26       ` Thomas, Sujith
2008-01-21  5:26       ` Thomas, Sujith
2008-01-21  5:26         ` Thomas, Sujith
2008-01-21  5:45         ` Li Zefan [this message]
2008-01-25  3:45           ` Zhang Rui
2008-01-25  3:45           ` Zhang Rui
2008-01-21  5:45         ` Li Zefan
2008-01-18  3:55     ` Li Zefan
2008-01-18  3:32   ` Zhang Rui
2008-01-17 17:20 ` Randy Dunlap
2008-01-21  9:53 ` Christoph Hellwig
2008-01-21 14:19   ` Thomas, Sujith
2008-01-21 14:19     ` Thomas, Sujith
2008-01-23 15:58     ` Jan Engelhardt
2008-01-23 15:58     ` Jan Engelhardt
2008-01-21 14:19   ` Thomas, Sujith
2008-01-24 21:39   ` Len Brown
2008-01-24 21:39   ` Len Brown
2008-01-21  9:53 ` Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
2008-01-17  7:51 Zhang Rui

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=47943186.8030001@cn.fujitsu.com \
    --to=lizf@cn.fujitsu.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=randy.dunlap@oracle.com \
    --cc=rui.zhang@intel.com \
    --cc=sam@ravnborg.org \
    --cc=sujith.thomas@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.