Received: by 10.192.165.156 with SMTP id m28csp694308imm; Wed, 11 Apr 2018 05:59:32 -0700 (PDT) X-Google-Smtp-Source: AIpwx48tHh14SuUaBy6E0aCDd7Y0VjSI6zxQ1LfHy3vsKs+4a7JQoENlncgeLLqvi3G4QJIjtmeA X-Received: by 2002:a17:902:8f8b:: with SMTP id z11-v6mr5083424plo.8.1523451572343; Wed, 11 Apr 2018 05:59:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523451572; cv=none; d=google.com; s=arc-20160816; b=xFrIlFMCvaU5RfZ3STjyC8jR0V9WF/+PaZWfKpiXiCjnxG06R8q7JC9NBB1KmsR8oW vVC/PcsOcwivx9XuHEKNqU5249nj9oiPSP4GKuzevNZ4xJN8HKtNpBvOivhxTkxjnLi8 14603RQClWlnSl9/S2ptfHSzzut+NLLbaeuMzshgodTxfLo/57oUfkf4CMs1k1XxtlwP 73+ZNuGoRqNQQ95EtgvWM6HXljHWjqvWOUEN0VgiaxziDGTZZGTc5H4djDt1XcLnfGGW 8TgNUvoLWvpfg3NcKiCnfnKWP88YXjrZ1zZJqEENB44AlqjnC/TO3jPtMTSXKidC8zWF rKkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:references:message-id :in-reply-to:date:mime-version:dkim-signature :arc-authentication-results; bh=2RYCDQaIirUa2/R0VbKsTunyRBimM+lHVzsSiWGMuXE=; b=Y6EsmABZOdctq+7ZMLTij64TnqYojUBj9cKGIhwrESvOPhH9MfEFf3chNNbkWdEoxl GUfeX5NxKbSpGIqSyPb9bbAD34cgqh/t4nqNO/Vz9SjW+Zcdajek1e61jqZAb/e14csV PZeO+SLpJRgyxvar/tOYjG7W8UwPmUtRg2Um72y+3EUujhMm0eAXpOk6JUPUHmEeKMON Zxus4GL0j47hoBRMvdgBRsRO2iFvxWGxTin+Krsq3eOuCiRPwOQLKYOw8xp30zWgr1UY zrotdKIio/OyaMhv2a4yDSziA/kbrvtF2NpB8ZQzT1OtNZj2tDMRV5jG/0zeL/JYTbXP z08g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=NgiEs6hy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h89-v6si1111450pld.48.2018.04.11.05.58.55; Wed, 11 Apr 2018 05:59:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=NgiEs6hy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753425AbeDKM4A (ORCPT + 99 others); Wed, 11 Apr 2018 08:56:00 -0400 Received: from mail-qk0-f202.google.com ([209.85.220.202]:42991 "EHLO mail-qk0-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753383AbeDKMzy (ORCPT ); Wed, 11 Apr 2018 08:55:54 -0400 Received: by mail-qk0-f202.google.com with SMTP id v74so1080016qkl.9 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=PLv3V+/g7JW4aaqC26v6qG+e0soOjb1lLpAeXQHBiM9xmiF99VEBB+SaiO9D7iMHg+ sM/Qvtg5io5KHwDl0ghsOp3odpUzn3t8FzXWyf9d4kauZsiybBxqONYCCOSBbyJT7VOW 7KE4sm5KKHkkC9goCqZp6TJ20LYDZG8izmggDt+bBKaJmFz0jJcP7Wkm6nACdwrAzihi 61YdQcH0+teXzOEzw7WO1A2bJgQRRz0EoCjklQ1qhnA5XlnOObVBtNnFQwdYs40lCEpf mvVHD2KfmROqpGOBk6bKIJl7+NiHEa24+/ApgIevzmDTHDOgXQnUgbFdseKwaj7vVwzK mMFg== X-Gm-Message-State: ALQs6tAPFTezU6jZrYxicjytM/TeU1GA+hP65rWBRRAn5JwttRfEKdgk RM2r0SwcoJPAKDUxXu0DdIpV5BGSqQ== 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 -- 2.17.0.484.g0c8726318c-goog