Skip to contentSkip to conversation

Use PCI_VENDOR_ID_MICROSOFT define instead of magic number

PATCH New Easwar Hariharan 3 participants 5 messages Sep 19, 2022 – Sep 23, 2022

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

PATCH 1/1 Use PCI_VENDOR_ID_MICROSOFT define instead of magic number

From: Easwar Hariharan <[email protected]>

pci_ids.h already defines PCI_VENDOR_ID_MICROSOFT, and is included via linux/pci.h. Use the define instead of the magic number.

base-commit: f0880e2cb7e1f8039a048fdd01ce45ab77247221

Easwar Hariharan (1):
hv: Use PCI_VENDOR_ID_MICROSOFT for better discoverability

 drivers/hv/vmbus_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 1/1 hv: Use PCI_VENDOR_ID_MICROSOFT for better discoverability

From: Easwar Hariharan <[email protected]>

pci_ids.h already defines PCI_VENDOR_ID_MICROSOFT, and is included via linux/pci.h. Use the define instead of the magic number.

---
 drivers/hv/vmbus_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hv/vmbus_drv.c +1 -1
index 3c833ea..f2efb74 100644
@@ -2052,7 +2052,7 @@ struct hv_device *vmbus_device_create(const guid_t *type,
 	child_device_obj->channel = channel;
 	guid_copy(&child_device_obj->dev_type, type);
 	guid_copy(&child_device_obj->dev_instance, instance);
-	child_device_obj->vendor_id = 0x1414; /* MSFT vendor ID */
+	child_device_obj->vendor_id = PCI_VENDOR_ID_MICROSOFT;
 
 	return child_device_obj;
 }
Signature · 1 line
1.8.3.1
Reviewed-by on v1 1/1
#2 lore raw

RE: [PATCH] hv: Use PCI_VENDOR_ID_MICROSOFT for better discoverability

From: Easwar Hariharan <[email protected]> Sent: Monday, September 19, 2022 3:05 PM

Quoted 23 lines

pci_ids.h already defines PCI_VENDOR_ID_MICROSOFT, and is included via linux/pci.h. Use the define instead of the magic number.

---
 drivers/hv/vmbus_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hv/vmbus_drv.c +1 -2
index 3c833ea..f2efb74 100644
@@ -2052,7 +2052,7 @@ struct hv_device *vmbus_device_create(const guid_t *type,
 	child_device_obj->channel = channel;
 	guid_copy(&child_device_obj->dev_type, type);
 	guid_copy(&child_device_obj->dev_instance, instance);
-	child_device_obj->vendor_id = 0x1414; /* MSFT vendor ID */
+	child_device_obj->vendor_id = PCI_VENDOR_ID_MICROSOFT;
 
 	return child_device_obj;
 }
--
Quoted 1 line

1.8.3.1

#3 lore raw

RE: [PATCH] hv: Use PCI_VENDOR_ID_MICROSOFT for better discoverability

From: Michael Kelley (LINUX) <[email protected]> Sent: Thursday, September 22, 2022 3:39 PM

Quoted 24 lines

From: Easwar Hariharan <[email protected]> Sent: Monday, September 19, 2022 3:05 PM

drivers/hv/vmbus_drv.c struct hv_device *vmbus_device_create(const guid_t

Quoted 14 lines

pci_ids.h already defines PCI_VENDOR_ID_MICROSOFT, and is included via linux/pci.h. Use the define instead of the magic number.

---
 drivers/hv/vmbus_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hv/vmbus_drv.c +0 -0
index 3c833ea..f2efb74 100644
@@ -2052,7 +2052,7 @@ struct hv_device *vmbus_device_create(const guid_t

*type,

Quoted 6 lines
drivers/hv/vmbus_drv.c +1 -1
 	child_device_obj->channel = channel;
 	guid_copy(&child_device_obj->dev_type, type);
 	guid_copy(&child_device_obj->dev_instance, instance);
-	child_device_obj->vendor_id = 0x1414; /* MSFT vendor ID */
+	child_device_obj->vendor_id = PCI_VENDOR_ID_MICROSOFT;
 
Quoted 6 lines
Quoted 4 lines
drivers/hv/vmbus_drv.c +0 -1
 	return child_device_obj;
 }
--

1.8.3.1

Actually, a nit: The short commit message should start with "Drivers: hv:" or "Drivers: hv: vmbus:". Check the commit history on vmbus_drv.c and you'll see the standard usage.

Michael

maintainer
#4 lore raw

Re: [PATCH] hv: Use PCI_VENDOR_ID_MICROSOFT for better discoverability

Quoted 32 lines · Michael Kelley (LINUX)

From: Michael Kelley (LINUX) <[email protected]> Sent: Thursday, September 22, 2022 3:39 PM

Quoted 24 lines

From: Easwar Hariharan <[email protected]> Sent: Monday, September 19, 2022 3:05 PM

drivers/hv/vmbus_drv.c struct hv_device *vmbus_device_create(const guid_t

Quoted 14 lines

pci_ids.h already defines PCI_VENDOR_ID_MICROSOFT, and is included via linux/pci.h. Use the define instead of the magic number.

---
 drivers/hv/vmbus_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hv/vmbus_drv.c +0 -0
index 3c833ea..f2efb74 100644
@@ -2052,7 +2052,7 @@ struct hv_device *vmbus_device_create(const guid_t

*type,

Quoted 6 lines
drivers/hv/vmbus_drv.c +1 -1
 	child_device_obj->channel = channel;
 	guid_copy(&child_device_obj->dev_type, type);
 	guid_copy(&child_device_obj->dev_instance, instance);
-	child_device_obj->vendor_id = 0x1414; /* MSFT vendor ID */
+	child_device_obj->vendor_id = PCI_VENDOR_ID_MICROSOFT;
 
Quoted 6 lines
Quoted 4 lines
drivers/hv/vmbus_drv.c +0 -1
 	return child_device_obj;
 }
--

1.8.3.1

Quoted 3 lines

Actually, a nit: The short commit message should start with "Drivers: hv:" or "Drivers: hv: vmbus:". Check the commit history on vmbus_drv.c and you'll see the standard usage.

I fixed up the commit message and applied it to hyperv-next. Thanks.

Quoted 3 lines

Michael