Skip to content

Commit 75d647f

Browse files
tweksteenJarkko Sakkinen
authored andcommitted
tpm: Move eventlog declarations to its own header
Reduce the size of tpm.h by moving eventlog declarations to a separate header. Signed-off-by: Thiebaud Weksteen <[email protected]> Suggested-by: Jarkko Sakkinen <[email protected]> Reviewed-by: Jarkko Sakkinen <[email protected]> Tested-by: Jarkko Sakkinen <[email protected]> Signed-off-by: Jarkko Sakkinen <[email protected]>
1 parent 9b01b53 commit 75d647f

File tree

8 files changed

+41
-30
lines changed

8 files changed

+41
-30
lines changed

drivers/char/tpm/eventlog/acpi.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include <linux/tpm_eventlog.h>
2929

3030
#include "../tpm.h"
31+
#include "common.h"
3132

3233
struct acpi_tcpa {
3334
struct acpi_table_header hdr;

drivers/char/tpm/eventlog/common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include <linux/tpm_eventlog.h>
2626

2727
#include "../tpm.h"
28-
28+
#include "common.h"
2929

3030
static int tpm_bios_measurements_open(struct inode *inode,
3131
struct file *file)

drivers/char/tpm/eventlog/common.h

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#ifndef __TPM_EVENTLOG_COMMON_H__
2+
#define __TPM_EVENTLOG_COMMON_H__
3+
4+
#include "../tpm.h"
5+
6+
extern const struct seq_operations tpm1_ascii_b_measurements_seqops;
7+
extern const struct seq_operations tpm1_binary_b_measurements_seqops;
8+
extern const struct seq_operations tpm2_binary_b_measurements_seqops;
9+
10+
#if defined(CONFIG_ACPI)
11+
int tpm_read_log_acpi(struct tpm_chip *chip);
12+
#else
13+
static inline int tpm_read_log_acpi(struct tpm_chip *chip)
14+
{
15+
return -ENODEV;
16+
}
17+
#endif
18+
#if defined(CONFIG_OF)
19+
int tpm_read_log_of(struct tpm_chip *chip);
20+
#else
21+
static inline int tpm_read_log_of(struct tpm_chip *chip)
22+
{
23+
return -ENODEV;
24+
}
25+
#endif
26+
#if defined(CONFIG_EFI)
27+
int tpm_read_log_efi(struct tpm_chip *chip);
28+
#else
29+
static inline int tpm_read_log_efi(struct tpm_chip *chip)
30+
{
31+
return -ENODEV;
32+
}
33+
#endif
34+
35+
#endif

drivers/char/tpm/eventlog/efi.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <linux/tpm_eventlog.h>
1616

1717
#include "../tpm.h"
18+
#include "common.h"
1819

1920
/* read binary bios log from EFI configuration table */
2021
int tpm_read_log_efi(struct tpm_chip *chip)

drivers/char/tpm/eventlog/of.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <linux/tpm_eventlog.h>
2121

2222
#include "../tpm.h"
23+
#include "common.h"
2324

2425
int tpm_read_log_of(struct tpm_chip *chip)
2526
{

drivers/char/tpm/eventlog/tpm1.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include <linux/tpm_eventlog.h>
3030

3131
#include "../tpm.h"
32+
#include "common.h"
3233

3334

3435
static const char* tcpa_event_type_strings[] = {

drivers/char/tpm/eventlog/tpm2.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <linux/tpm_eventlog.h>
2525

2626
#include "../tpm.h"
27+
#include "common.h"
2728

2829
/*
2930
* calc_tpm2_event_size() - calculate the event size, where event

drivers/char/tpm/tpm.h

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -590,35 +590,6 @@ int tpm2_prepare_space(struct tpm_chip *chip, struct tpm_space *space, u32 cc,
590590
int tpm2_commit_space(struct tpm_chip *chip, struct tpm_space *space,
591591
u32 cc, u8 *buf, size_t *bufsiz);
592592

593-
extern const struct seq_operations tpm1_ascii_b_measurements_seqops;
594-
extern const struct seq_operations tpm1_binary_b_measurements_seqops;
595-
extern const struct seq_operations tpm2_binary_b_measurements_seqops;
596-
597-
#if defined(CONFIG_ACPI)
598-
int tpm_read_log_acpi(struct tpm_chip *chip);
599-
#else
600-
static inline int tpm_read_log_acpi(struct tpm_chip *chip)
601-
{
602-
return -ENODEV;
603-
}
604-
#endif
605-
#if defined(CONFIG_OF)
606-
int tpm_read_log_of(struct tpm_chip *chip);
607-
#else
608-
static inline int tpm_read_log_of(struct tpm_chip *chip)
609-
{
610-
return -ENODEV;
611-
}
612-
#endif
613-
#if defined(CONFIG_EFI)
614-
int tpm_read_log_efi(struct tpm_chip *chip);
615-
#else
616-
static inline int tpm_read_log_efi(struct tpm_chip *chip)
617-
{
618-
return -ENODEV;
619-
}
620-
#endif
621-
622593
int tpm_bios_log_setup(struct tpm_chip *chip);
623594
void tpm_bios_log_teardown(struct tpm_chip *chip);
624595
#endif

0 commit comments

Comments
 (0)