qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 09/11] hw/avr/arduino: Replace magic number by gpio_port_inde


From: Richard Henderson
Subject: Re: [PATCH 09/11] hw/avr/arduino: Replace magic number by gpio_port_index() call
Date: Sat, 13 Mar 2021 14:02:13 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1

On 3/13/21 10:54 AM, Philippe Mathieu-Daudé wrote:
+static unsigned gpio_port_index(char c)
+{
+    assert(c >= 'A' && c < 'A' + GPIO_MAX);
+    return c - 'A';
+}

If you're not going to use this for anything else, isn't

#define PORT_B 1

enough?


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]