libpldm: More fixes for header use
b0c1d20a5bde ("libpldm: Fix header use") only did half the job,
addressing compilation concerns for the library itself. As it turns out
there were still plenty of places that used local includes for paths to
the public headers.
Apply the rest of the header cleanups to hopefully get us into a
consistent state.
Fixes: b0c1d20a5bde ("libpldm: Fix header use")
Change-Id: I8d4b59c9241770583abb30389452af0a32b18b99
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 16dc0b4..3f41a75 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -29,6 +29,7 @@
1. base: Stabilise pldm_msg_hdr_correlate_response()
2. transport: af-mctp: Stabilise pldm_transport_af_mctp_bind()
3. libpldm: Fix header use
+4. libpldm: More fixes for header use
### Fixed
diff --git a/include/libpldm/base.h b/include/libpldm/base.h
index 7c8ef04..c61837f 100644
--- a/include/libpldm/base.h
+++ b/include/libpldm/base.h
@@ -6,13 +6,13 @@
extern "C" {
#endif
+#include <libpldm/pldm_types.h>
+
#include <asm/byteorder.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
-#include "pldm_types.h"
-
typedef uint8_t pldm_tid_t;
/** @brief PLDM Types
diff --git a/include/libpldm/bios_table.h b/include/libpldm/bios_table.h
index 32f7451..62428ec 100644
--- a/include/libpldm/bios_table.h
+++ b/include/libpldm/bios_table.h
@@ -6,7 +6,8 @@
extern "C" {
#endif
-#include "bios.h"
+#include <libpldm/bios.h>
+
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
diff --git a/include/libpldm/firmware_update.h b/include/libpldm/firmware_update.h
index 46cfcca..60732af 100644
--- a/include/libpldm/firmware_update.h
+++ b/include/libpldm/firmware_update.h
@@ -6,8 +6,9 @@
extern "C" {
#endif
-#include "base.h"
-#include "pldm_types.h"
+#include <libpldm/base.h>
+#include <libpldm/pldm_types.h>
+
#include "stdbool.h"
#include <stddef.h>
#include <stdint.h>
diff --git a/include/libpldm/fru.h b/include/libpldm/fru.h
index 3a066aa..c66f151 100644
--- a/include/libpldm/fru.h
+++ b/include/libpldm/fru.h
@@ -6,13 +6,13 @@
extern "C" {
#endif
+#include <libpldm/base.h>
+#include <libpldm/utils.h>
+
#include <asm/byteorder.h>
#include <stddef.h>
#include <stdint.h>
-#include "base.h"
-#include "utils.h"
-
#define PLDM_GET_FRU_RECORD_TABLE_METADATA_REQ_BYTES 0
#define PLDM_GET_FRU_RECORD_TABLE_METADATA_RESP_BYTES 19
#define PLDM_GET_FRU_RECORD_TABLE_REQ_BYTES 5
diff --git a/include/libpldm/instance-id.h b/include/libpldm/instance-id.h
index 36094b9..1db8593 100644
--- a/include/libpldm/instance-id.h
+++ b/include/libpldm/instance-id.h
@@ -6,7 +6,8 @@
extern "C" {
#endif
-#include "libpldm/base.h"
+#include <libpldm/base.h>
+
#include <stdint.h>
typedef uint8_t pldm_instance_id_t;
diff --git a/include/libpldm/platform.h b/include/libpldm/platform.h
index 251188b..8472107 100644
--- a/include/libpldm/platform.h
+++ b/include/libpldm/platform.h
@@ -9,9 +9,9 @@
#include <stddef.h>
#include <stdint.h>
-#include "base.h"
-#include "pdr.h"
-#include "pldm_types.h"
+#include <libpldm/base.h>
+#include <libpldm/pdr.h>
+#include <libpldm/pldm_types.h>
/* Maximum size for request */
#define PLDM_SET_STATE_EFFECTER_STATES_REQ_BYTES 19
diff --git a/include/libpldm/states.h b/include/libpldm/states.h
index d1a8e37..640a141 100644
--- a/include/libpldm/states.h
+++ b/include/libpldm/states.h
@@ -6,7 +6,7 @@
extern "C" {
#endif
-#include "pldm_types.h"
+#include <libpldm/pldm_types.h>
/** @brief PLDM enums for the boot progress state set
*/
diff --git a/include/libpldm/transport.h b/include/libpldm/transport.h
index 97c51d4..3a79cca 100644
--- a/include/libpldm/transport.h
+++ b/include/libpldm/transport.h
@@ -6,8 +6,9 @@
extern "C" {
#endif
-#include "libpldm/base.h"
-#include "libpldm/pldm.h"
+#include <libpldm/base.h>
+#include <libpldm/pldm.h>
+
#include <stddef.h>
struct pldm_transport;
diff --git a/include/libpldm/transport/af-mctp.h b/include/libpldm/transport/af-mctp.h
index e47b1aa..19f2860 100644
--- a/include/libpldm/transport/af-mctp.h
+++ b/include/libpldm/transport/af-mctp.h
@@ -2,8 +2,8 @@
#ifndef LIBPLDM_AF_MCTP_H
#define LIBPLDM_AF_MCTP_H
-#include "libpldm/base.h"
-#include "libpldm/pldm.h"
+#include <libpldm/base.h>
+#include <libpldm/pldm.h>
#ifdef __cplusplus
extern "C" {
diff --git a/include/libpldm/transport/mctp-demux.h b/include/libpldm/transport/mctp-demux.h
index e912349..484e96c 100644
--- a/include/libpldm/transport/mctp-demux.h
+++ b/include/libpldm/transport/mctp-demux.h
@@ -2,8 +2,8 @@
#ifndef LIBPLDM_DEMUX_H
#define LIBPLDM_DEMUX_H
-#include "libpldm/base.h"
-#include "libpldm/pldm.h"
+#include <libpldm/base.h>
+#include <libpldm/pldm.h>
#ifdef __cplusplus
extern "C" {
diff --git a/include/libpldm/utils.h b/include/libpldm/utils.h
index 8deec34..5966178 100644
--- a/include/libpldm/utils.h
+++ b/include/libpldm/utils.h
@@ -6,7 +6,8 @@
extern "C" {
#endif
-#include "pldm_types.h"
+#include <libpldm/pldm_types.h>
+
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
diff --git a/src/requester/pldm.c b/src/requester/pldm.c
index d01a2ad..17d2492 100644
--- a/src/requester/pldm.c
+++ b/src/requester/pldm.c
@@ -13,7 +13,7 @@
#include <unistd.h>
/* Temporary for old api */
-#include "libpldm/transport/mctp-demux.h"
+#include <libpldm/transport/mctp-demux.h>
extern int
pldm_transport_mctp_demux_get_socket_fd(struct pldm_transport_mctp_demux *ctx);
extern struct pldm_transport_mctp_demux *
diff --git a/src/transport/test.h b/src/transport/test.h
index 7a01527..3781755 100644
--- a/src/transport/test.h
+++ b/src/transport/test.h
@@ -2,7 +2,7 @@
#ifndef LIBPLDM_TRANSPORT_TEST_H
#define LIBPLDM_TRANSPORT_TEST_H
-#include "libpldm/base.h"
+#include <libpldm/base.h>
#include <stddef.h>
#include <stdint.h>
diff --git a/src/transport/transport.c b/src/transport/transport.c
index 295e78d..33197ab 100644
--- a/src/transport/transport.c
+++ b/src/transport/transport.c
@@ -1,9 +1,10 @@
/* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later */
-#include "libpldm/transport.h"
-#include "libpldm/base.h"
-#include "libpldm/pldm.h"
#include "transport.h"
+#include <libpldm/transport.h>
+#include <libpldm/base.h>
+#include <libpldm/pldm.h>
+
#include <errno.h>
#include <limits.h>
#ifdef PLDM_HAS_POLL
diff --git a/src/transport/transport.h b/src/transport/transport.h
index 9887216..da47d8b 100644
--- a/src/transport/transport.h
+++ b/src/transport/transport.h
@@ -2,8 +2,8 @@
#ifndef LIBPLDM_SRC_TRANSPORT_TRANSPORT_H
#define LIBPLDM_SRC_TRANSPORT_TRANSPORT_H
-#include "libpldm/base.h"
-#include "libpldm/pldm.h"
+#include <libpldm/base.h>
+#include <libpldm/pldm.h>
struct pollfd;
/**
diff --git a/tests/instance-id.cpp b/tests/instance-id.cpp
index 3a4e89b..ae4102d 100644
--- a/tests/instance-id.cpp
+++ b/tests/instance-id.cpp
@@ -1,12 +1,11 @@
-#include "libpldm/instance-id.h"
+#include <libpldm/base.h>
+#include <libpldm/instance-id.h>
#include <cerrno>
#include <cstdlib>
#include <cstring>
#include <filesystem>
-#include "libpldm/base.h"
-
#include <gtest/gtest.h>
static constexpr auto pldmMaxInstanceIds = 32;
diff --git a/tests/libpldm_bios_table_test.cpp b/tests/libpldm_bios_table_test.cpp
index d42d126..54173b6 100644
--- a/tests/libpldm_bios_table_test.cpp
+++ b/tests/libpldm_bios_table_test.cpp
@@ -1,4 +1,8 @@
#include <endian.h>
+#include <libpldm/base.h>
+#include <libpldm/bios.h>
+#include <libpldm/bios_table.h>
+#include <libpldm/utils.h>
#include <algorithm>
#include <cstdint>
@@ -8,11 +12,6 @@
#include <utility>
#include <vector>
-#include "libpldm/base.h"
-#include "libpldm/bios.h"
-#include "libpldm/bios_table.h"
-#include "libpldm/utils.h"
-
#include <gmock/gmock.h>
#include <gtest/gtest.h>
diff --git a/tests/libpldm_bios_test.cpp b/tests/libpldm_bios_test.cpp
index f744bee..3f64a2a 100644
--- a/tests/libpldm_bios_test.cpp
+++ b/tests/libpldm_bios_test.cpp
@@ -1,14 +1,13 @@
#include <endian.h>
+#include <libpldm/base.h>
+#include <libpldm/bios.h>
+#include <libpldm/utils.h>
#include <array>
#include <cstdint>
#include <cstring>
#include <memory>
-#include "libpldm/base.h"
-#include "libpldm/bios.h"
-#include "libpldm/utils.h"
-
#include <gtest/gtest.h>
constexpr auto hdrSize = sizeof(pldm_msg_hdr);
diff --git a/tests/libpldm_pdr_test.cpp b/tests/libpldm_pdr_test.cpp
index a6955a4..a5f62e7 100644
--- a/tests/libpldm_pdr_test.cpp
+++ b/tests/libpldm_pdr_test.cpp
@@ -1,4 +1,6 @@
#include <endian.h>
+#include <libpldm/pdr.h>
+#include <libpldm/platform.h>
#include <array>
#include <cstdint>
@@ -6,9 +8,6 @@
#include <cstring>
#include <vector>
-#include "libpldm/pdr.h"
-#include "libpldm/platform.h"
-
#include <gtest/gtest.h>
TEST(PDRAccess, testInit)
diff --git a/tests/transport.cpp b/tests/transport.cpp
index 3fc783f..41ef42e 100644
--- a/tests/transport.cpp
+++ b/tests/transport.cpp
@@ -1,4 +1,4 @@
-#include "libpldm/transport.h"
+#include <libpldm/transport.h>
#include "array.h"
#include "transport/test.h"
diff --git a/tests/transport/send_recv_one.cpp b/tests/transport/send_recv_one.cpp
index f411e48..ac466f5 100644
--- a/tests/transport/send_recv_one.cpp
+++ b/tests/transport/send_recv_one.cpp
@@ -1,5 +1,6 @@
+#include <libpldm/transport.h>
+
#include "array.h"
-#include "libpldm/transport.h"
#include "transport/test.h"
#include <gtest/gtest.h>
diff --git a/tests/transport/send_recv_timeout.cpp b/tests/transport/send_recv_timeout.cpp
index d2d6853..bec6b36 100644
--- a/tests/transport/send_recv_timeout.cpp
+++ b/tests/transport/send_recv_timeout.cpp
@@ -1,5 +1,6 @@
+#include <libpldm/transport.h>
+
#include "array.h"
-#include "libpldm/transport.h"
#include "transport/test.h"
#include <gtest/gtest.h>
diff --git a/tests/transport/send_recv_unwanted.cpp b/tests/transport/send_recv_unwanted.cpp
index 7b3ebff..3d6fd7c 100644
--- a/tests/transport/send_recv_unwanted.cpp
+++ b/tests/transport/send_recv_unwanted.cpp
@@ -1,5 +1,6 @@
+#include <libpldm/transport.h>
+
#include "array.h"
-#include "libpldm/transport.h"
#include "transport/test.h"
#include <gtest/gtest.h>
diff --git a/tests/transport/send_recv_wrong_command_code.cpp b/tests/transport/send_recv_wrong_command_code.cpp
index f40a82a..fcb0c9b 100644
--- a/tests/transport/send_recv_wrong_command_code.cpp
+++ b/tests/transport/send_recv_wrong_command_code.cpp
@@ -1,5 +1,6 @@
+#include <libpldm/transport.h>
+
#include "array.h"
-#include "libpldm/transport.h"
#include "transport/test.h"
#include <gtest/gtest.h>
diff --git a/tests/transport/send_recv_wrong_pldm_type.cpp b/tests/transport/send_recv_wrong_pldm_type.cpp
index e57207d..287b6b2 100644
--- a/tests/transport/send_recv_wrong_pldm_type.cpp
+++ b/tests/transport/send_recv_wrong_pldm_type.cpp
@@ -1,5 +1,6 @@
+#include <libpldm/transport.h>
+
#include "array.h"
-#include "libpldm/transport.h"
#include "transport/test.h"
#include <gtest/gtest.h>