msgbuf: Rename 'destroy' APIs to 'complete'
Change the language to better reflect the intent, with the impending
introduction of the ability to 'discard' a msgbuf instance.
Change-Id: Idbb79dcc2587a8baef67ffd405e0bc77e66fe995
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
diff --git a/src/dsp/platform.c b/src/dsp/platform.c
index 11fa9ae..b37de42 100644
--- a/src/dsp/platform.c
+++ b/src/dsp/platform.c
@@ -298,7 +298,7 @@
pldm_msgbuf_extract(buf, field[i].effecter_state);
}
- rc = pldm_msgbuf_destroy(buf);
+ rc = pldm_msgbuf_complete(buf);
if (rc) {
return pldm_xlate_errno(rc);
}
@@ -338,7 +338,7 @@
pldm_msgbuf_extract_p(buf, request_cnt);
pldm_msgbuf_extract_p(buf, record_chg_num);
- rc = pldm_msgbuf_destroy(buf);
+ rc = pldm_msgbuf_complete(buf);
if (rc) {
return pldm_xlate_errno(rc);
}
@@ -499,7 +499,7 @@
pldm_msgbuf_extract_p(buf, largest_record_size);
pldm_msgbuf_extract_p(buf, data_transfer_handle_timeout);
- rc = pldm_msgbuf_destroy(buf);
+ rc = pldm_msgbuf_complete(buf);
if (rc) {
return pldm_xlate_errno(rc);
}
@@ -559,7 +559,7 @@
pldm_msgbuf_extract(buf, resp->largest_record_size);
pldm_msgbuf_extract(buf, resp->data_transfer_handle_timeout);
- return pldm_msgbuf_destroy_consumed(buf);
+ return pldm_msgbuf_complete_consumed(buf);
}
LIBPLDM_ABI_STABLE
@@ -655,7 +655,7 @@
pldm_msgbuf_extract_p(buf, transfer_crc);
}
- rc = pldm_msgbuf_destroy(buf);
+ rc = pldm_msgbuf_complete(buf);
if (rc) {
return pldm_xlate_errno(rc);
}
@@ -713,7 +713,7 @@
pldm_msgbuf_extract_p(buf, transfer_crc);
}
- return pldm_msgbuf_destroy_consumed(buf);
+ return pldm_msgbuf_complete_consumed(buf);
}
LIBPLDM_ABI_STABLE
@@ -752,7 +752,7 @@
pldm_msgbuf_extract_effecter_value(buf, *effecter_data_size,
effecter_value);
- rc = pldm_msgbuf_destroy(buf);
+ rc = pldm_msgbuf_complete(buf);
if (rc) {
return pldm_xlate_errno(rc);
}
@@ -990,7 +990,7 @@
pldm_msgbuf_extract(buf, field[i].event_state);
}
- rc = pldm_msgbuf_destroy_consumed(buf);
+ rc = pldm_msgbuf_complete_consumed(buf);
if (rc) {
return pldm_xlate_errno(rc);
}
@@ -1024,7 +1024,7 @@
pldm_msgbuf_extract(buf, sensor_rearm->byte);
pldm_msgbuf_extract_p(buf, reserved);
- rc = pldm_msgbuf_destroy(buf);
+ rc = pldm_msgbuf_complete(buf);
if (rc) {
return pldm_xlate_errno(rc);
}
@@ -1095,7 +1095,7 @@
pldm_msgbuf_extract_p(buf, tid);
pldm_msgbuf_extract_p(buf, event_class);
- rc = pldm_msgbuf_destroy(buf);
+ rc = pldm_msgbuf_complete(buf);
if (rc) {
return pldm_xlate_errno(rc);
}
@@ -1168,7 +1168,7 @@
return PLDM_ERROR_INVALID_DATA;
}
- rc = pldm_msgbuf_destroy(buf);
+ rc = pldm_msgbuf_complete(buf);
if (rc) {
return pldm_xlate_errno(rc);
}
@@ -1256,7 +1256,7 @@
return PLDM_ERROR_INVALID_LENGTH;
}
- rc = pldm_msgbuf_destroy(buf);
+ rc = pldm_msgbuf_complete(buf);
if (rc) {
return pldm_xlate_errno(rc);
}
@@ -1288,7 +1288,7 @@
pldm_msgbuf_insert(buf, checksum);
}
- rc = pldm_msgbuf_destroy(buf);
+ rc = pldm_msgbuf_complete(buf);
if (rc) {
return pldm_xlate_errno(rc);
}
@@ -1390,7 +1390,7 @@
return PLDM_ERROR_INVALID_DATA;
}
- rc = pldm_msgbuf_destroy(buf);
+ rc = pldm_msgbuf_complete(buf);
if (rc) {
return pldm_xlate_errno(rc);
}
@@ -1455,7 +1455,7 @@
pldm_msgbuf_extract_p(buf, terminus_max_buffer_size);
- rc = pldm_msgbuf_destroy_consumed(buf);
+ rc = pldm_msgbuf_complete_consumed(buf);
if (rc) {
return pldm_xlate_errno(rc);
}
@@ -1548,7 +1548,7 @@
}
if (*number_event_class_returned == 0) {
- rc = pldm_msgbuf_destroy(buf);
+ rc = pldm_msgbuf_complete(buf);
if (rc) {
return pldm_xlate_errno(rc);
}
@@ -1564,7 +1564,7 @@
pldm_msgbuf_extract(buf, event_class[i]);
}
- rc = pldm_msgbuf_destroy_consumed(buf);
+ rc = pldm_msgbuf_complete_consumed(buf);
if (rc) {
return pldm_xlate_errno(rc);
}
@@ -1631,7 +1631,7 @@
*event_class_data_offset =
sizeof(*sensor_id) + sizeof(*sensor_event_class_type);
- rc = pldm_msgbuf_destroy(buf);
+ rc = pldm_msgbuf_complete(buf);
if (rc) {
return pldm_xlate_errno(rc);
}
@@ -1662,7 +1662,7 @@
pldm_msgbuf_extract_p(buf, present_op_state);
pldm_msgbuf_extract_p(buf, previous_op_state);
- rc = pldm_msgbuf_destroy_consumed(buf);
+ rc = pldm_msgbuf_complete_consumed(buf);
if (rc) {
return pldm_xlate_errno(rc);
}
@@ -1696,7 +1696,7 @@
pldm_msgbuf_extract_p(buf, event_state);
pldm_msgbuf_extract_p(buf, previous_event_state);
- rc = pldm_msgbuf_destroy_consumed(buf);
+ rc = pldm_msgbuf_complete_consumed(buf);
if (rc) {
return pldm_xlate_errno(rc);
}
@@ -1792,7 +1792,7 @@
return PLDM_ERROR_INVALID_DATA;
}
- rc = pldm_msgbuf_destroy_consumed(buf);
+ rc = pldm_msgbuf_complete_consumed(buf);
if (rc) {
return pldm_xlate_errno(rc);
}
@@ -1893,7 +1893,7 @@
pldm_msgbuf_extract_range_field_format(
buf, pdr_value->range_field_format, pdr_value->fatal_low);
- rc = pldm_msgbuf_destroy(buf);
+ rc = pldm_msgbuf_complete(buf);
if (rc) {
return pldm_xlate_errno(rc);
}
@@ -2031,7 +2031,7 @@
pldm_msgbuf_extract_p(buf, effecter_id);
- rc = pldm_msgbuf_destroy_consumed(buf);
+ rc = pldm_msgbuf_complete_consumed(buf);
if (rc) {
return pldm_xlate_errno(rc);
}
@@ -2097,7 +2097,7 @@
pldm_msgbuf_extract_effecter_value(buf, *effecter_data_size,
present_value);
- rc = pldm_msgbuf_destroy_consumed(buf);
+ rc = pldm_msgbuf_complete_consumed(buf);
if (rc) {
return pldm_xlate_errno(rc);
}
@@ -2199,7 +2199,7 @@
*change_record_data_offset =
sizeof(*event_data_format) + sizeof(*number_of_change_records);
- rc = pldm_msgbuf_destroy(buf);
+ rc = pldm_msgbuf_complete(buf);
if (rc) {
return pldm_xlate_errno(rc);
}
@@ -2238,7 +2238,7 @@
pldm_msgbuf_extract(buf, poll_event->data_transfer_handle);
- return pldm_msgbuf_destroy_consumed(buf);
+ return pldm_msgbuf_complete_consumed(buf);
}
LIBPLDM_ABI_TESTING
@@ -2267,7 +2267,7 @@
pldm_msgbuf_insert(buf, poll_event->event_id);
pldm_msgbuf_insert(buf, poll_event->data_transfer_handle);
- return pldm_msgbuf_destroy_consumed(buf);
+ return pldm_msgbuf_complete_consumed(buf);
}
LIBPLDM_ABI_STABLE
@@ -2299,7 +2299,7 @@
*change_entry_data_offset = sizeof(*event_data_operation) +
sizeof(*number_of_change_entries);
- rc = pldm_msgbuf_destroy(buf);
+ rc = pldm_msgbuf_complete(buf);
if (rc) {
return pldm_xlate_errno(rc);
}
@@ -2389,7 +2389,7 @@
pldm_msgbuf_extract_sensor_value(buf, *sensor_data_size,
present_reading);
- rc = pldm_msgbuf_destroy_consumed(buf);
+ rc = pldm_msgbuf_complete_consumed(buf);
if (rc) {
return pldm_xlate_errno(rc);
}
@@ -2490,7 +2490,7 @@
pldm_msgbuf_extract_p(buf, sensor_id);
pldm_msgbuf_extract_p(buf, rearm_event_state);
- rc = pldm_msgbuf_destroy(buf);
+ rc = pldm_msgbuf_complete(buf);
if (rc) {
return pldm_xlate_errno(rc);
}
@@ -2564,7 +2564,7 @@
pldm_msgbuf_extract_p(buf, completion_code);
- rc = pldm_msgbuf_destroy(buf);
+ rc = pldm_msgbuf_complete(buf);
if (rc) {
return pldm_xlate_errno(rc);
}
@@ -2609,7 +2609,7 @@
pldm_msgbuf_extract_p(buf, heartbeat_timer);
}
- rc = pldm_msgbuf_destroy(buf);
+ rc = pldm_msgbuf_complete(buf);
if (rc) {
return pldm_xlate_errno(rc);
}
@@ -2694,7 +2694,7 @@
pldm_msgbuf_insert(buf, data_transfer_handle);
pldm_msgbuf_insert(buf, event_id_to_acknowledge);
- rc = pldm_msgbuf_destroy(buf);
+ rc = pldm_msgbuf_complete(buf);
if (rc) {
return pldm_xlate_errno(rc);
}
@@ -2770,7 +2770,7 @@
pldm_msgbuf_extract_p(buf, event_data_integrity_checksum);
}
- rc = pldm_msgbuf_destroy_consumed(buf);
+ rc = pldm_msgbuf_complete_consumed(buf);
if (rc) {
return pldm_xlate_errno(rc);
}
@@ -2866,7 +2866,7 @@
pldm_msgbuf_extract_range_field_format(
buf, pdr_value->range_field_format, pdr_value->rated_min);
- rc = pldm_msgbuf_destroy_consumed(buf);
+ rc = pldm_msgbuf_complete_consumed(buf);
if (rc) {
return pldm_xlate_errno(rc);
}
@@ -2908,7 +2908,7 @@
pldm_msgbuf_insert(buf, effecter_id);
- return pldm_msgbuf_destroy_consumed(buf);
+ return pldm_msgbuf_complete_consumed(buf);
}
LIBPLDM_ABI_STABLE
@@ -2933,7 +2933,7 @@
pldm_msgbuf_extract_p(buf, effecter_id);
- return pldm_msgbuf_destroy_consumed(buf);
+ return pldm_msgbuf_complete_consumed(buf);
}
LIBPLDM_ABI_STABLE
@@ -2986,7 +2986,7 @@
pldm_msgbuf_extract(buf, field->present_state);
}
- return pldm_msgbuf_destroy_consumed(buf);
+ return pldm_msgbuf_complete_consumed(buf);
}
LIBPLDM_ABI_STABLE
@@ -3039,7 +3039,7 @@
pldm_msgbuf_insert(buf, field->present_state);
}
- return pldm_msgbuf_destroy_consumed(buf);
+ return pldm_msgbuf_complete_consumed(buf);
}
LIBPLDM_ABI_STABLE
@@ -3132,7 +3132,7 @@
}
}
- rc = pldm_msgbuf_destroy_consumed(src);
+ rc = pldm_msgbuf_complete_consumed(src);
if (rc < 0) {
return rc;
}
@@ -3151,9 +3151,9 @@
pldm_msgbuf_span_string_utf16(src, NULL, NULL);
}
- if ((rc = pldm_msgbuf_destroy(dst)) ||
- (rc = pldm_msgbuf_destroy(src)) ||
- (rc = pldm_msgbuf_destroy(buf))) {
+ if ((rc = pldm_msgbuf_complete(dst)) ||
+ (rc = pldm_msgbuf_complete(src)) ||
+ (rc = pldm_msgbuf_complete(buf))) {
return rc;
}
@@ -3218,7 +3218,7 @@
pdr->names[i].tag = loc;
}
- return pldm_msgbuf_destroy_consumed(buf);
+ return pldm_msgbuf_complete_consumed(buf);
}
LIBPLDM_ABI_STABLE
@@ -3273,7 +3273,7 @@
return rc;
}
- return pldm_msgbuf_destroy_consumed(buf);
+ return pldm_msgbuf_complete_consumed(buf);
}
LIBPLDM_ABI_STABLE