lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Fri, 4 Jun 2021 17:34:24 +0800
From:   Zhen Lei <thunder.leizhen@...wei.com>
To:     "Michael S . Tsirkin" <mst@...hat.com>,
        Jason Wang <jasowang@...hat.com>,
        virtualization <virtualization@...ts.linux-foundation.org>,
        linux-kernel <linux-kernel@...r.kernel.org>
CC:     Zhen Lei <thunder.leizhen@...wei.com>
Subject: [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.

Signed-off-by: Zhen Lei <thunder.leizhen@...wei.com>
---
 drivers/virtio/virtio_mmio.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c
index 56128b9c46eb..3248ce46f99f 100644
--- a/drivers/virtio/virtio_mmio.c
+++ b/drivers/virtio/virtio_mmio.c
@@ -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),
  *		}
  *	};
  *
-- 
2.25.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ