[Qemu-devel] [PATCH 02/29] pci: remove superfluous parenthesis

Philippe Mathieu-Daudé posted 29 patches 8 years, 6 months ago
Only 28 patches received!
[Qemu-devel] [PATCH 02/29] pci: remove superfluous parenthesis
Posted by Philippe Mathieu-Daudé 8 years, 6 months ago
Applied using the Coccinelle semantic patch scripts/coccinelle/use_osdep.cocci

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/misc/pci-testdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/misc/pci-testdev.c b/hw/misc/pci-testdev.c
index 7d5990213e..b928ce7e84 100644
--- a/hw/misc/pci-testdev.c
+++ b/hw/misc/pci-testdev.c
@@ -63,8 +63,8 @@ static const char *iotest_type[] = {
 
 #define IOTEST_TEST(i) (iotest_test[((i) % ARRAY_SIZE(iotest_test))])
 #define IOTEST_TYPE(i) (iotest_type[((i) / ARRAY_SIZE(iotest_test))])
-#define IOTEST_MAX_TEST (ARRAY_SIZE(iotest_test))
-#define IOTEST_MAX_TYPE (ARRAY_SIZE(iotest_type))
+#define IOTEST_MAX_TEST ARRAY_SIZE(iotest_test)
+#define IOTEST_MAX_TYPE ARRAY_SIZE(iotest_type)
 #define IOTEST_MAX (IOTEST_MAX_TEST * IOTEST_MAX_TYPE)
 
 enum {
-- 
2.13.2


Re: [Qemu-devel] [PATCH 02/29] pci: remove superfluous parenthesis
Posted by Richard Henderson 8 years, 6 months ago
On 07/17/2017 08:09 PM, Philippe Mathieu-Daudé wrote:
>   #define IOTEST_TEST(i) (iotest_test[((i) % ARRAY_SIZE(iotest_test))])
>   #define IOTEST_TYPE(i) (iotest_type[((i) / ARRAY_SIZE(iotest_test))])

Looks like  array[(x)] is another candidate.

> -#define IOTEST_MAX_TEST (ARRAY_SIZE(iotest_test))
> -#define IOTEST_MAX_TYPE (ARRAY_SIZE(iotest_type))
> +#define IOTEST_MAX_TEST ARRAY_SIZE(iotest_test)
> +#define IOTEST_MAX_TYPE ARRAY_SIZE(iotest_type)


r~