[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 3/7] ieee1275: Consolidate repeated definitions of IEEE1275_IH
From: |
Stefan Berger |
Subject: |
[PATCH v3 3/7] ieee1275: Consolidate repeated definitions of IEEE1275_IHANDLE_INVALID |
Date: |
Tue, 26 Nov 2024 15:39:42 -0500 |
Consoldiate repeated definitions of IEEE1275_IHANDLE_INVALID that are cast
to the type grub_ieee1275_ihandle_t.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
---
grub-core/commands/ieee1275/ibmvtpm.c | 4 +---
grub-core/term/ieee1275/serial.c | 8 +++-----
include/grub/ieee1275/ieee1275.h | 1 +
3 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/grub-core/commands/ieee1275/ibmvtpm.c
b/grub-core/commands/ieee1275/ibmvtpm.c
index a6fee5c51..dd30c7432 100644
--- a/grub-core/commands/ieee1275/ibmvtpm.c
+++ b/grub-core/commands/ieee1275/ibmvtpm.c
@@ -29,8 +29,6 @@
static grub_ieee1275_ihandle_t tpm_ihandle;
static grub_uint8_t tpm_version;
-#define IEEE1275_IHANDLE_INVALID ((grub_ieee1275_ihandle_t) 0)
-
static void
tpm_get_tpm_version (void)
{
@@ -53,7 +51,7 @@ tpm_init (void)
{
if (grub_ieee1275_open ("/vdevice/vtpm", &tpm_ihandle) < 0)
{
- tpm_ihandle = IEEE1275_IHANDLE_INVALID;
+ tpm_ihandle = GRUB_IEEE1275_IHANDLE_INVALID;
return GRUB_ERR_UNKNOWN_DEVICE;
}
diff --git a/grub-core/term/ieee1275/serial.c b/grub-core/term/ieee1275/serial.c
index 9bc44b306..ac2a8f827 100644
--- a/grub-core/term/ieee1275/serial.c
+++ b/grub-core/term/ieee1275/serial.c
@@ -25,8 +25,6 @@
#include <grub/i18n.h>
#include <grub/ieee1275/console.h>
-#define IEEE1275_IHANDLE_INVALID ((grub_ieee1275_ihandle_t) 0)
-
struct ofserial_hash_ent
{
char *devpath;
@@ -44,7 +42,7 @@ do_real_config (struct grub_serial_port *port)
if (grub_ieee1275_open (port->elem->devpath, &port->handle)
|| port->handle == (grub_ieee1275_ihandle_t) -1)
- port->handle = IEEE1275_IHANDLE_INVALID;
+ port->handle = GRUB_IEEE1275_IHANDLE_INVALID;
port->configured = 1;
}
@@ -58,7 +56,7 @@ serial_hw_fetch (struct grub_serial_port *port)
do_real_config (port);
- if (port->handle == IEEE1275_IHANDLE_INVALID)
+ if (port->handle == GRUB_IEEE1275_IHANDLE_INVALID)
return -1;
grub_ieee1275_read (port->handle, &c, 1, &actual);
@@ -76,7 +74,7 @@ serial_hw_put (struct grub_serial_port *port, const int c)
do_real_config (port);
- if (port->handle == IEEE1275_IHANDLE_INVALID)
+ if (port->handle == GRUB_IEEE1275_IHANDLE_INVALID)
return;
grub_ieee1275_write (port->handle, &c0, 1, &actual);
diff --git a/include/grub/ieee1275/ieee1275.h b/include/grub/ieee1275/ieee1275.h
index dddb38514..c445d0499 100644
--- a/include/grub/ieee1275/ieee1275.h
+++ b/include/grub/ieee1275/ieee1275.h
@@ -60,6 +60,7 @@ struct grub_ieee1275_common_hdr
typedef grub_uint32_t grub_ieee1275_ihandle_t;
typedef grub_uint32_t grub_ieee1275_phandle_t;
+#define GRUB_IEEE1275_IHANDLE_INVALID ((grub_ieee1275_ihandle_t) 0)
#define GRUB_IEEE1275_PHANDLE_INVALID ((grub_ieee1275_phandle_t) -1)
struct grub_ieee1275_devalias
--
2.25.1
- [PATCH v3 0/7] Enable Automatic Disk Unlock with TPM2 on ieee1275, Stefan Berger, 2024/11/26
- [PATCH v3 2/7] ieee1275/serial: Cast 0 to proper type, Stefan Berger, 2024/11/26
- [PATCH v3 1/7] tss2: Adjust bit fields for big endian targets, Stefan Berger, 2024/11/26
- [PATCH v3 6/7] ieee1275/tcg2: Add TCG2 driver for ieee1275 PowerPC firmware, Stefan Berger, 2024/11/26
- [PATCH v3 3/7] ieee1275: Consolidate repeated definitions of IEEE1275_IHANDLE_INVALID,
Stefan Berger <=
- [PATCH v3 5/7] ieee1275/tcg2: Refactor grub_ieee1275_tpm_init, Stefan Berger, 2024/11/26
- [PATCH v3 4/7] ieee1275/ibmvpm: Move TPM initializaton functions to own file, Stefan Berger, 2024/11/26
- [PATCH v3 7/7] tpm2_key_protector: Enable build for powerpc_ieee1275, Stefan Berger, 2024/11/26
- Re: [PATCH v3 0/7] Enable Automatic Disk Unlock with TPM2 on ieee1275, Daniel Kiper, 2024/11/27
- Re: [PATCH v3 0/7] Enable Automatic Disk Unlock with TPM2 on ieee1275, Gary Lin, 2024/11/29