All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Opdenacker <michael-lists@free-electrons.com>
To: Matt Mackall <mpm@selenic.com>
Cc: linux-kernel@vger.kernel.org, Linux-tiny@selenic.com,
	Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH] x86: fix unconditional arch/x86/kernel/pcspeaker.c	compiling
Date: Thu, 17 Jan 2008 23:15:29 +0100	[thread overview]
Message-ID: <200801172315.29976.michael-lists@free-electrons.com> (raw)
In-Reply-To: <1200590031.5332.19.camel@cinder.waste.org>

On Thursday 17 January 2008, Matt Mackall wrote:
> > >> diff -Naur linux-2.6.24-rc8-git1/arch/x86/kernel/Makefile_32 linux-2.6.24-rc8-git1-nopcspeaker/arch/x86/kernel/Makefile_32
> > >> --- linux-2.6.24-rc8-git1/arch/x86/kernel/Makefile_32	2008-01-17 09:48:58.000000000 +0100
> > >> +++ linux-2.6.24-rc8-git1-nopcspeaker/arch/x86/kernel/Makefile_32	2008-01-17 10:06:56.000000000 +0100
> > >> @@ -45,10 +45,13 @@
> > >>  
> > >>  obj-$(CONFIG_VMI)		+= vmi_32.o vmiclock_32.o
> > >>  obj-$(CONFIG_PARAVIRT)		+= paravirt_32.o
> > >> -obj-y				+= pcspeaker.o
> > >> -
> > >>  obj-$(CONFIG_SCx200)		+= scx200_32.o
> > >>  
> > >> +ifeq ($(CONFIG_INPUT_PCSPKR),y)
> > >> +	obj-y			+= pcspeaker.o
> > >> +endif
> > >>     
> > >
> > > I'm not sure this does what you want. What if CONFIG_INPUT_PCSPKR = m?
> > >   
> > Does it make sense to compile arch/x86/kernel/pcspeaker.c as a module?
> > It defines no init and exit functions, and it defines an initcall, which
> > only makes sense at boot time.
> 
> Probably not. However, the above code won't build pcspeaker.o if
> CONFIG_INPUT_PCSPKR = m. In other words, it'll break.
> 

Here's a corrected version.

Even if this patch doesn't seem to cause any bug
(tested on a QEMU based PC), I'm wondering if this is "legal" (according
to Linux standards) not to declare a device we don't care about,
but that probably always exists in any PC-compatible machine?
Doesn't this hurt the consistency of the device model?

Another issue would be that we would no longer be able 
to load the speaker driver module from a kernel which
wasn't originally compiled with support for this module.

Perhaps we should only use this trick when CONFIG_EMBEDDED is set.
In this case, we know we're using a limited, non-standard kernel,
and having a partial device tree could be acceptable.

What do you think?

Thanks,

Michael.

Signed-off-by: Michael Opdenacker <michael@free-electrons.com>

diff -Naur linux-2.6.24-rc8-git1/arch/x86/kernel/Makefile_32 linux-2.6.24-rc8-git1-nopcspeaker/arch/x86/kernel/Makefile_32
--- linux-2.6.24-rc8-git1/arch/x86/kernel/Makefile_32	2008-01-17 09:48:58.000000000 +0100
+++ linux-2.6.24-rc8-git1-nopcspeaker/arch/x86/kernel/Makefile_32	2008-01-17 22:43:33.000000000 +0100
@@ -45,10 +45,13 @@
 
 obj-$(CONFIG_VMI)		+= vmi_32.o vmiclock_32.o
 obj-$(CONFIG_PARAVIRT)		+= paravirt_32.o
-obj-y				+= pcspeaker.o
-
 obj-$(CONFIG_SCx200)		+= scx200_32.o
 
+ifdef CONFIG_INPUT_PCSPKR
+	obj-y			+= pcspeaker.o
+endif
+
+
 # vsyscall_32.o contains the vsyscall DSO images as __initdata.
 # We must build both images before we can assemble it.
 # Note: kbuild does not track this dependency due to usage of .incbin
diff -Naur linux-2.6.24-rc8-git1/arch/x86/kernel/Makefile_64 linux-2.6.24-rc8-git1-nopcspeaker/arch/x86/kernel/Makefile_64
--- linux-2.6.24-rc8-git1/arch/x86/kernel/Makefile_64	2008-01-17 09:48:58.000000000 +0100
+++ linux-2.6.24-rc8-git1-nopcspeaker/arch/x86/kernel/Makefile_64	2008-01-17 22:46:07.000000000 +0100
@@ -40,6 +40,9 @@
 obj-$(CONFIG_PCI)		+= early-quirks.o
 
 obj-y				+= topology.o
-obj-y				+= pcspeaker.o
+
+ifdef CONFIG_INPUT_PCSPKR
+        obj-y			+= pcspeaker.o
+endif
 
 CFLAGS_vsyscall_64.o		:= $(PROFILING) -g0

-- 
Michael Opdenacker, Free Electrons
Free Embedded Linux Training Materials
on http://free-electrons.com/training
(More than 1500 pages!)

  parent reply	other threads:[~2008-01-17 22:16 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-17 15:43 [PATCH] x86: fix unconditional arch/x86/kernel/pcspeaker.c compiling Michael Opdenacker
2008-01-17 16:36 ` Matt Mackall
2008-01-17 17:05   ` Michael Opdenacker
2008-01-17 17:13     ` Matt Mackall
2008-01-17 18:32       ` Michael Opdenacker
2008-01-17 22:15       ` Michael Opdenacker [this message]
2008-01-18  3:16         ` Taral
2008-01-18  8:22           ` Michael Opdenacker
2008-01-19  7:21             ` Taral
2008-01-18 11:02         ` [PATCH] x86: fix unconditional arch/x86/kernel/pcspeaker.c?compiling Ingo Molnar
2008-01-18 12:14           ` Michael Opdenacker
2008-01-18 12:25             ` Ingo Molnar
2008-01-18 12:29               ` Ingo Molnar
2008-01-18 13:03                 ` Michael Opdenacker
2008-01-18 13:50                   ` Matt Mackall
2008-01-18 13:57                     ` Ingo Molnar
2008-01-18 14:04                       ` Matt Mackall
2008-01-18 16:29                     ` Michael Opdenacker
2008-01-18 17:10                       ` Matt Mackall
2008-01-18 21:09                         ` Ingo Molnar
2008-01-18 22:39                           ` Matt Mackall
2008-01-22 14:39                             ` Ingo Molnar
2008-01-22 16:37                               ` Matt Mackall
2008-01-22 18:58                                 ` Sam Ravnborg
2008-01-22 19:17                                   ` Matt Mackall
2008-01-20  4:59                         ` Rob Landley
2008-01-20 16:44                           ` Matt Mackall
2008-01-21 15:31                         ` Michael Opdenacker
2008-01-23 22:30                         ` Michael Opdenacker
2008-01-24 17:09                           ` [PATCH] x86: fix?unconditional?arch/x86/kernel/pcspeaker.c?compiling Adrian Bunk
2008-01-24 20:12                           ` [PATCH] x86: fix unconditional arch/x86/kernel/pcspeaker.c?compiling Dmitri Vorobiev
2008-01-25 16:09                             ` Ralf Baechle
2008-01-20 12:25                       ` Rob Landley
2008-01-17 22:44     ` [PATCH] x86: fix unconditional arch/x86/kernel/pcspeaker.c compiling Jan Engelhardt

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=200801172315.29976.michael-lists@free-electrons.com \
    --to=michael-lists@free-electrons.com \
    --cc=Linux-tiny@selenic.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mpm@selenic.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.