From patchwork Wed Apr 11 12:55:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Thi=C3=A9baud_Weksteen?= X-Patchwork-Id: 10335413 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 14E6C60365 for ; Wed, 11 Apr 2018 12:55:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E70DF28947 for ; Wed, 11 Apr 2018 12:55:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DBAA528949; Wed, 11 Apr 2018 12:55:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6946F28947 for ; Wed, 11 Apr 2018 12:55:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752896AbeDKMz5 (ORCPT ); Wed, 11 Apr 2018 08:55:57 -0400 Received: from mail-qk0-f202.google.com ([209.85.220.202]:50666 "EHLO mail-qk0-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753391AbeDKMzy (ORCPT ); Wed, 11 Apr 2018 08:55:54 -0400 Received: by mail-qk0-f202.google.com with SMTP id d12so1060534qki.17 for ; Wed, 11 Apr 2018 05:55:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:date:in-reply-to:message-id:references:subject:from:to :cc; bh=2RYCDQaIirUa2/R0VbKsTunyRBimM+lHVzsSiWGMuXE=; b=NgiEs6hyH/vrG7ERf1MdNNT6arFykHtQ/dvYoFdPJZHMAcGr6VF9maPu5QPP7F0lW+ lNBQvkjB2QnJLdlpmeZQdhgBn4nJVJs07U33HeCOhgAeN05b/MDkYLqaHpwEAqHBRkHa tmMYPZasN1MpAHwY1MkL28ybAKT3KK7THjV21IjK1phUGuw8vnOVjOBgpSIRWhiLSQXO xNOvO0VRXG+3MbqCIJn6uAUpGOwMFS/kD9CNPLoM5WByIdoVRv+RJSHktOZm2VY0XU9k wV7two0wpDN+/10rbU/9AOjDjPRjd0BLB8Ufij3Go1Q93L1JkJg7pUibAEScZ+7fXGJ+ laTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:date:in-reply-to:message-id :references:subject:from:to:cc; bh=2RYCDQaIirUa2/R0VbKsTunyRBimM+lHVzsSiWGMuXE=; b=WrUMuJWLZJyheeRT5cXjnyqlZLj9BvtzFGpv0r9QsIj87F9elYWzPvMSBorkFD47VK cEWM0z+3dSI3oQMhZkgTdBT7o+JFfjlcop8/BDHt4ImqOo2z3/YEME5Q2QQZIOabURzT 5TGTh8Ps45GuEEUdq/FwJWo/S+oZgUAvtGUZMf1/ch0krK8P/RTQrrdmavIfejzQl55I f6ragnt/PlYaLJKS3EQs+RLdaxoDYHNZmJXUs2nj9DLVfHtvM4GsPgYY6+PLa/lIktEg Kxyg582vfb4LtOIgIYTibr33wpRFe1ATdnd8tURN69OGv3MSOjW2R15HLRlB6NYAo796 FLQg== X-Gm-Message-State: ALQs6tAr+WqL+CV/Yr1gtGNyrgeeTpwgaQYSy08C4eEwt8ywHST+oenk NTvHnRhEtc/OoRELDTBJRvQ2hxzFyA== X-Google-Smtp-Source: AIpwx49bKEXVSLWbFvZhOplXUrQSbPtSvdwXtjdqrX0dKuw0QPcBdv2fB1jQuH3zmfvCvjtFpT1pBEaPgQ== MIME-Version: 1.0 X-Received: by 10.55.80.139 with SMTP id e133mr3118391qkb.24.1523451353615; Wed, 11 Apr 2018 05:55:53 -0700 (PDT) Date: Wed, 11 Apr 2018 14:55:01 +0200 In-Reply-To: <20180411125501.188477-1-tweek@google.com> Message-Id: <20180411125501.188477-4-tweek@google.com> References: <20180411125501.188477-1-tweek@google.com> X-Mailer: git-send-email 2.17.0.484.g0c8726318c-goog Subject: [PATCH 3/3] tpm: Move eventlog declarations to its own header From: Thiebaud Weksteen To: jarkko.sakkinen@linux.intel.com, nayna@linux.vnet.ibm.com, linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, tweek@google.com Cc: linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, Thiebaud Weksteen Sender: linux-integrity-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-integrity@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Reduce the size of tpm.h by moving eventlog declarations to a separate header. Signed-off-by: Thiebaud Weksteen --- drivers/char/tpm/eventlog/common.c | 1 + drivers/char/tpm/eventlog/common.h | 35 ++++++++++++++++++++++++++++++ drivers/char/tpm/eventlog/tpm1.c | 1 + drivers/char/tpm/eventlog/tpm2.c | 1 + drivers/char/tpm/tpm.h | 29 ------------------------- 5 files changed, 38 insertions(+), 29 deletions(-) create mode 100644 drivers/char/tpm/eventlog/common.h diff --git a/drivers/char/tpm/eventlog/common.c b/drivers/char/tpm/eventlog/common.c index 54934b5a1566..9ecf8436983c 100644 --- a/drivers/char/tpm/eventlog/common.c +++ b/drivers/char/tpm/eventlog/common.c @@ -25,6 +25,7 @@ #include #include "../tpm.h" +#include "common.h" static int tpm_bios_measurements_open(struct inode *inode, diff --git a/drivers/char/tpm/eventlog/common.h b/drivers/char/tpm/eventlog/common.h new file mode 100644 index 000000000000..47ff8136ceb5 --- /dev/null +++ b/drivers/char/tpm/eventlog/common.h @@ -0,0 +1,35 @@ +#ifndef __TPM_EVENTLOG_COMMON_H__ +#define __TPM_EVENTLOG_COMMON_H__ + +#include "../tpm.h" + +extern const struct seq_operations tpm1_ascii_b_measurements_seqops; +extern const struct seq_operations tpm1_binary_b_measurements_seqops; +extern const struct seq_operations tpm2_binary_b_measurements_seqops; + +#if defined(CONFIG_ACPI) +int tpm_read_log_acpi(struct tpm_chip *chip); +#else +static inline int tpm_read_log_acpi(struct tpm_chip *chip) +{ + return -ENODEV; +} +#endif +#if defined(CONFIG_OF) +int tpm_read_log_of(struct tpm_chip *chip); +#else +static inline int tpm_read_log_of(struct tpm_chip *chip) +{ + return -ENODEV; +} +#endif +#if defined(CONFIG_EFI) +int tpm_read_log_efi(struct tpm_chip *chip); +#else +static inline int tpm_read_log_efi(struct tpm_chip *chip) +{ + return -ENODEV; +} +#endif + +#endif diff --git a/drivers/char/tpm/eventlog/tpm1.c b/drivers/char/tpm/eventlog/tpm1.c index 8f30316e9bb6..58c84784ba25 100644 --- a/drivers/char/tpm/eventlog/tpm1.c +++ b/drivers/char/tpm/eventlog/tpm1.c @@ -29,6 +29,7 @@ #include #include "../tpm.h" +#include "common.h" static const char* tcpa_event_type_strings[] = { diff --git a/drivers/char/tpm/eventlog/tpm2.c b/drivers/char/tpm/eventlog/tpm2.c index f0723fa9ae14..1b8fa9de2cac 100644 --- a/drivers/char/tpm/eventlog/tpm2.c +++ b/drivers/char/tpm/eventlog/tpm2.c @@ -24,6 +24,7 @@ #include #include "../tpm.h" +#include "common.h" /* * calc_tpm2_event_size() - calculate the event size, where event diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h index a583c5001904..067f305e36f0 100644 --- a/drivers/char/tpm/tpm.h +++ b/drivers/char/tpm/tpm.h @@ -580,35 +580,6 @@ int tpm2_prepare_space(struct tpm_chip *chip, struct tpm_space *space, u32 cc, int tpm2_commit_space(struct tpm_chip *chip, struct tpm_space *space, u32 cc, u8 *buf, size_t *bufsiz); -extern const struct seq_operations tpm1_ascii_b_measurements_seqops; -extern const struct seq_operations tpm1_binary_b_measurements_seqops; -extern const struct seq_operations tpm2_binary_b_measurements_seqops; - -#if defined(CONFIG_ACPI) -int tpm_read_log_acpi(struct tpm_chip *chip); -#else -static inline int tpm_read_log_acpi(struct tpm_chip *chip) -{ - return -ENODEV; -} -#endif -#if defined(CONFIG_OF) -int tpm_read_log_of(struct tpm_chip *chip); -#else -static inline int tpm_read_log_of(struct tpm_chip *chip) -{ - return -ENODEV; -} -#endif -#if defined(CONFIG_EFI) -int tpm_read_log_efi(struct tpm_chip *chip); -#else -static inline int tpm_read_log_efi(struct tpm_chip *chip) -{ - return -ENODEV; -} -#endif - int tpm_bios_log_setup(struct tpm_chip *chip); void tpm_bios_log_teardown(struct tpm_chip *chip); #endif