Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1267568

[PATCH V2 03/12] Drivers: hv: vmbus: Use uuid_le_cmp() for comparing GUIDs

From "K. Y. Srinivasan" <kys@microsoft.com>
Newsgroups linux.kernel
Subject [PATCH V2 03/12] Drivers: hv: vmbus: Use uuid_le_cmp() for comparing GUIDs
Date 2015-11-12 02:00 +0100
Message-ID <qtOp4-1Nx-33@gated-at.bofh.it> (permalink)
References <qtOp3-1Nx-5@gated-at.bofh.it> <qtOp3-1Nx-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Use uuid_le_cmp() for comparing GUIDs.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
	V2: Fixed the typo in both the commit log and Subject line.

 drivers/hv/channel_mgmt.c |    3 +--
 drivers/hv/vmbus_drv.c    |    4 ++--
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
index 38470aa..dc4fb0b 100644
--- a/drivers/hv/channel_mgmt.c
+++ b/drivers/hv/channel_mgmt.c
@@ -408,8 +408,7 @@ static void init_vp_index(struct vmbus_channel *channel, const uuid_le *type_gui
 	struct cpumask *alloced_mask;
 
 	for (i = IDE; i < MAX_PERF_CHN; i++) {
-		if (!memcmp(type_guid->b, &hp_devs[i].guid,
-				 sizeof(uuid_le))) {
+		if (!uuid_le_cmp(*type_guid, hp_devs[i].guid)) {
 			perf_chn = true;
 			break;
 		}
diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index 7078b5f..9e0e25c 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -533,7 +533,7 @@ static const uuid_le null_guid;
 
 static inline bool is_null_guid(const uuid_le *guid)
 {
-	if (memcmp(guid, &null_guid, sizeof(uuid_le)))
+	if (uuid_le_cmp(*guid, null_guid))
 		return false;
 	return true;
 }
@@ -547,7 +547,7 @@ static const struct hv_vmbus_device_id *hv_vmbus_get_id(
 					const uuid_le *guid)
 {
 	for (; !is_null_guid(&id->guid); id++)
-		if (!memcmp(&id->guid, guid, sizeof(uuid_le)))
+		if (!uuid_le_cmp(id->guid, *guid))
 			return id;
 
 	return NULL;
-- 
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH V2 00/12] Drivers: hv: vmbus: Miscellaneous fixes and cleanup  "K. Y. Srinivasan" <kys@microsoft.com> - 2015-11-12 02:00 +0100
  [PATCH V2 01/12] Drivers: hv: vss: run only on supported host versions "K. Y. Srinivasan" <kys@microsoft.com> - 2015-11-12 02:00 +0100
    [PATCH V2 03/12] Drivers: hv: vmbus: Use uuid_le_cmp() for comparing GUIDs "K. Y. Srinivasan" <kys@microsoft.com> - 2015-11-12 02:00 +0100
    [PATCH V2 10/12] Drivers: hv: vmbus: channge vmbus_connection.channel_lock to mutex "K. Y. Srinivasan" <kys@microsoft.com> - 2015-11-12 02:00 +0100
      Re: [PATCH V2 10/12] Drivers: hv: vmbus: channge vmbus_connection.channel_lock to mutex Vitaly Kuznetsov <vkuznets@redhat.com> - 2015-11-12 11:50 +0100
    [PATCH 12/12] tools/hv: Use include/uapi with __EXPORTED_HEADERS__ "K. Y. Srinivasan" <kys@microsoft.com> - 2015-11-12 02:00 +0100

csiph-web