Linux-ACPI Archive mirror
 help / color / mirror / Atom feed
* [PATCH] acpi: Fix header declaration of acpi_arch_dma_setup() w/o CONFIG_ACPI
@ 2023-05-22 16:06 Dave Jiang
  2023-06-01  1:48 ` Hanjun Guo
  0 siblings, 1 reply; 4+ messages in thread
From: Dave Jiang @ 2023-05-22 16:06 UTC (permalink / raw
  To: lpieralisi, guohanjun, sudeep.holla
  Cc: kernel test robot, Jianmin Lv, Rafael J. Wysocki, rafael, lenb,
	linux-acpi, linux-arm-kernel, linux-kernel

arm64 build can be done without CONFIG_ACPI. The ifdef bits for
acpi_arch_dma_setup() is placed inside CONFIG_ACPI. When CONFIG_ACPI is
not set, this causes warning reported by kernel test bot. Move the
prototype declaration for acpi_arch_dma_setup() outside of CONFIG_ACPI.

>> drivers/acpi/arm64/dma.c:7:6: warning: no previous prototype for function 'acpi_arch_dma_setup' [-Wmissing-prototypes]
   void acpi_arch_dma_setup(struct device *dev)
        ^
   drivers/acpi/arm64/dma.c:7:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   void acpi_arch_dma_setup(struct device *dev)
   ^
   static
   1 warning generated.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202305200933.afKCLlxS-lkp@intel.com/
Fixes: bf2ee8d0c385 ("ACPI: scan: Support multiple DMA windows with different offsets")
CC: Jianmin Lv <lvjianmin@loongson.cn>
CC: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
---
 include/linux/acpi.h |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 7b71dd74baeb..a0a8492d8a60 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -281,12 +281,6 @@ acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa) { }
 
 void acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa);
 
-#if defined(CONFIG_ARM64) || defined(CONFIG_LOONGARCH)
-void acpi_arch_dma_setup(struct device *dev);
-#else
-static inline void acpi_arch_dma_setup(struct device *dev) { }
-#endif
-
 #ifdef CONFIG_ARM64
 void acpi_numa_gicc_affinity_init(struct acpi_srat_gicc_affinity *pa);
 #else
@@ -1084,6 +1078,12 @@ static inline bool acpi_sleep_state_supported(u8 sleep_state)
 
 #endif	/* !CONFIG_ACPI */
 
+#if defined(CONFIG_ARM64) || defined(CONFIG_LOONGARCH)
+void acpi_arch_dma_setup(struct device *dev);
+#else
+static inline void acpi_arch_dma_setup(struct device *dev) { }
+#endif
+
 #ifdef CONFIG_ACPI_HOTPLUG_IOAPIC
 int acpi_ioapic_add(acpi_handle root);
 #else



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] acpi: Fix header declaration of acpi_arch_dma_setup() w/o CONFIG_ACPI
  2023-05-22 16:06 [PATCH] acpi: Fix header declaration of acpi_arch_dma_setup() w/o CONFIG_ACPI Dave Jiang
@ 2023-06-01  1:48 ` Hanjun Guo
  2023-06-01 10:31   ` Robin Murphy
  0 siblings, 1 reply; 4+ messages in thread
From: Hanjun Guo @ 2023-06-01  1:48 UTC (permalink / raw
  To: Dave Jiang, lpieralisi, sudeep.holla
  Cc: kernel test robot, Jianmin Lv, Rafael J. Wysocki, rafael, lenb,
	linux-acpi, linux-arm-kernel, linux-kernel

Hi Dave,

Sorry for the late reply, I have some comments inline.

On 2023/5/23 0:06, Dave Jiang wrote:
> arm64 build can be done without CONFIG_ACPI. The ifdef bits for
> acpi_arch_dma_setup() is placed inside CONFIG_ACPI. When CONFIG_ACPI is
> not set, this causes warning reported by kernel test bot. Move the
> prototype declaration for acpi_arch_dma_setup() outside of CONFIG_ACPI.

...

> 
>>> drivers/acpi/arm64/dma.c:7:6: warning: no previous prototype for function 'acpi_arch_dma_setup' [-Wmissing-prototypes]
>     void acpi_arch_dma_setup(struct device *dev)
>          ^
>     drivers/acpi/arm64/dma.c:7:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
>     void acpi_arch_dma_setup(struct device *dev)
>     ^
>     static
>     1 warning generated.

drivers/acpi can only be compiled with CONFIG_ACPI=y, so
drivers/acpi/arm64/ will be the same, not sure how to trigger
this compile warning.

I disable CONFIG_ACPI on my ARM64 machine, but didn't get the
warning you reported.

> 
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202305200933.afKCLlxS-lkp@intel.com/

How to generate the kernel config file as you kindly attached in the
link?

Thanks
Hanjun

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] acpi: Fix header declaration of acpi_arch_dma_setup() w/o CONFIG_ACPI
  2023-06-01  1:48 ` Hanjun Guo
@ 2023-06-01 10:31   ` Robin Murphy
  2023-06-01 15:24     ` Dave Jiang
  0 siblings, 1 reply; 4+ messages in thread
From: Robin Murphy @ 2023-06-01 10:31 UTC (permalink / raw
  To: Hanjun Guo, Dave Jiang, lpieralisi, sudeep.holla
  Cc: kernel test robot, Jianmin Lv, Rafael J. Wysocki, rafael, lenb,
	linux-acpi, linux-arm-kernel, linux-kernel

On 2023-06-01 02:48, Hanjun Guo wrote:
> Hi Dave,
> 
> Sorry for the late reply, I have some comments inline.
> 
> On 2023/5/23 0:06, Dave Jiang wrote:
>> arm64 build can be done without CONFIG_ACPI. The ifdef bits for
>> acpi_arch_dma_setup() is placed inside CONFIG_ACPI. When CONFIG_ACPI is
>> not set, this causes warning reported by kernel test bot. Move the
>> prototype declaration for acpi_arch_dma_setup() outside of CONFIG_ACPI.
> 
> ...
> 
>>
>>>> drivers/acpi/arm64/dma.c:7:6: warning: no previous prototype for 
>>>> function 'acpi_arch_dma_setup' [-Wmissing-prototypes]
>>     void acpi_arch_dma_setup(struct device *dev)
>>          ^
>>     drivers/acpi/arm64/dma.c:7:1: note: declare 'static' if the 
>> function is not intended to be used outside of this translation unit
>>     void acpi_arch_dma_setup(struct device *dev)
>>     ^
>>     static
>>     1 warning generated.
> 
> drivers/acpi can only be compiled with CONFIG_ACPI=y, so
> drivers/acpi/arm64/ will be the same, not sure how to trigger
> this compile warning.
> 
> I disable CONFIG_ACPI on my ARM64 machine, but didn't get the
> warning you reported.

Looking at the linked LKP report, it seems it's it's explicitly trying 
to build drivers/acpi/arm64/ despite the config:

         mkdir build_dir && cp config build_dir/.config
         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 
O=build_dir ARCH=arm64 olddefconfig
         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 
O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/acpi/arm64/

So I guess it's a problem with the LKP setup? In general, trying to 
build arbitrary parts of the kernel which are configured out can never 
be expected to work.

Thanks,
Robin.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] acpi: Fix header declaration of acpi_arch_dma_setup() w/o CONFIG_ACPI
  2023-06-01 10:31   ` Robin Murphy
@ 2023-06-01 15:24     ` Dave Jiang
  0 siblings, 0 replies; 4+ messages in thread
From: Dave Jiang @ 2023-06-01 15:24 UTC (permalink / raw
  To: Robin Murphy, Hanjun Guo, lpieralisi, sudeep.holla
  Cc: kernel test robot, Jianmin Lv, Rafael J. Wysocki, rafael, lenb,
	linux-acpi, linux-arm-kernel, linux-kernel


On 6/1/23 03:31, Robin Murphy wrote:
> On 2023-06-01 02:48, Hanjun Guo wrote:
>> Hi Dave,
>>
>> Sorry for the late reply, I have some comments inline.
>>
>> On 2023/5/23 0:06, Dave Jiang wrote:
>>> arm64 build can be done without CONFIG_ACPI. The ifdef bits for
>>> acpi_arch_dma_setup() is placed inside CONFIG_ACPI. When CONFIG_ACPI is
>>> not set, this causes warning reported by kernel test bot. Move the
>>> prototype declaration for acpi_arch_dma_setup() outside of CONFIG_ACPI.
>>
>> ...
>>
>>>
>>>>> drivers/acpi/arm64/dma.c:7:6: warning: no previous prototype for 
>>>>> function 'acpi_arch_dma_setup' [-Wmissing-prototypes]
>>>     void acpi_arch_dma_setup(struct device *dev)
>>>          ^
>>>     drivers/acpi/arm64/dma.c:7:1: note: declare 'static' if the 
>>> function is not intended to be used outside of this translation unit
>>>     void acpi_arch_dma_setup(struct device *dev)
>>>     ^
>>>     static
>>>     1 warning generated.
>>
>> drivers/acpi can only be compiled with CONFIG_ACPI=y, so
>> drivers/acpi/arm64/ will be the same, not sure how to trigger
>> this compile warning.
>>
>> I disable CONFIG_ACPI on my ARM64 machine, but didn't get the
>> warning you reported.
>
> Looking at the linked LKP report, it seems it's it's explicitly trying 
> to build drivers/acpi/arm64/ despite the config:
>
>         mkdir build_dir && cp config build_dir/.config
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 
> O=build_dir ARCH=arm64 olddefconfig
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 
> O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/acpi/arm64/
>
> So I guess it's a problem with the LKP setup? In general, trying to 
> build arbitrary parts of the kernel which are configured out can never 
> be expected to work.

It seems to be a problem triggered because I was working on some patches 
that added obj-y at the drivers/Makefile for acpi/ and opened the ACPI 
dir for !CONFIG_ACPI compile. The code has been reworked after comments 
from Rafael. So this is no longer a problem. Please ignore patch. Sorry 
about the noise.




>
> Thanks,
> Robin.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-06-01 15:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-22 16:06 [PATCH] acpi: Fix header declaration of acpi_arch_dma_setup() w/o CONFIG_ACPI Dave Jiang
2023-06-01  1:48 ` Hanjun Guo
2023-06-01 10:31   ` Robin Murphy
2023-06-01 15:24     ` Dave Jiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).