dsp: pdr: Rename pldm_pdr_add_fru_record_set_check()
Drop the `_check` suffix so it is now `pldm_pdr_add_fru_record_set()`,
and run `apply-renames` to update any internal references.
Change-Id: Iaaa452269caa47369c80b43bf65f30d2a004ec66
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0e304b4..97ba8e4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -35,23 +35,22 @@
### Deprecated
-1. fru: Deprecate `get_fru_record_by_option_check()`
+1. Rename and deprecate functions with the `_check` suffix
- Users should switch to `get_fru_record_by_option()`. Migration can be
- performed using the `apply-renames` script and the [clang-rename][]
- configuration under `evolutions/`:
+ All library function return values always need to be checked. The `_check`
+ suffix is redundant, so remove it. Migration to the non-deprecated
+ equivalents without the `_check` suffix can be performed using
+ `scripts/ apply-renames` and the [clang-rename][] configurations under
+ `evolutions/`
- ```
- $ ./scripts/apply-renames evolutions/current/get_fru_record_by_option_check.yaml
- ```
+ The deprecated functions:
+
+ - `get_fru_record_by_option_check()`
+ - `pldm_pdr_add_check()`
+ - `pldm_pdr_add_fru_record_set_check()`
[clang-rename]: https://clang.llvm.org/extra/clang-rename.html
-2. dsp: pdr: Rename pldm_pdr_add_check()
-
- Users should switch to `pldm_pdr_add()`. Migration can be automated with
- `evolutions/current/pldm_pdr_add_check.yaml`.
-
### Removed
1. IBM OEM header compatibility symlinks.
diff --git a/abi/x86_64/gcc.dump b/abi/x86_64/gcc.dump
index 5e34119..a8adda1 100644
--- a/abi/x86_64/gcc.dump
+++ b/abi/x86_64/gcc.dump
@@ -4351,7 +4351,7 @@
},
'76434' => {
'Header' => 'pdr.h',
- 'Line' => '641',
+ 'Line' => '646',
'Param' => {
'0' => {
'name' => 'pdr',
@@ -4379,7 +4379,7 @@
},
'76762' => {
'Header' => 'pdr.h',
- 'Line' => '629',
+ 'Line' => '634',
'Param' => {
'0' => {
'name' => 'tree',
@@ -4394,7 +4394,7 @@
},
'76816' => {
'Header' => 'pdr.h',
- 'Line' => '619',
+ 'Line' => '624',
'Param' => {
'0' => {
'name' => 'tree',
@@ -4409,7 +4409,7 @@
},
'76879' => {
'Header' => 'pdr.h',
- 'Line' => '609',
+ 'Line' => '614',
'Param' => {
'0' => {
'name' => 'org_tree',
@@ -4425,7 +4425,7 @@
},
'77263' => {
'Header' => 'pdr.h',
- 'Line' => '583',
+ 'Line' => '588',
'Param' => {
'0' => {
'name' => 'tree',
@@ -4441,7 +4441,7 @@
},
'77543' => {
'Header' => 'pdr.h',
- 'Line' => '597',
+ 'Line' => '602',
'Param' => {
'0' => {
'name' => 'tree',
@@ -4520,7 +4520,7 @@
},
'78568' => {
'Header' => 'pdr.h',
- 'Line' => '544',
+ 'Line' => '549',
'Param' => {
'0' => {
'name' => 'tree',
@@ -4540,7 +4540,7 @@
},
'78855' => {
'Header' => 'pdr.h',
- 'Line' => '533',
+ 'Line' => '538',
'Param' => {
'0' => {
'name' => 'node',
@@ -4585,7 +4585,7 @@
},
'79088' => {
'Header' => 'pdr.h',
- 'Line' => '516',
+ 'Line' => '521',
'Param' => {
'0' => {
'name' => 'node',
@@ -4617,7 +4617,7 @@
},
'79306' => {
'Header' => 'pdr.h',
- 'Line' => '467',
+ 'Line' => '472',
'Param' => {
'0' => {
'name' => 'tree',
@@ -4641,7 +4641,7 @@
},
'80829' => {
'Header' => 'pdr.h',
- 'Line' => '570',
+ 'Line' => '575',
'Param' => {
'0' => {
'name' => 'parent',
@@ -4661,7 +4661,7 @@
},
'80918' => {
'Header' => 'pdr.h',
- 'Line' => '556',
+ 'Line' => '561',
'Param' => {
'0' => {
'name' => 'node',
@@ -4681,7 +4681,7 @@
},
'81133' => {
'Header' => 'pdr.h',
- 'Line' => '438',
+ 'Line' => '443',
'Param' => {
'0' => {
'name' => 'node',
@@ -4696,7 +4696,7 @@
},
'81288' => {
'Header' => 'pdr.h',
- 'Line' => '428',
+ 'Line' => '433',
'Param' => {
'0' => {
'name' => 'node',
@@ -4708,7 +4708,7 @@
},
'81422' => {
'Header' => 'pdr.h',
- 'Line' => '418',
+ 'Line' => '423',
'Param' => {
'0' => {
'name' => 'node',
@@ -4720,7 +4720,7 @@
},
'81577' => {
'Header' => 'pdr.h',
- 'Line' => '408',
+ 'Line' => '413',
'Param' => {
'0' => {
'name' => 'tree',
@@ -4735,7 +4735,7 @@
},
'81756' => {
'Header' => 'pdr.h',
- 'Line' => '380',
+ 'Line' => '385',
'Param' => {
'0' => {
'name' => 'tree',
@@ -4758,7 +4758,7 @@
},
'82215' => {
'Header' => 'pdr.h',
- 'Line' => '362',
+ 'Line' => '367',
'Param' => {
'0' => {
'name' => 'tree',
@@ -4800,7 +4800,7 @@
},
'82742' => {
'Header' => 'pdr.h',
- 'Line' => '334',
+ 'Line' => '339',
'Param' => {
'0' => {
'name' => 'tree',
@@ -4828,13 +4828,13 @@
},
'83175' => {
'Header' => 'pdr.h',
- 'Line' => '317',
+ 'Line' => '322',
'Return' => '76811',
'ShortName' => 'pldm_entity_association_tree_init'
},
'83249' => {
'Header' => 'pdr.h',
- 'Line' => '402',
+ 'Line' => '407',
'Param' => {
'0' => {
'name' => 'entity',
@@ -4846,7 +4846,7 @@
},
'83409' => {
'Header' => 'pdr.h',
- 'Line' => '391',
+ 'Line' => '396',
'Param' => {
'0' => {
'name' => 'node',
@@ -4892,7 +4892,7 @@
},
'84562' => {
'Header' => 'pdr.h',
- 'Line' => '282',
+ 'Line' => '287',
'Param' => {
'0' => {
'name' => 'repo',
@@ -4960,7 +4960,7 @@
}
},
'Return' => '100',
- 'ShortName' => 'pldm_pdr_add_fru_record_set_check'
+ 'ShortName' => 'pldm_pdr_add_fru_record_set'
},
'85255' => {
'Header' => 'pdr.h',
@@ -9533,6 +9533,7 @@
'pldm_open' => 1,
'pldm_pdr_add' => 1,
'pldm_pdr_add_check' => 1,
+ 'pldm_pdr_add_fru_record_set' => 1,
'pldm_pdr_add_fru_record_set_check' => 1,
'pldm_pdr_destroy' => 1,
'pldm_pdr_find_last_in_range' => 1,
@@ -11134,7 +11135,7 @@
},
'63089' => {
'Header' => 'pdr.h',
- 'Line' => '291',
+ 'Line' => '296',
'Memb' => {
'0' => {
'name' => 'entity_type',
@@ -11159,7 +11160,7 @@
'63146' => {
'BaseType' => '63089',
'Header' => 'pdr.h',
- 'Line' => '295',
+ 'Line' => '300',
'Name' => 'pldm_entity',
'Size' => '6',
'Type' => 'Typedef'
@@ -11167,7 +11168,7 @@
'63190' => {
'BaseType' => '63202',
'Header' => 'pdr.h',
- 'Line' => '305',
+ 'Line' => '310',
'Name' => 'pldm_entity_association_tree',
'PrivateABI' => 1,
'Size' => '16',
@@ -11196,7 +11197,7 @@
'63245' => {
'BaseType' => '63262',
'Header' => 'pdr.h',
- 'Line' => '310',
+ 'Line' => '315',
'Name' => 'pldm_entity_node',
'PrivateABI' => 1,
'Size' => '40',
diff --git a/evolutions/current/pldm_pdr_add_fru_record_set_check.yaml b/evolutions/current/pldm_pdr_add_fru_record_set_check.yaml
new file mode 100644
index 0000000..f25bce8
--- /dev/null
+++ b/evolutions/current/pldm_pdr_add_fru_record_set_check.yaml
@@ -0,0 +1,2 @@
+- QualifiedName: pldm_pdr_add_fru_record_set_check
+ NewName: pldm_pdr_add_fru_record_set
diff --git a/include/libpldm/pdr.h b/include/libpldm/pdr.h
index a25c07a..da8e853 100644
--- a/include/libpldm/pdr.h
+++ b/include/libpldm/pdr.h
@@ -258,6 +258,11 @@
* @return 0 on success, -EINVAL if the arguments are invalid, or -ENOMEM if an internal allocation
* fails.
*/
+int pldm_pdr_add_fru_record_set(pldm_pdr *repo, uint16_t terminus_handle,
+ uint16_t fru_rsi, uint16_t entity_type,
+ uint16_t entity_instance_num,
+ uint16_t container_id,
+ uint32_t *bmc_record_handle);
int pldm_pdr_add_fru_record_set_check(pldm_pdr *repo, uint16_t terminus_handle,
uint16_t fru_rsi, uint16_t entity_type,
uint16_t entity_instance_num,
diff --git a/meson.build b/meson.build
index dfd1cb2..a9d290a 100644
--- a/meson.build
+++ b/meson.build
@@ -35,6 +35,7 @@
libpldm_deprecated_aliases += [
['get_fru_record_by_option_check', 'get_fru_record_by_option'],
['pldm_pdr_add_check', 'pldm_pdr_add'],
+ ['pldm_pdr_add_fru_record_set_check', 'pldm_pdr_add_fru_record_set'],
]
else
conf.set('LIBPLDM_ABI_DEPRECATED', '')
diff --git a/src/dsp/pdr.c b/src/dsp/pdr.c
index ec95468..bf63ecf 100644
--- a/src/dsp/pdr.c
+++ b/src/dsp/pdr.c
@@ -283,11 +283,11 @@
}
LIBPLDM_ABI_STABLE
-int pldm_pdr_add_fru_record_set_check(pldm_pdr *repo, uint16_t terminus_handle,
- uint16_t fru_rsi, uint16_t entity_type,
- uint16_t entity_instance_num,
- uint16_t container_id,
- uint32_t *bmc_record_handle)
+int pldm_pdr_add_fru_record_set(pldm_pdr *repo, uint16_t terminus_handle,
+ uint16_t fru_rsi, uint16_t entity_type,
+ uint16_t entity_instance_num,
+ uint16_t container_id,
+ uint32_t *bmc_record_handle)
{
if (!repo || !bmc_record_handle) {
return -EINVAL;
diff --git a/tests/dsp/pdr.cpp b/tests/dsp/pdr.cpp
index 0894a3f..9ef8b14 100644
--- a/tests/dsp/pdr.cpp
+++ b/tests/dsp/pdr.cpp
@@ -481,8 +481,7 @@
auto repo = pldm_pdr_init();
uint32_t handle = 0;
- EXPECT_EQ(
- pldm_pdr_add_fru_record_set_check(repo, 1, 10, 1, 0, 100, &handle), 0);
+ EXPECT_EQ(pldm_pdr_add_fru_record_set(repo, 1, 10, 1, 0, 100, &handle), 0);
EXPECT_EQ(handle, 1u);
EXPECT_EQ(pldm_pdr_get_record_count(repo), 1u);
EXPECT_EQ(pldm_pdr_get_repo_size(repo),
@@ -509,8 +508,7 @@
outData = nullptr;
handle = 0;
- EXPECT_EQ(
- pldm_pdr_add_fru_record_set_check(repo, 2, 11, 2, 1, 101, &handle), 0);
+ EXPECT_EQ(pldm_pdr_add_fru_record_set(repo, 2, 11, 2, 1, 101, &handle), 0);
EXPECT_EQ(handle, 2u);
EXPECT_EQ(pldm_pdr_get_record_count(repo), 2u);
EXPECT_EQ(pldm_pdr_get_repo_size(repo),
@@ -563,14 +561,11 @@
uint16_t entityInstanceNum{};
uint16_t containerId{};
uint32_t first = 1;
- EXPECT_EQ(pldm_pdr_add_fru_record_set_check(repo, 1, 1, 1, 0, 100, &first),
- 0);
+ EXPECT_EQ(pldm_pdr_add_fru_record_set(repo, 1, 1, 1, 0, 100, &first), 0);
uint32_t second = 2;
- EXPECT_EQ(pldm_pdr_add_fru_record_set_check(repo, 1, 2, 1, 1, 100, &second),
- 0);
+ EXPECT_EQ(pldm_pdr_add_fru_record_set(repo, 1, 2, 1, 1, 100, &second), 0);
uint32_t third = 3;
- EXPECT_EQ(pldm_pdr_add_fru_record_set_check(repo, 1, 3, 1, 2, 100, &third),
- 0);
+ EXPECT_EQ(pldm_pdr_add_fru_record_set(repo, 1, 3, 1, 2, 100, &third), 0);
EXPECT_EQ(first, pldm_pdr_get_record_handle(
repo, pldm_pdr_fru_record_set_find_by_rsi(
repo, 1, &terminusHdl, &entityType,
@@ -1646,10 +1641,10 @@
auto l1 = pldm_entity_association_tree_add(tree, &entities[1], 63, node,
PLDM_ENTITY_ASSOCIAION_PHYSICAL);
uint32_t first = 1;
- EXPECT_EQ(pldm_pdr_add_fru_record_set_check(
- repo, 1, 1, entities[1].entity_type,
- entities[1].entity_instance_num,
- entities[1].entity_container_id, &first),
+ EXPECT_EQ(pldm_pdr_add_fru_record_set(repo, 1, 1, entities[1].entity_type,
+ entities[1].entity_instance_num,
+ entities[1].entity_container_id,
+ &first),
0);
EXPECT_NE(l1, nullptr);
EXPECT_EQ(entities[1].entity_instance_num, 63);
@@ -1663,10 +1658,10 @@
auto l2 = pldm_entity_association_tree_add(tree, &entities[2], 37, node,
PLDM_ENTITY_ASSOCIAION_PHYSICAL);
uint32_t second = 2;
- EXPECT_EQ(pldm_pdr_add_fru_record_set_check(
- repo, 1, 2, entities[2].entity_type,
- entities[2].entity_instance_num,
- entities[2].entity_container_id, &second),
+ EXPECT_EQ(pldm_pdr_add_fru_record_set(repo, 1, 2, entities[2].entity_type,
+ entities[2].entity_instance_num,
+ entities[2].entity_container_id,
+ &second),
0);
EXPECT_NE(l2, nullptr);
EXPECT_EQ(entities[2].entity_instance_num, 37);
@@ -1680,10 +1675,10 @@
auto l3 = pldm_entity_association_tree_add(tree, &entities[3], 44, node,
PLDM_ENTITY_ASSOCIAION_PHYSICAL);
uint32_t third = 3;
- EXPECT_EQ(pldm_pdr_add_fru_record_set_check(
- repo, 1, 3, entities[3].entity_type,
- entities[3].entity_instance_num,
- entities[3].entity_container_id, &third),
+ EXPECT_EQ(pldm_pdr_add_fru_record_set(repo, 1, 3, entities[3].entity_type,
+ entities[3].entity_instance_num,
+ entities[3].entity_container_id,
+ &third),
0);
EXPECT_NE(l3, nullptr);
EXPECT_EQ(entities[3].entity_instance_num, 44);
@@ -1697,10 +1692,10 @@
auto l4 = pldm_entity_association_tree_add(tree, &entities[4], 89, node,
PLDM_ENTITY_ASSOCIAION_PHYSICAL);
uint32_t fourth = 4;
- EXPECT_EQ(pldm_pdr_add_fru_record_set_check(
- repo, 1, 4, entities[4].entity_type,
- entities[4].entity_instance_num,
- entities[4].entity_container_id, &fourth),
+ EXPECT_EQ(pldm_pdr_add_fru_record_set(repo, 1, 4, entities[4].entity_type,
+ entities[4].entity_instance_num,
+ entities[4].entity_container_id,
+ &fourth),
0);
EXPECT_NE(l4, nullptr);
EXPECT_EQ(entities[4].entity_instance_num, 89);
@@ -1714,10 +1709,10 @@
auto l5 = pldm_entity_association_tree_add(tree, &entities[5], 0xffff, node,
PLDM_ENTITY_ASSOCIAION_PHYSICAL);
uint32_t fifth = 5;
- EXPECT_EQ(pldm_pdr_add_fru_record_set_check(
- repo, 1, 5, entities[5].entity_type,
- entities[5].entity_instance_num,
- entities[5].entity_container_id, &fifth),
+ EXPECT_EQ(pldm_pdr_add_fru_record_set(repo, 1, 5, entities[5].entity_type,
+ entities[5].entity_instance_num,
+ entities[5].entity_container_id,
+ &fifth),
0);
EXPECT_NE(l5, nullptr);
EXPECT_EQ(entities[5].entity_instance_num, 90);
@@ -1735,10 +1730,10 @@
auto l7 = pldm_entity_association_tree_add(tree, &entities[7], 100, l1,
PLDM_ENTITY_ASSOCIAION_PHYSICAL);
uint32_t seventh = 7;
- EXPECT_EQ(pldm_pdr_add_fru_record_set_check(
- repo, 1, 7, entities[7].entity_type,
- entities[7].entity_instance_num,
- entities[7].entity_container_id, &seventh),
+ EXPECT_EQ(pldm_pdr_add_fru_record_set(repo, 1, 7, entities[7].entity_type,
+ entities[7].entity_instance_num,
+ entities[7].entity_container_id,
+ &seventh),
0);
EXPECT_NE(l7, nullptr);
EXPECT_EQ(entities[7].entity_instance_num, 100);
@@ -1752,10 +1747,10 @@
auto l8 = pldm_entity_association_tree_add(tree, &entities[8], 100, l2,
PLDM_ENTITY_ASSOCIAION_PHYSICAL);
uint32_t eighth = 8;
- EXPECT_EQ(pldm_pdr_add_fru_record_set_check(
- repo, 1, 8, entities[8].entity_type,
- entities[8].entity_instance_num,
- entities[8].entity_container_id, &eighth),
+ EXPECT_EQ(pldm_pdr_add_fru_record_set(repo, 1, 8, entities[8].entity_type,
+ entities[8].entity_instance_num,
+ entities[8].entity_container_id,
+ &eighth),
0);
EXPECT_NE(l8, nullptr);
EXPECT_EQ(entities[8].entity_instance_num, 100);