Linux-MIPS Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] MIPS:Loongson64:Limit 8259.h by config
@ 2019-11-22 13:58 Lichao Liu
  2019-11-22 18:36 ` Paul Burton
  0 siblings, 1 reply; 2+ messages in thread
From: Lichao Liu @ 2019-11-22 13:58 UTC (permalink / raw)
  To: chenhc, jiaxun.yang
  Cc: ralf, paulburton, jhogan, linux-mips, linux-kernel, Lichao Liu

Not all platform config CONFIG_I8259, So Use the macro CONFIG_I8259
to control whether to include the asm/i8259.h header file.

Signed-off-by: Lichao Liu <liulichao@loongson.cn>
---
 arch/mips/loongson64/pm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/mips/loongson64/pm.c b/arch/mips/loongson64/pm.c
index 7c8556f09781..08238a58107f 100644
--- a/arch/mips/loongson64/pm.c
+++ b/arch/mips/loongson64/pm.c
@@ -9,7 +9,9 @@
 #include <linux/interrupt.h>
 #include <linux/pm.h>
 
+#ifdef CONFIG_I8259
 #include <asm/i8259.h>
+#endif
 #include <asm/mipsregs.h>
 
 #include <loongson.h>
-- 
2.17.1


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

* Re: [PATCH] MIPS:Loongson64:Limit 8259.h by config
  2019-11-22 13:58 [PATCH] MIPS:Loongson64:Limit 8259.h by config Lichao Liu
@ 2019-11-22 18:36 ` Paul Burton
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Burton @ 2019-11-22 18:36 UTC (permalink / raw)
  To: Lichao Liu; +Cc: chenhc, jiaxun.yang, ralf, jhogan, linux-mips, linux-kernel

Hi Lichao,

On Fri, Nov 22, 2019 at 09:58:51PM +0800, Lichao Liu wrote:
> Not all platform config CONFIG_I8259, So Use the macro CONFIG_I8259
> to control whether to include the asm/i8259.h header file.

Generally including headers is harmless - it's quite common to include
headers which might or might not be used, and if nothing from the header
is used then its inclusion simply makes no difference. The compiler will
see the header contents & discard them, no big deal.

So can you describe why you want to add the #ifdef here? What's
problematic about including asm/i8259.h when CONFIG_I8259=n?

Thanks,
    Paul

> Signed-off-by: Lichao Liu <liulichao@loongson.cn>
> ---
>  arch/mips/loongson64/pm.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/mips/loongson64/pm.c b/arch/mips/loongson64/pm.c
> index 7c8556f09781..08238a58107f 100644
> --- a/arch/mips/loongson64/pm.c
> +++ b/arch/mips/loongson64/pm.c
> @@ -9,7 +9,9 @@
>  #include <linux/interrupt.h>
>  #include <linux/pm.h>
>  
> +#ifdef CONFIG_I8259
>  #include <asm/i8259.h>
> +#endif
>  #include <asm/mipsregs.h>
>  
>  #include <loongson.h>
> -- 
> 2.17.1
> 

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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-22 13:58 [PATCH] MIPS:Loongson64:Limit 8259.h by config Lichao Liu
2019-11-22 18:36 ` Paul Burton

Linux-MIPS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-mips/0 linux-mips/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mips linux-mips/ https://lore.kernel.org/linux-mips \
		linux-mips@vger.kernel.org
	public-inbox-index linux-mips

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-mips


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git