utils: Rename crc8() to pldm_edac_crc8()
Chip away at transitioning the library API surface to a consistent
symbol prefix.
Change-Id: I32b0b938d2ff32dcf224307a05355cdfd5943f41
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c4626b1..4dbe21b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -20,6 +20,7 @@
### Added
- utils: Introduce `pldm_edac_crc32()`
+- utils: Introduce `pldm_edac_crc8()`
### Changed
@@ -32,6 +33,10 @@
Users of `crc32()` should move to `pldm_edac_crc32()`
+- utils: Deprecate `crc8()`
+
+ Users of `crc8()` should move to `pldm_edac_crc8()`
+
### Removed
- requester: Remove related deprecated APIs
diff --git a/abi/x86_64/gcc.dump b/abi/x86_64/gcc.dump
index 8d4f2a7..2035be2 100644
--- a/abi/x86_64/gcc.dump
+++ b/abi/x86_64/gcc.dump
@@ -260,7 +260,7 @@
},
'5959' => {
'Header' => 'utils.h',
- 'Line' => '109',
+ 'Line' => '110',
'Param' => {
'0' => {
'name' => 'transfer_flag',
@@ -272,7 +272,7 @@
},
'6019' => {
'Header' => 'utils.h',
- 'Line' => '100',
+ 'Line' => '101',
'Param' => {
'0' => {
'name' => 'seconds',
@@ -304,7 +304,7 @@
},
'6263' => {
'Header' => 'utils.h',
- 'Line' => '88',
+ 'Line' => '89',
'Param' => {
'0' => {
'name' => 'dec',
@@ -316,7 +316,7 @@
},
'6392' => {
'Header' => 'utils.h',
- 'Line' => '82',
+ 'Line' => '83',
'Param' => {
'0' => {
'name' => 'bcd',
@@ -328,7 +328,7 @@
},
'6495' => {
'Header' => 'utils.h',
- 'Line' => '76',
+ 'Line' => '77',
'Param' => {
'0' => {
'name' => 'dec',
@@ -340,7 +340,7 @@
},
'6611' => {
'Header' => 'utils.h',
- 'Line' => '70',
+ 'Line' => '71',
'Param' => {
'0' => {
'name' => 'bcd',
@@ -352,7 +352,7 @@
},
'6714' => {
'Header' => 'utils.h',
- 'Line' => '64',
+ 'Line' => '65',
'Param' => {
'0' => {
'name' => 'dec',
@@ -364,7 +364,7 @@
},
'6767' => {
'Header' => 'utils.h',
- 'Line' => '58',
+ 'Line' => '59',
'Param' => {
'0' => {
'name' => 'bcd',
@@ -376,7 +376,7 @@
},
'6820' => {
'Header' => 'utils.h',
- 'Line' => '52',
+ 'Line' => '53',
'Param' => {
'0' => {
'name' => 'version',
@@ -399,6 +399,7 @@
'ShortName' => 'ver2str'
},
'6949' => {
+ 'Alias' => 'pldm_edac_crc8',
'Header' => 'utils.h',
'Line' => '31',
'Param' => {
@@ -420,7 +421,7 @@
'7063' => {
'Alias' => 'pldm_edac_crc32',
'Header' => 'utils.h',
- 'Line' => '39',
+ 'Line' => '40',
'Param' => {
'0' => {
'name' => 'data',
@@ -9634,6 +9635,7 @@
'pldm_bios_table_string_find_by_handle' => 1,
'pldm_bios_table_string_find_by_string' => 1,
'pldm_edac_crc32' => 1,
+ 'pldm_edac_crc8' => 1,
'pldm_entity_association_pdr_add' => 1,
'pldm_entity_association_pdr_add_from_node' => 1,
'pldm_entity_association_pdr_add_from_node_with_record_handle' => 1,
diff --git a/evolutions/current/crc8.yaml b/evolutions/current/crc8.yaml
new file mode 100644
index 0000000..fa0b292
--- /dev/null
+++ b/evolutions/current/crc8.yaml
@@ -0,0 +1,2 @@
+- QualifiedName: crc8
+ NewName: pldm_edac_crc8
diff --git a/include/libpldm/utils.h b/include/libpldm/utils.h
index 7b719e1..365fd67 100644
--- a/include/libpldm/utils.h
+++ b/include/libpldm/utils.h
@@ -28,6 +28,7 @@
* @param[in] size - Size of the data
* @return The checksum
*/
+uint8_t pldm_edac_crc8(const void *data, size_t size);
uint8_t crc8(const void *data, size_t size);
/** @brief Compute crc32 (same as the one used by IEEE802.3)
diff --git a/meson.build b/meson.build
index 4821698..9d5a60b 100644
--- a/meson.build
+++ b/meson.build
@@ -46,7 +46,10 @@
entrypoint += ' __attribute__((tainted_args))'
endif
-libpldm_deprecated_aliases = [['crc32', 'pldm_edac_crc32']]
+libpldm_deprecated_aliases = [
+ ['crc32', 'pldm_edac_crc32'],
+ ['crc8', 'pldm_edac_crc8'],
+]
if get_option('abi').contains('deprecated')
conf.set('LIBPLDM_ABI_DEPRECATED', entrypoint)
conf.set(
diff --git a/src/utils.c b/src/utils.c
index cb9d10e..ca0b848 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -97,7 +97,7 @@
}
LIBPLDM_ABI_STABLE
-uint8_t crc8(const void *data, size_t size)
+uint8_t pldm_edac_crc8(const void *data, size_t size)
{
const uint8_t *p = data;
uint8_t crc = 0x00;
diff --git a/tests/utils.cpp b/tests/utils.cpp
index b9d3197..0b4ca8b 100644
--- a/tests/utils.cpp
+++ b/tests/utils.cpp
@@ -16,7 +16,7 @@
TEST(Crc8, CheckSumTest)
{
const char* data = "123456789";
- auto checksum = crc8(data, 9);
+ auto checksum = pldm_edac_crc8(data, 9);
EXPECT_EQ(checksum, 0xf4);
}