mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-10 18:47:22 +00:00
ID: 3608765 - Fix indentation of ipmi_ek_create_amc_p2p_record()
Commit changes indentation and formatting in ipmi_ek_create_amc_p2p_record(). Commit for Dan Gora
This commit is contained in:
parent
d1d404fef4
commit
49784a9ec8
@ -2224,15 +2224,16 @@ static int
|
|||||||
ipmi_ek_create_amc_p2p_record(struct ipmi_ek_multi_header * record,
|
ipmi_ek_create_amc_p2p_record(struct ipmi_ek_multi_header * record,
|
||||||
struct ipmi_ek_amc_p2p_connectivity_record * amc_record)
|
struct ipmi_ek_amc_p2p_connectivity_record * amc_record)
|
||||||
{
|
{
|
||||||
int return_status = OK_STATUS;
|
|
||||||
int index_data = START_DATA_OFFSET;
|
int index_data = START_DATA_OFFSET;
|
||||||
|
int return_status = OK_STATUS;
|
||||||
|
|
||||||
amc_record->guid_count = record->data[index_data++];
|
amc_record->guid_count = record->data[index_data++];
|
||||||
if (amc_record->guid_count > 0) {
|
if (amc_record->guid_count > 0) {
|
||||||
int index_oem = 0;
|
int index_oem = 0;
|
||||||
amc_record->oem_guid = malloc(amc_record->guid_count * \
|
amc_record->oem_guid = malloc(amc_record->guid_count * \
|
||||||
sizeof(struct fru_picmgext_guid));
|
sizeof(struct fru_picmgext_guid));
|
||||||
for (index_oem = 0; index_oem < amc_record->guid_count; index_oem++){
|
for (index_oem = 0; index_oem < amc_record->guid_count;
|
||||||
|
index_oem++) {
|
||||||
memcpy(&amc_record->oem_guid[index_oem].guid,
|
memcpy(&amc_record->oem_guid[index_oem].guid,
|
||||||
&record->data[index_data],
|
&record->data[index_data],
|
||||||
SIZE_OF_GUID);
|
SIZE_OF_GUID);
|
||||||
@ -2244,24 +2245,22 @@ ipmi_ek_create_amc_p2p_record( struct ipmi_ek_multi_header * record,
|
|||||||
amc_record->link_desc_count = ((record->header.len) - 8 -
|
amc_record->link_desc_count = ((record->header.len) - 8 -
|
||||||
(SIZE_OF_GUID*amc_record->guid_count) -
|
(SIZE_OF_GUID*amc_record->guid_count) -
|
||||||
(FRU_PICMGEXT_AMC_CHANNEL_DESC_RECORD_SIZE *
|
(FRU_PICMGEXT_AMC_CHANNEL_DESC_RECORD_SIZE *
|
||||||
amc_record->ch_count)
|
amc_record->ch_count)) / 5 ;
|
||||||
)/5 ;
|
} else {
|
||||||
}
|
|
||||||
else{
|
|
||||||
amc_record->rsc_id = record->data[index_data++];
|
amc_record->rsc_id = record->data[index_data++];
|
||||||
amc_record->ch_count = record->data[index_data++];
|
amc_record->ch_count = record->data[index_data++];
|
||||||
/* Calculate link descriptor count see spec AMC.0 for detail */
|
/* Calculate link descriptor count see spec AMC.0 for detail */
|
||||||
amc_record->link_desc_count = ((record->header.len) - 8 -
|
amc_record->link_desc_count = ((record->header.len) - 8 -
|
||||||
(FRU_PICMGEXT_AMC_CHANNEL_DESC_RECORD_SIZE *
|
(FRU_PICMGEXT_AMC_CHANNEL_DESC_RECORD_SIZE *
|
||||||
amc_record->ch_count )
|
amc_record->ch_count)) / 5;
|
||||||
) / 5;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (amc_record->ch_count > 0) {
|
if (amc_record->ch_count > 0) {
|
||||||
int ch_index = 0;
|
int ch_index = 0;
|
||||||
amc_record->ch_desc = malloc((amc_record->ch_count) * \
|
amc_record->ch_desc = malloc((amc_record->ch_count) * \
|
||||||
sizeof(struct fru_picmgext_amc_channel_desc_record));
|
sizeof(struct fru_picmgext_amc_channel_desc_record));
|
||||||
for (ch_index = 0; ch_index < amc_record->ch_count; ch_index++){
|
for (ch_index = 0; ch_index < amc_record->ch_count;
|
||||||
|
ch_index++) {
|
||||||
unsigned int data;
|
unsigned int data;
|
||||||
struct fru_picmgext_amc_channel_desc_record *src, *dst;
|
struct fru_picmgext_amc_channel_desc_record *src, *dst;
|
||||||
data = record->data[index_data] |
|
data = record->data[index_data] |
|
||||||
@ -2271,6 +2270,7 @@ ipmi_ek_create_amc_p2p_record( struct ipmi_ek_multi_header * record,
|
|||||||
src = (struct fru_picmgext_amc_channel_desc_record *)&data;
|
src = (struct fru_picmgext_amc_channel_desc_record *)&data;
|
||||||
dst = (struct fru_picmgext_amc_channel_desc_record *)
|
dst = (struct fru_picmgext_amc_channel_desc_record *)
|
||||||
&amc_record->ch_desc[ch_index];
|
&amc_record->ch_desc[ch_index];
|
||||||
|
|
||||||
dst->lane0port = src->lane0port;
|
dst->lane0port = src->lane0port;
|
||||||
dst->lane1port = src->lane1port;
|
dst->lane1port = src->lane1port;
|
||||||
dst->lane2port = src->lane2port;
|
dst->lane2port = src->lane2port;
|
||||||
@ -2280,7 +2280,7 @@ ipmi_ek_create_amc_p2p_record( struct ipmi_ek_multi_header * record,
|
|||||||
}
|
}
|
||||||
if (amc_record->link_desc_count > 0) {
|
if (amc_record->link_desc_count > 0) {
|
||||||
int i=0;
|
int i=0;
|
||||||
amc_record->link_desc = malloc ( amc_record->link_desc_count *
|
amc_record->link_desc = malloc(amc_record->link_desc_count * \
|
||||||
sizeof(struct fru_picmgext_amc_link_desc_record));
|
sizeof(struct fru_picmgext_amc_link_desc_record));
|
||||||
for (i = 0; i< amc_record->link_desc_count; i++) {
|
for (i = 0; i< amc_record->link_desc_count; i++) {
|
||||||
unsigned int data[2];
|
unsigned int data[2];
|
||||||
@ -2289,6 +2289,7 @@ ipmi_ek_create_amc_p2p_record( struct ipmi_ek_multi_header * record,
|
|||||||
(record->data[index_data + 1] << 8) |
|
(record->data[index_data + 1] << 8) |
|
||||||
(record->data[index_data + 2] << 16) |
|
(record->data[index_data + 2] << 16) |
|
||||||
(record->data[index_data + 3] << 24);
|
(record->data[index_data + 3] << 24);
|
||||||
|
|
||||||
data[1] = record->data[index_data + 4];
|
data[1] = record->data[index_data + 4];
|
||||||
src = (struct fru_picmgext_amc_link_desc_record*)&data;
|
src = (struct fru_picmgext_amc_link_desc_record*)&data;
|
||||||
dst = (struct fru_picmgext_amc_link_desc_record*)
|
dst = (struct fru_picmgext_amc_link_desc_record*)
|
||||||
@ -2305,11 +2306,9 @@ ipmi_ek_create_amc_p2p_record( struct ipmi_ek_multi_header * record,
|
|||||||
dst->asym_match = src->asym_match;
|
dst->asym_match = src->asym_match;
|
||||||
index_data += FRU_PICMGEXT_AMC_LINK_DESC_RECORD_SIZE;
|
index_data += FRU_PICMGEXT_AMC_LINK_DESC_RECORD_SIZE;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
return_status = ERROR_STATUS;
|
return_status = ERROR_STATUS;
|
||||||
}
|
}
|
||||||
|
|
||||||
return return_status;
|
return return_status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user