Skip to contentSkip to conversation

hyper-v: Use UUID API for exporting the GUID

PATCH In review Andy Shevchenko 2 participants 2 messages Apr 22, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hyper-v: Use UUID API for exporting the GUID

There is export_guid() function which exports guid_t to the u8 array. Use it instead of open coding variant.

This allows to hide the uuid_t internals.

---
 drivers/hv/hv_trace.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/hv/hv_trace.h +2 -2
index a43bc76c2d5d0..579d19bdc0981 100644
@@ -286,8 +286,8 @@ TRACE_EVENT(vmbus_send_tl_connect_request,
 		    __field(int, ret)
 		    ),
 	    TP_fast_assign(
-		    memcpy(__entry->guest_id, &msg->guest_endpoint_id.b, 16);
-		    memcpy(__entry->host_id, &msg->host_service_id.b, 16);
+		    export_guid(__entry->guest_id, &msg->guest_endpoint_id);
+		    export_guid(__entry->host_id, &msg->host_service_id);
 		    __entry->ret = ret;
 		    ),
 	    TP_printk("sending guest_endpoint_id %pUl, host_service_id %pUl, "
Signature · 1 line
2.26.1
maintainer
#1 lore raw
Quoted 15 lines · Andy Shevchenko

There is export_guid() function which exports guid_t to the u8 array. Use it instead of open coding variant.

This allows to hide the uuid_t internals.

---
 drivers/hv/hv_trace.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/hv/hv_trace.h +0 -0
index a43bc76c2d5d0..579d19bdc0981 100644

drivers/hv/hv_trace.h TRACE_EVENT(vmbus_send_tl_connect_request, · line 290

Quoted 7 lines
drivers/hv/hv_trace.h +2 -2
@@ -286,8 +286,8 @@ TRACE_EVENT(vmbus_send_tl_connect_request,
 		    __field(int, ret)
 		    ),
 	    TP_fast_assign(
-		    memcpy(__entry->guest_id, &msg->guest_endpoint_id.b, 16);
-		    memcpy(__entry->host_id, &msg->host_service_id.b, 16);
+		    export_guid(__entry->guest_id, &msg->guest_endpoint_id);
+		    export_guid(__entry->host_id, &msg->host_service_id);

I was about to say I couldn't find this function but it seems to have been introduced in d01cd62400b which is currently in Linus' master branch. That's fine then.

I will queue this up to hyperv-fixes for 5.7.

Wei.

Quoted 6 lines
drivers/hv/hv_trace.h +0 -0
 		    __entry->ret = ret;
 		    ),
 	    TP_printk("sending guest_endpoint_id %pUl, host_service_id %pUl, "
Signature · 1 line
2.26.1