[PATCH v3 5/5] hw/tpm: Simplify tpm_ppi_enabled()

Philippe Mathieu-Daudé posted 5 patches 2 weeks, 6 days ago
Maintainers: "Michael S. Tsirkin" <mst@redhat.com>, Igor Mammedov <imammedo@redhat.com>, Ani Sinha <anisinha@redhat.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Paolo Bonzini <pbonzini@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, Stefan Berger <stefanb@linux.vnet.ibm.com>
[PATCH v3 5/5] hw/tpm: Simplify tpm_ppi_enabled()
Posted by Philippe Mathieu-Daudé 2 weeks, 6 days ago
TPM instances don't expose any "ppi" property anymore,
remove that dead code.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 include/system/tpm.h | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/include/system/tpm.h b/include/system/tpm.h
index 9458ad6668a..874068d19a9 100644
--- a/include/system/tpm.h
+++ b/include/system/tpm.h
@@ -13,7 +13,6 @@
 #define QEMU_TPM_H
 
 #include "qapi/qapi-types-tpm.h"
-#include "qapi/error.h"
 #include "qom/object.h"
 
 #ifdef CONFIG_TPM
@@ -85,10 +84,7 @@ static inline bool tpm_ppi_enabled(TPMIf *ti)
     if (!ti) {
         return false;
     }
-    if (TPM_IF_GET_CLASS(ti)->ppi_enabled) {
-        return true;
-    }
-    return object_property_get_bool(OBJECT(ti), "ppi", &error_abort);
+    return TPM_IF_GET_CLASS(ti)->ppi_enabled;
 }
 
 #else /* CONFIG_TPM */
-- 
2.53.0


Re: [PATCH v3 5/5] hw/tpm: Simplify tpm_ppi_enabled()
Posted by Stefan Berger 2 weeks, 6 days ago

On 3/17/26 8:02 AM, Philippe Mathieu-Daudé wrote:
> TPM instances don't expose any "ppi" property anymore,
> remove that dead code.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   include/system/tpm.h | 6 +-----
>   1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/include/system/tpm.h b/include/system/tpm.h
> index 9458ad6668a..874068d19a9 100644
> --- a/include/system/tpm.h
> +++ b/include/system/tpm.h
> @@ -13,7 +13,6 @@
>   #define QEMU_TPM_H
>   
>   #include "qapi/qapi-types-tpm.h"
> -#include "qapi/error.h"
>   #include "qom/object.h"
>   
>   #ifdef CONFIG_TPM
> @@ -85,10 +84,7 @@ static inline bool tpm_ppi_enabled(TPMIf *ti)
>       if (!ti) {
>           return false;
>       }
> -    if (TPM_IF_GET_CLASS(ti)->ppi_enabled) {
> -        return true;
> -    }
> -    return object_property_get_bool(OBJECT(ti), "ppi", &error_abort);
> +    return TPM_IF_GET_CLASS(ti)->ppi_enabled;
>   }
>   
>   #else /* CONFIG_TPM */

Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>