From: Hanjun Guo <guohanjun@huawei.com>
To: Miao Wang <shankerwangmiao@gmail.com>,
Sunil V L <sunilvl@ventanamicro.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>, <linux-acpi@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Len Brown <lenb@kernel.org>
Subject: Re: [PATCH] ACPI: rename acpi_arm_init to acpi_arch_init
Date: Sat, 27 Jul 2024 14:52:02 +0800 [thread overview]
Message-ID: <cff8c915-2978-085a-dfcd-dc117fd2f909@huawei.com> (raw)
In-Reply-To: <1A59AB2E-58A6-4D9F-9976-DABFAA825EE0@gmail.com>
On 2024/7/27 2:23, Miao Wang wrote:
>
>> 2024年7月27日 01:55,Sunil V L <sunilvl@ventanamicro.com> 写道:
>>
>> On Sat, Jul 27, 2024 at 12:39:03AM +0800, Miao Wang wrote:
>>> Hi,
>>>
>>> Thanks for your quick reply.
>>>
>>>> 2024年7月27日 00:05,Sudeep Holla <sudeep.holla@arm.com> 写道:
>>>>
>>>> On Fri, Jul 26, 2024 at 11:03:01PM +0800, Miao Wang via B4 Relay wrote:
[...]
>>>>>
>>>>> -#ifdef CONFIG_ARM64
>>>>> -void acpi_arm_init(void);
>>>>> +#ifdef ACPI_HAVE_ARCH_INIT
>>>>> +void acpi_arch_init(void);
>>>>
>>>> This is bit inconsistent. The Makefile is still conditional on
>>>> CONFIG_ARM64 while here you move to ACPI_HAVE_ARCH_INIT.
>>>> So while not just undefine and redefine acpi_arch_init to acpi_arm_init.
>>>> Something like this must work ?
>>>>
>>>> #define acpi_arch_init() do { }while(0)
>>>>
>>>> #ifdef CONFIG_ARM64
>>>> #undef acpi_arch_init
>>>> #define acpi_arch_init() acpi_arm_init()
>>>> #endif
>>>
>>> It will work. However I can see the pattern in other parts, where
>>> the definition of a macro named HAVE_xxx is checked, and define an
>>> inline static function with empty body if such macro is not defined
>>> or define a function prototype with the same name otherwise, like
>>> acpi_arch_set_root_pointer. I'm just trying to follow this pattern.
>>>
>> I was thinking to make it weak function similar to cpc_read_ffh().
>> Wouldn't it be better than ifdefery?
>
> I believe there would be performance loss for those arches with a stub
> function definition if a weak function is used (correct me if wrong).
> So the approach with a static inline stub is more common in the kernel
> code.
ACPI init is not in the hot code path, no worries for the performance
loss.
Weak function is my preference too :)
Thanks
Hanjun
prev parent reply other threads:[~2024-07-27 6:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-26 15:03 [PATCH] ACPI: rename acpi_arm_init to acpi_arch_init Miao Wang via B4 Relay
2024-07-26 16:05 ` Sudeep Holla
2024-07-26 16:39 ` Miao Wang
2024-07-26 17:55 ` Sunil V L
2024-07-26 18:23 ` Miao Wang
2024-07-27 6:52 ` Hanjun Guo [this message]
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=cff8c915-2978-085a-dfcd-dc117fd2f909@huawei.com \
--to=guohanjun@huawei.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=rafael@kernel.org \
--cc=shankerwangmiao@gmail.com \
--cc=sudeep.holla@arm.com \
--cc=sunilvl@ventanamicro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox