From: Tang Chen <tangchen@cn.fujitsu.com>
To: Jiang Liu <liuj97@gmail.com>
Cc: Len Brown <lenb@kernel.org>, Tony Luck <tony.luch@intel.com>,
Bob Moore <robert.moore@intel.com>,
Huang Ying <ying.huang@intel.com>,
Yinghai Lu <yinghai@kernel.org>,
Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>,
Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>,
Wen Congyang <wency@cn.fujitsu.com>,
Taku Izumi <izumi.taku@jp.fujitsu.com>,
Jiang Liu <jiang.liu@huawei.com>,
Bjorn Helgaas <bhelgaas@google.com>,
Hanjun Guo <guohanjun@huawei.com>,
linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org,
linux-pci@vger.kernel.org, Gaohuai Han <hangaohuai@huawei.com>
Subject: Re: [RFC PATCH 1/3] ACPIHP: introduce a framework for ACPI based system device hotplug
Date: Thu, 02 Aug 2012 15:07:06 +0800 [thread overview]
Message-ID: <501A271A.5030808@cn.fujitsu.com> (raw)
In-Reply-To: <1343475772-21345-2-git-send-email-jiang.liu@huawei.com>
Hi,
A little problem here. :)
On 07/28/2012 07:42 PM, Jiang Liu wrote:
> +int acpihp_register_slot(struct acpihp_slot *slot)
> +{
> + int ret;
> + char *name;
> + size_t off;
> +
> + if (!slot || !slot->slot_ops)
> + return -EINVAL;
> +
> + /* Hook top level hotplug slots under ACPI root device */
> + if (slot->parent)
> + slot->dev.parent = &slot->parent->dev;
> + else
> + slot->dev.parent = &acpi_root->dev;
> +
> + ret = device_add(&slot->dev);
> + if (!ret) {
> + slot->flags |= ACPIHP_SLOT_FLAG_REGISTERED;
> + name = kmalloc(PAGE_SIZE, GFP_KERNEL);
> + if (name) {
> + off = acpihp_generate_link_name(slot, name, 0);
> + name[off - 1] = '\0';
> + sysfs_create_link(&acpihp_slot_kset->kobj,
> + &slot->dev.kobj, name);
I got a compiler warning here:
CC drivers/acpi/hotplug/core.o
drivers/acpi/hotplug/core.c: In function ‘acpihp_register_slot’:
drivers/acpi/hotplug/core.c:199: warning: ignoring return value of ‘sysfs_create_link’, declared with attribute warn_unused_result
Seems that we need to check the sysfs_create_link()'s return value here, and if it fails,
shall we at least give a warning message here ?
Thanks. :)
> + kfree(name);
> + }
> + }
> +
> + return ret;
> +}
> +EXPORT_SYMBOL_GPL(acpihp_register_slot);
--
Best Regards,
Tang chen
next prev parent reply other threads:[~2012-08-02 7:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-28 11:42 [RFC PATCH 0/3] ACPI based system device hotplug framework Jiang Liu
2012-07-28 11:42 ` [RFC PATCH 1/3] ACPIHP: introduce a framework for ACPI based system device hotplug Jiang Liu
2012-08-02 7:07 ` Tang Chen [this message]
2012-08-02 7:07 ` Jiang Liu
2012-07-28 11:42 ` [RFC PATCH 2/3] ACPIHP: ACPI system device hotplug slot enumerator Jiang Liu
2012-08-03 6:10 ` Taku Izumi
2012-08-04 9:40 ` Jiang Liu
2012-08-04 20:14 ` Yinghai Lu
2012-08-05 9:36 ` Jiang Liu
2012-07-28 11:42 ` [RFC PATCH 3/3] ACPIHP: detect ACPI hotplug slots by checking ACPI _EJ0 method Jiang Liu
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=501A271A.5030808@cn.fujitsu.com \
--to=tangchen@cn.fujitsu.com \
--cc=bhelgaas@google.com \
--cc=guohanjun@huawei.com \
--cc=hangaohuai@huawei.com \
--cc=isimatu.yasuaki@jp.fujitsu.com \
--cc=izumi.taku@jp.fujitsu.com \
--cc=jiang.liu@huawei.com \
--cc=kaneshige.kenji@jp.fujitsu.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=liuj97@gmail.com \
--cc=robert.moore@intel.com \
--cc=tony.luch@intel.com \
--cc=wency@cn.fujitsu.com \
--cc=ying.huang@intel.com \
--cc=yinghai@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
Powered by JetHome