* [PATCH 1/2] tpm: Rename tpm.c to tpm-interface.c
@ 2013-10-06 19:38 Jason Gunthorpe
2013-10-06 19:53 ` Joe Perches
0 siblings, 1 reply; 3+ messages in thread
From: Jason Gunthorpe @ 2013-10-06 19:38 UTC (permalink / raw)
To: Peter H?we
Cc: tpmdd-devel, Ashley Lai, Leonidas Da Silva Barbosa, linux-kernel,
Rajiv Andrade, Sirrix AG
This is preparation for making the tpm module multi-file. kbuild does
not like having a .c file with the same name as a module. We wish to
keep the tpm module name so that userspace doesn't see this change.
tpm-interface.c is chosen because the next several commits in the series
migrate items into tpm-sysfs.c, tpm-dev.c and tpm-class.c. All that will
be left is tpm command processing and interfacing code.
Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
---
drivers/char/tpm/Makefile | 2 ++
drivers/char/tpm/{tpm.c => tpm-interface.c} | 0
2 files changed, 2 insertions(+)
rename drivers/char/tpm/{tpm.c => tpm-interface.c} (100%)
This patch fits into the earlier posted series, see:
https://github.com/jgunthorpe/linux/commits/for-tpm
diff --git a/drivers/char/tpm/Makefile b/drivers/char/tpm/Makefile
index eb41ff9..83b8a9d 100644
--- a/drivers/char/tpm/Makefile
+++ b/drivers/char/tpm/Makefile
@@ -2,6 +2,8 @@
# Makefile for the kernel tpm device drivers.
#
obj-$(CONFIG_TCG_TPM) += tpm.o
+tpm-y := tpm-interface.o
+
ifdef CONFIG_ACPI
obj-$(CONFIG_TCG_TPM) += tpm_bios.o
tpm_bios-objs += tpm_eventlog.o tpm_acpi.o tpm_ppi.o
diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm-interface.c
similarity index 100%
rename from drivers/char/tpm/tpm.c
rename to drivers/char/tpm/tpm-interface.c
--
1.8.1.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] tpm: Rename tpm.c to tpm-interface.c
2013-10-06 19:38 [PATCH 1/2] tpm: Rename tpm.c to tpm-interface.c Jason Gunthorpe
@ 2013-10-06 19:53 ` Joe Perches
2013-10-06 20:15 ` Jason Gunthorpe
0 siblings, 1 reply; 3+ messages in thread
From: Joe Perches @ 2013-10-06 19:53 UTC (permalink / raw)
To: Jason Gunthorpe
Cc: Peter H?we, tpmdd-devel, Ashley Lai, Leonidas Da Silva Barbosa,
linux-kernel, Rajiv Andrade, Sirrix AG
On Sun, 2013-10-06 at 13:38 -0600, Jason Gunthorpe wrote:
> This is preparation for making the tpm module multi-file. kbuild does
> not like having a .c file with the same name as a module. We wish to
> keep the tpm module name so that userspace doesn't see this change.
If that's true, and I don't believe it is,
then Kbuild should be fixed instead.
There are a lot of examples of .c files named
the same as the directory they reside in.
For example:
drivers/net/ethernet/myricom/myri10ge/myri10ge.ko
$ find drivers -type d | while read file ; do if [ -f $file/$(basename $file).c ] ; then echo $file ; fi ; done
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] tpm: Rename tpm.c to tpm-interface.c
2013-10-06 19:53 ` Joe Perches
@ 2013-10-06 20:15 ` Jason Gunthorpe
0 siblings, 0 replies; 3+ messages in thread
From: Jason Gunthorpe @ 2013-10-06 20:15 UTC (permalink / raw)
To: Joe Perches
Cc: Peter H?we, tpmdd-devel, Ashley Lai, Leonidas Da Silva Barbosa,
linux-kernel, Rajiv Andrade, Sirrix AG
On Sun, Oct 06, 2013 at 12:53:22PM -0700, Joe Perches wrote:
> On Sun, 2013-10-06 at 13:38 -0600, Jason Gunthorpe wrote:
> > This is preparation for making the tpm module multi-file. kbuild does
> > not like having a .c file with the same name as a module. We wish to
> > keep the tpm module name so that userspace doesn't see this change.
>
> If that's true, and I don't believe it is,
> then Kbuild should be fixed instead.
>
> There are a lot of examples of .c files named
> the same as the directory they reside in.
That isn't the trouble, it is having a module named tpm, comprised of
tpm.c, tpm-foo.c, and tpm-bar.c
The issue is that assembling the tpm module uses tpm.o as an
intermediate file, and compiling tmp.c uses tpm.o as a intermediate
file - they conflict, things don't work right and make throws a
circular dependency warning.
The Makefile I started with looks like this:
obj-m += tpm.o
tpm-y := tpm.o tpm-foo.o tpm-bar.o
Is there some other solution?
In any event, this patch is part of a series that splits tpm.c up,
renaming it at this point in the series is to make kbuild work, but
at the end of the series it should be renamed anyhow :)
Regards,
Jason
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-10-06 20:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-06 19:38 [PATCH 1/2] tpm: Rename tpm.c to tpm-interface.c Jason Gunthorpe
2013-10-06 19:53 ` Joe Perches
2013-10-06 20:15 ` Jason Gunthorpe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox