Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754159Ab2HBHJW (ORCPT ); Thu, 2 Aug 2012 03:09:22 -0400 Received: from szxga01-in.huawei.com ([119.145.14.64]:16483 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751486Ab2HBHJV (ORCPT ); Thu, 2 Aug 2012 03:09:21 -0400 Message-ID: <501A2740.3000309@huawei.com> Date: Thu, 2 Aug 2012 15:07:44 +0800 From: Jiang Liu User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: Tang Chen CC: Jiang Liu , Len Brown , Tony Luck , Bob Moore , Huang Ying , Yinghai Lu , Yasuaki Ishimatsu , Kenji Kaneshige , Wen Congyang , Taku Izumi , Bjorn Helgaas , Hanjun Guo , , , , Gaohuai Han Subject: Re: [RFC PATCH 1/3] ACPIHP: introduce a framework for ACPI based system device hotplug References: <1343475772-21345-1-git-send-email-jiang.liu@huawei.com> <1343475772-21345-2-git-send-email-jiang.liu@huawei.com> <501A271A.5030808@cn.fujitsu.com> In-Reply-To: <501A271A.5030808@cn.fujitsu.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.108.108.229] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1702 Lines: 62 On 2012-8-2 15:07, Tang Chen wrote: > 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. :) Hi Tang, Thanks for your comments, will fix it in next version. Regards! Gerry > > >> + kfree(name); >> + } >> + } >> + >> + return ret; >> +} >> +EXPORT_SYMBOL_GPL(acpihp_register_slot); > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/