clang-10: run clang-format on the repo
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
Change-Id: Id7e57a37990a764a191a4e6c4427ceeda670ef51
diff --git a/.clang-format b/.clang-format
index ae9ad39..4902840 100644
--- a/.clang-format
+++ b/.clang-format
@@ -21,6 +21,7 @@
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
+ AfterCaseLabel: true
AfterClass: true
AfterControlStatement: true
AfterEnum: true
diff --git a/libpldm/base.h b/libpldm/base.h
index 870e9d8..dd63f1c 100644
--- a/libpldm/base.h
+++ b/libpldm/base.h
@@ -90,22 +90,22 @@
struct pldm_msg_hdr {
#if defined(__LITTLE_ENDIAN_BITFIELD)
uint8_t instance_id : 5; //!< Instance ID
- uint8_t reserved : 1; //!< Reserved
- uint8_t datagram : 1; //!< Datagram bit
- uint8_t request : 1; //!< Request bit
+ uint8_t reserved : 1; //!< Reserved
+ uint8_t datagram : 1; //!< Datagram bit
+ uint8_t request : 1; //!< Request bit
#elif defined(__BIG_ENDIAN_BITFIELD)
- uint8_t request : 1; //!< Request bit
- uint8_t datagram : 1; //!< Datagram bit
- uint8_t reserved : 1; //!< Reserved
+ uint8_t request : 1; //!< Request bit
+ uint8_t datagram : 1; //!< Datagram bit
+ uint8_t reserved : 1; //!< Reserved
uint8_t instance_id : 5; //!< Instance ID
#endif
#if defined(__LITTLE_ENDIAN_BITFIELD)
- uint8_t type : 6; //!< PLDM type
+ uint8_t type : 6; //!< PLDM type
uint8_t header_ver : 2; //!< Header version
#elif defined(__BIG_ENDIAN_BITFIELD)
- uint8_t header_ver : 2; //!< Header version
- uint8_t type : 6; //!< PLDM type
+ uint8_t header_ver : 2; //!< Header version
+ uint8_t type : 6; //!< PLDM type
#endif
uint8_t command; //!< PLDM command code
} __attribute__((packed));
@@ -125,9 +125,9 @@
* pack_pldm_header and unpack_pldm_header API.
*/
struct pldm_header_info {
- MessageType msg_type; //!< PLDM message type
- uint8_t instance; //!< PLDM instance id
- uint8_t pldm_type; //!< PLDM type
+ MessageType msg_type; //!< PLDM message type
+ uint8_t instance; //!< PLDM instance id
+ uint8_t pldm_type; //!< PLDM type
uint8_t command; //!< PLDM command code
uint8_t completion_code; //!< PLDM completion code, applies for response
};
@@ -147,7 +147,7 @@
* Structure representing PLDM get commands request.
*/
struct pldm_get_commands_req {
- uint8_t type; //!< PLDM Type for which command support information is
+ uint8_t type; //!< PLDM Type for which command support information is
//!< being requested
ver32_t version; //!< version for the specified PLDM Type
} __attribute__((packed));
@@ -183,7 +183,7 @@
uint8_t completion_code; //!< completion code
uint32_t next_transfer_handle; //!< next portion of PLDM version data
//!< transfer
- uint8_t transfer_flag; //!< PLDM GetVersion transfer flag
+ uint8_t transfer_flag; //!< PLDM GetVersion transfer flag
uint8_t version_data[1]; //!< PLDM GetVersion version field
} __attribute__((packed));
diff --git a/libpldm/bios.h b/libpldm/bios.h
index d405706..4430053 100644
--- a/libpldm/bios.h
+++ b/libpldm/bios.h
@@ -120,10 +120,10 @@
struct pldm_set_date_time_req {
uint8_t seconds; //!< Seconds in BCD format
uint8_t minutes; //!< Minutes in BCD format
- uint8_t hours; //!< Hours in BCD format
- uint8_t day; //!< Day of the month in BCD format
- uint8_t month; //!< Month in BCD format
- uint16_t year; //!< Year in BCD format
+ uint8_t hours; //!< Hours in BCD format
+ uint8_t day; //!< Day of the month in BCD format
+ uint8_t month; //!< Month in BCD format
+ uint16_t year; //!< Year in BCD format
} __attribute__((packed));
/** @struct pldm_only_cc_resp
diff --git a/libpldm/bios_table.h b/libpldm/bios_table.h
index cf25757..fe964ee 100644
--- a/libpldm/bios_table.h
+++ b/libpldm/bios_table.h
@@ -214,8 +214,8 @@
*/
struct pldm_bios_table_attr_entry_enum_info {
uint16_t name_handle; //!< attribute name handle
- bool read_only; //!< indicate whether the attribute is read-only
- uint8_t pv_num; //!< number of possible values
+ bool read_only; //!< indicate whether the attribute is read-only
+ uint8_t pv_num; //!< number of possible values
const uint16_t *pv_handle; //!< handles of possible values
uint8_t def_num; //!< nnumber of default values
const uint8_t *def_index; //!< indices of default values.
@@ -326,12 +326,12 @@
*
*/
struct pldm_bios_table_attr_entry_string_info {
- uint16_t name_handle; //!< attribute name handle
+ uint16_t name_handle; //!< attribute name handle
bool read_only; //!< indicate whether the attribute is read-only
- uint8_t string_type; //!< The type of the string
- uint16_t min_length; //!< The minimum length of the string in bytes
- uint16_t max_length; //!< The maximum length of the string in bytes
- uint16_t def_length; //!< The length of the defaut string in bytes
+ uint8_t string_type; //!< The type of the string
+ uint16_t min_length; //!< The minimum length of the string in bytes
+ uint16_t max_length; //!< The maximum length of the string in bytes
+ uint16_t def_length; //!< The length of the defaut string in bytes
const char *def_string; //!< The default string itself
};
@@ -429,12 +429,12 @@
*/
struct pldm_bios_table_attr_entry_integer_info {
uint16_t name_handle; //!< attribute name handle
- bool read_only; //!< indicate whether the attribute is read-only
+ bool read_only; //!< indicate whether the attribute is read-only
uint64_t lower_bound; //!< The lower bound on the integer value
uint64_t upper_bound; //!< The upper bound on the integer value
uint32_t scalar_increment; //!< The scalar value that is used for the
//!< increments to this integer
- uint64_t default_value; //!< The default value of the integer
+ uint64_t default_value; //!< The default value of the integer
};
/** @brief Check fields in @ref pldm_bios_table_attr_entry_integer_info
diff --git a/libpldm/platform.h b/libpldm/platform.h
index f2ee670..649189d 100644
--- a/libpldm/platform.h
+++ b/libpldm/platform.h
@@ -402,7 +402,7 @@
* Structure representing a stateField in SetStateEffecterStates command */
typedef struct state_field_for_state_effecter_set {
- uint8_t set_request; //!< Whether to change the state
+ uint8_t set_request; //!< Whether to change the state
uint8_t effecter_state; //!< Expected state of the effecter
} __attribute__((packed)) set_effecter_state_field;
@@ -412,11 +412,11 @@
typedef struct state_field_for_get_state_sensor_readings {
uint8_t sensor_op_state; //!< The state of the sensor itself
- uint8_t present_state; //!< Return a state value
+ uint8_t present_state; //!< Return a state value
uint8_t previous_state; //!< The state that the presentState was entered
//! from. This must be different from the
//! present state
- uint8_t event_state; //!< Return a state value from a PLDM State Set
+ uint8_t event_state; //!< Return a state value from a PLDM State Set
//! that is associated with the sensor
} __attribute__((packed)) get_sensor_state_field;
diff --git a/libpldm/utils.c b/libpldm/utils.c
index 9c701cb..3d25381 100644
--- a/libpldm/utils.c
+++ b/libpldm/utils.c
@@ -182,7 +182,7 @@
if (month < 1 || month > 12) {
return false;
}
- static const int days[13] = {0, 31, 28, 31, 30, 31, 30,
+ static const int days[13] = {0, 31, 28, 31, 30, 31, 30,
31, 31, 30, 31, 30, 31};
int rday = days[month];
if (month == 2 &&
diff --git a/oem/ibm/libpldm/file_io.h b/oem/ibm/libpldm/file_io.h
index fbde227..4d00358 100644
--- a/oem/ibm/libpldm/file_io.h
+++ b/oem/ibm/libpldm/file_io.h
@@ -163,8 +163,8 @@
*/
struct pldm_get_file_table_req {
uint32_t transfer_handle; //!< Data transfer handle
- uint8_t operation_flag; //!< Transfer operation flag
- uint8_t table_type; //!< Table type
+ uint8_t operation_flag; //!< Transfer operation flag
+ uint8_t table_type; //!< Table type
} __attribute__((packed));
/** @struct pldm_get_file_table_resp
@@ -174,8 +174,8 @@
struct pldm_get_file_table_resp {
uint8_t completion_code; //!< Completion code
uint32_t next_transfer_handle; //!< Next data transfer handle
- uint8_t transfer_flag; //!< Transfer flag
- uint8_t table_data[1]; //!< Table Data
+ uint8_t transfer_flag; //!< Transfer flag
+ uint8_t table_data[1]; //!< Table Data
} __attribute__((packed));
/** @brief Decode GetFileTable command request data
@@ -226,7 +226,7 @@
struct pldm_read_file_resp {
uint8_t completion_code; //!< Completion code
uint32_t length; //!< Number of bytes read
- uint8_t file_data[1]; //!< Address of this is where file data starts
+ uint8_t file_data[1]; //!< Address of this is where file data starts
} __attribute__((packed));
/** @struct pldm_write_file_req