clang-tidy: Fix readability-inconsistent-declaration-parameter-name
For example
```
/usr/bin/clang-tidy -checks=-*, readability-inconsistent-declaration-parameter-name -export-fixes /tmp/tmpy4skh98o/tmpwv373mwe.yaml -p=build /mnt/host/andrew/src/openbmc/libpldm/src/bios.c
../include/libpldm/bios.h:258:5: error: function 'encode_set_bios_attribute_current_value_req' has a definition with different parameter names [readability-inconsistent-declaration-parameter-name,-warnings-as-errors]
int encode_set_bios_attribute_current_value_req(
^
../src/bios.c:449:5: note: the definition seen here
int encode_set_bios_attribute_current_value_req(
^
/mnt/host/andrew/src/openbmc/libpldm/build/../include/libpldm/bios.h:258:5: note: differing parameters are named here: ('payload_length'), in definition: ('payload_lenth')
int encode_set_bios_attribute_current_value_req(
^
```
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: Ia49183168619867709807507028e34a12cbdb937
diff --git a/include/libpldm/bios_table.h b/include/libpldm/bios_table.h
index f2fdc5a..5a07e7b 100644
--- a/include/libpldm/bios_table.h
+++ b/include/libpldm/bios_table.h
@@ -519,7 +519,7 @@
*/
void pldm_bios_table_attr_value_entry_encode_enum(
void *entry, size_t entry_length, uint16_t attr_handle, uint8_t attr_type,
- uint8_t count, const uint8_t *handle_indexes);
+ uint8_t count, const uint8_t *handles);
/** @brief Get number of current values for the enum entry
* @param[in] entry - Pointer to bios attribute value table entry
@@ -554,7 +554,7 @@
*/
int pldm_bios_table_attr_value_entry_encode_enum_check(
void *entry, size_t entry_length, uint16_t attr_handle, uint8_t attr_type,
- uint8_t count, uint8_t *handle_indexes);
+ uint8_t count, uint8_t *handles);
/** @brief Get length that an attribute value entry(type: string) will take
* @param[in] string_length - Length of the current string in byte, 0 indicates
@@ -577,7 +577,7 @@
*/
void pldm_bios_table_attr_value_entry_encode_string(
void *entry, size_t entry_length, uint16_t attr_handle, uint8_t attr_type,
- uint16_t string_length, const char *string);
+ uint16_t str_length, const char *string);
/** @brief Get length of the current string in bytes
* @param [in] entry - Pointer to bios attribute value table entry
@@ -612,7 +612,7 @@
*/
int pldm_bios_table_attr_value_entry_encode_string_check(
void *entry, size_t entry_length, uint16_t attr_handle, uint8_t attr_type,
- uint16_t string_length, const char *string);
+ uint16_t str_length, const char *string);
/** @brief Get length that an attribute value entry(type: integer) will take
* @return The length that an entry(type: integer) will take
diff --git a/src/bios.c b/src/bios.c
index d9c4c3e..aa8cc15 100644
--- a/src/bios.c
+++ b/src/bios.c
@@ -449,13 +449,13 @@
int encode_set_bios_attribute_current_value_req(
uint8_t instance_id, uint32_t transfer_handle, uint8_t transfer_flag,
const uint8_t *attribute_data, size_t attribute_length,
- struct pldm_msg *msg, size_t payload_lenth)
+ struct pldm_msg *msg, size_t payload_length)
{
if (msg == NULL || attribute_data == NULL) {
return PLDM_ERROR_INVALID_DATA;
}
if (PLDM_SET_BIOS_ATTR_CURR_VAL_MIN_REQ_BYTES + attribute_length !=
- payload_lenth) {
+ payload_length) {
return PLDM_ERROR_INVALID_LENGTH;
}
struct pldm_header_info header = {0};