From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3848CECAAD2 for ; Sat, 27 Aug 2022 13:19:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229995AbiH0NTj (ORCPT ); Sat, 27 Aug 2022 09:19:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229677AbiH0NTi (ORCPT ); Sat, 27 Aug 2022 09:19:38 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37B587198A; Sat, 27 Aug 2022 06:19:37 -0700 (PDT) Received: from dggpemm500022.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MFHJc4yxCzkWV9; Sat, 27 Aug 2022 21:16:00 +0800 (CST) Received: from dggpemm500002.china.huawei.com (7.185.36.229) by dggpemm500022.china.huawei.com (7.185.36.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sat, 27 Aug 2022 21:19:35 +0800 Received: from [10.174.178.247] (10.174.178.247) by dggpemm500002.china.huawei.com (7.185.36.229) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sat, 27 Aug 2022 21:19:34 +0800 Subject: Re: [PATCH v2 5/5] ACPI: Drop parent field from struct acpi_device To: "Rafael J. Wysocki" , Linux ACPI CC: LKML , Andy Shevchenko , Linux PM , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Wei Liu , Dexuan Cui , Mark Brown , "Andreas Noever" , Michael Jamet , Mika Westerberg , Yehezkel Bernat , , , , , , "Will Deacon" , Mark Rutland , Andy Gross , Bjorn Andersson , "Konrad Dybcio" References: <12036348.O9o76ZdvQC@kreacher> <2196460.iZASKD2KPV@kreacher> <5857822.lOV4Wx5bFT@kreacher> From: Hanjun Guo Message-ID: Date: Sat, 27 Aug 2022 21:19:33 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <5857822.lOV4Wx5bFT@kreacher> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.178.247] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm500002.china.huawei.com (7.185.36.229) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Hi Rafael, On 2022/8/25 0:59, Rafael J. Wysocki wrote: > Index: linux-pm/include/acpi/acpi_bus.h > =================================================================== > --- linux-pm.orig/include/acpi/acpi_bus.h > +++ linux-pm/include/acpi/acpi_bus.h > @@ -365,7 +365,6 @@ struct acpi_device { > int device_type; > acpi_handle handle; /* no handle for fixed hardware */ > struct fwnode_handle fwnode; > - struct acpi_device *parent; > struct list_head wakeup_list; > struct list_head del_list; > struct acpi_device_status status; > @@ -458,6 +457,14 @@ static inline void *acpi_driver_data(str > #define to_acpi_device(d) container_of(d, struct acpi_device, dev) > #define to_acpi_driver(d) container_of(d, struct acpi_driver, drv) > > +static inline struct acpi_device *acpi_dev_parent(struct acpi_device *adev) > +{ > + if (adev->dev.parent) > + return to_acpi_device(adev->dev.parent); > + > + return NULL; > +} > + > static inline void acpi_set_device_status(struct acpi_device *adev, u32 sta) > { > *((u32 *)&adev->status) = sta; > @@ -478,6 +485,7 @@ void acpi_initialize_hp_context(struct a > /* acpi_device.dev.bus == &acpi_bus_type */ > extern struct bus_type acpi_bus_type; > > +struct acpi_device *acpi_dev_parent(struct acpi_device *adev); We have a static inline function above, is it duplicated here? Or did I miss some use cases? Thanks Hanjun From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BDBC1ECAAD2 for ; Sat, 27 Aug 2022 13:20:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:CC:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=hJYVvEByiTfqb7PwfjwiV33X1FpS++A24eZH0H0M2jo=; b=NzwtRQxAweihUyDoeTL6FcQX5/ Xg0pHaEccL6iZ3VySF6xDB2l38ddPCDAPxyxhJCLh8wZZYC0Ki2wtM+dmTzozD4xKKAUH4BxwJeT/ jd9Gsb/ImuVBapgsqCZ9vr6f2K/f403pvSDzSmjx/skpQNN57dVm4hndJuxbzfc+sS9Okcougj9ar lme67nSWN+P1kOEGC8DHlEb9u5Tpv5VLMgsxVcPFgoZDmPhtRCaxKibXvdnKxSeKwiznDFHwwqUr6 wbhqDqatrHQ/mopMAddDh6WQdlqYXsyv0VESrLk3C7EKfXfac4WfjeFyDVniRgXDVfnzdz5rKkU/o Da2gRYag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oRvj3-00Aeiu-LB; Sat, 27 Aug 2022 13:19:49 +0000 Received: from szxga01-in.huawei.com ([45.249.212.187]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oRviz-00AeaM-Rs for linux-arm-kernel@lists.infradead.org; Sat, 27 Aug 2022 13:19:47 +0000 Received: from dggpemm500022.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MFHJc4yxCzkWV9; Sat, 27 Aug 2022 21:16:00 +0800 (CST) Received: from dggpemm500002.china.huawei.com (7.185.36.229) by dggpemm500022.china.huawei.com (7.185.36.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sat, 27 Aug 2022 21:19:35 +0800 Received: from [10.174.178.247] (10.174.178.247) by dggpemm500002.china.huawei.com (7.185.36.229) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sat, 27 Aug 2022 21:19:34 +0800 Subject: Re: [PATCH v2 5/5] ACPI: Drop parent field from struct acpi_device To: "Rafael J. Wysocki" , Linux ACPI CC: LKML , Andy Shevchenko , Linux PM , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Wei Liu , Dexuan Cui , Mark Brown , "Andreas Noever" , Michael Jamet , Mika Westerberg , Yehezkel Bernat , , , , , , "Will Deacon" , Mark Rutland , Andy Gross , Bjorn Andersson , "Konrad Dybcio" References: <12036348.O9o76ZdvQC@kreacher> <2196460.iZASKD2KPV@kreacher> <5857822.lOV4Wx5bFT@kreacher> From: Hanjun Guo Message-ID: Date: Sat, 27 Aug 2022 21:19:33 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <5857822.lOV4Wx5bFT@kreacher> Content-Language: en-GB X-Originating-IP: [10.174.178.247] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm500002.china.huawei.com (7.185.36.229) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220827_061946_173882_1F2D216F X-CRM114-Status: GOOD ( 12.24 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Rafael, On 2022/8/25 0:59, Rafael J. Wysocki wrote: > Index: linux-pm/include/acpi/acpi_bus.h > =================================================================== > --- linux-pm.orig/include/acpi/acpi_bus.h > +++ linux-pm/include/acpi/acpi_bus.h > @@ -365,7 +365,6 @@ struct acpi_device { > int device_type; > acpi_handle handle; /* no handle for fixed hardware */ > struct fwnode_handle fwnode; > - struct acpi_device *parent; > struct list_head wakeup_list; > struct list_head del_list; > struct acpi_device_status status; > @@ -458,6 +457,14 @@ static inline void *acpi_driver_data(str > #define to_acpi_device(d) container_of(d, struct acpi_device, dev) > #define to_acpi_driver(d) container_of(d, struct acpi_driver, drv) > > +static inline struct acpi_device *acpi_dev_parent(struct acpi_device *adev) > +{ > + if (adev->dev.parent) > + return to_acpi_device(adev->dev.parent); > + > + return NULL; > +} > + > static inline void acpi_set_device_status(struct acpi_device *adev, u32 sta) > { > *((u32 *)&adev->status) = sta; > @@ -478,6 +485,7 @@ void acpi_initialize_hp_context(struct a > /* acpi_device.dev.bus == &acpi_bus_type */ > extern struct bus_type acpi_bus_type; > > +struct acpi_device *acpi_dev_parent(struct acpi_device *adev); We have a static inline function above, is it duplicated here? Or did I miss some use cases? Thanks Hanjun _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel