Skip to contentSkip to conversation

virtio_mmio: Use DEFINE_RES_MEM() and DEFINE_RES_IRQ() helper macros

PATCH New Zhen Lei 1 participant 1 message Jun 4, 2021 virtio core

lore
Share & tools
lore

Zhen Lei

author
#0 lore raw

PATCH 1/1 virtio_mmio: Use DEFINE_RES_MEM() and DEFINE_RES_IRQ() helper macros

Use DEFINE_RES_MEM() and DEFINE_RES_IRQ() helper macros to void some numbers appearing twice, such as the IRQ number. It makes the code a bit shorter and easier to read, although the code is completely in the comments.

---
 drivers/virtio/virtio_mmio.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)
drivers/virtio/virtio_mmio.c +2 -9
index 56128b9c46eb..3248ce46f99f 100644
@@ -16,15 +16,8 @@
  *		.id = -1,
  *		.num_resources = 2,
  *		.resource = (struct resource []) {
- *			{
- *				.start = 0x1001e000,
- *				.end = 0x1001e0ff,
- *				.flags = IORESOURCE_MEM,
- *			}, {
- *				.start = 42 + 32,
- *				.end = 42 + 32,
- *				.flags = IORESOURCE_IRQ,
- *			},
+ *			DEFINE_RES_MEM(0x1001e000, 0x100),
+ *			DEFINE_RES_IRQ(42 + 32),
  *		}
  *	};
  *
Signature · 1 line
2.25.1