clang-tidy: Fix bugprone-reserved-identifier
For example:
```
/usr/bin/clang-tidy -checks=-*, bugprone-reserved-identifier -export-fixes /tmp/tmpzm__u6tl/tmpcmikv8op.yaml -p=build /mnt/host/andrew/src/openbmc/libpldm/src/pdr.c
/mnt/host/andrew/src/openbmc/libpldm/build/../src/pdr.c:605:13: error: declaration uses identifier '_entity_association_pdr_add_entry', which is reserved in the global namespace [bugprone-reserved-identifier,-warnings-as-errors]
static void _entity_association_pdr_add_entry(pldm_entity_node *curr,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
entity_association_pdr_add_entry
```
In the case of header guard macros, prefix them with `LIBPLDM_` and drop
the trailing `__`.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I74809142cc428d2c014e0f7ba43e02d9a229eee2
diff --git a/include/libpldm/bios_table.h b/include/libpldm/bios_table.h
index 7ec73c8..f2fdc5a 100644
--- a/include/libpldm/bios_table.h
+++ b/include/libpldm/bios_table.h
@@ -1,5 +1,5 @@
-#ifndef BIOS_TABLE_H__
-#define BIOS_TABLE_H__
+#ifndef LIBPLDM_BIOS_TABLE_H
+#define LIBPLDM_BIOS_TABLE_H
#ifdef __cplusplus
extern "C" {
diff --git a/include/libpldm/utils.h b/include/libpldm/utils.h
index 9b7bd9f..93720a4 100644
--- a/include/libpldm/utils.h
+++ b/include/libpldm/utils.h
@@ -1,5 +1,5 @@
-#ifndef UTILS_H__
-#define UTILS_H__
+#ifndef LIBPLDM_UTILS_H
+#define LIBPLDM_UTILS_H
#ifdef __cplusplus
extern "C" {
diff --git a/src/pdr.c b/src/pdr.c
index b3a5d5a..b53f491 100644
--- a/src/pdr.c
+++ b/src/pdr.c
@@ -602,12 +602,12 @@
return false;
}
-static void _entity_association_pdr_add_entry(pldm_entity_node *curr,
- pldm_pdr *repo, uint16_t size,
- uint8_t contained_count,
- uint8_t association_type,
- bool is_remote,
- uint16_t terminus_handle)
+static void entity_association_pdr_add_children(pldm_entity_node *curr,
+ pldm_pdr *repo, uint16_t size,
+ uint8_t contained_count,
+ uint8_t association_type,
+ bool is_remote,
+ uint16_t terminus_handle)
{
uint8_t pdr[size];
uint8_t *start = pdr;
@@ -666,7 +666,7 @@
sizeof(struct pldm_pdr_hdr) + sizeof(uint16_t) +
sizeof(uint8_t) + sizeof(pldm_entity) + sizeof(uint8_t) +
(num_logical_children * sizeof(pldm_entity));
- _entity_association_pdr_add_entry(
+ entity_association_pdr_add_children(
curr, repo, logical_pdr_size, num_logical_children,
PLDM_ENTITY_ASSOCIAION_LOGICAL, is_remote, terminus_handle);
}
@@ -676,7 +676,7 @@
sizeof(struct pldm_pdr_hdr) + sizeof(uint16_t) +
sizeof(uint8_t) + sizeof(pldm_entity) + sizeof(uint8_t) +
(num_physical_children * sizeof(pldm_entity));
- _entity_association_pdr_add_entry(
+ entity_association_pdr_add_children(
curr, repo, physical_pdr_size, num_physical_children,
PLDM_ENTITY_ASSOCIAION_PHYSICAL, is_remote,
terminus_handle);