diff mbox series

hw/ppc/openpic: Do not open-code ROUND_UP() macro

Message ID 20230523061546.49031-1-philmd@linaro.org
State Superseded
Headers show
Series hw/ppc/openpic: Do not open-code ROUND_UP() macro | expand

Commit Message

Philippe Mathieu-Daudé May 23, 2023, 6:15 a.m. UTC
While reviewing, the ROUND_UP() macro is easier to figure out.
Besides, the comment confirms we want to round up here.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 include/hw/ppc/openpic.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Richard Henderson May 23, 2023, 2:45 p.m. UTC | #1
On 5/22/23 23:15, Philippe Mathieu-Daudé wrote:
> While reviewing, the ROUND_UP() macro is easier to figure out.
> Besides, the comment confirms we want to round up here.
> 
> Signed-off-by: Philippe Mathieu-Daudé<philmd@linaro.org>
> ---
>   include/hw/ppc/openpic.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~
Mark Cave-Ayland May 25, 2023, 4:08 p.m. UTC | #2
On 23/05/2023 07:15, Philippe Mathieu-Daudé wrote:

> While reviewing, the ROUND_UP() macro is easier to figure out.
> Besides, the comment confirms we want to round up here.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   include/hw/ppc/openpic.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/hw/ppc/openpic.h b/include/hw/ppc/openpic.h
> index ebdaf8a493..bae8dafe16 100644
> --- a/include/hw/ppc/openpic.h
> +++ b/include/hw/ppc/openpic.h
> @@ -55,7 +55,7 @@ typedef enum IRQType {
>    * Round up to the nearest 64 IRQs so that the queue length
>    * won't change when moving between 32 and 64 bit hosts.
>    */
> -#define IRQQUEUE_SIZE_BITS ((OPENPIC_MAX_IRQ + 63) & ~63)
> +#define IRQQUEUE_SIZE_BITS ROUND_UP(OPENPIC_MAX_IRQ, 64)
>   
>   typedef struct IRQQueue {
>       unsigned long *queue;

Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>


ATB,

Mark.
Philippe Mathieu-Daudé June 2, 2023, 9:29 a.m. UTC | #3
There is no generic PPC section in MAINTAINERS covering include/hw/ppc/,
so Cc'ing qemu-ppc@ manually.

Daniel, can you take this (reviewed) patch?

Thanks,

Phil.

On 23/5/23 08:15, Philippe Mathieu-Daudé wrote:
> While reviewing, the ROUND_UP() macro is easier to figure out.
> Besides, the comment confirms we want to round up here.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   include/hw/ppc/openpic.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/hw/ppc/openpic.h b/include/hw/ppc/openpic.h
> index ebdaf8a493..bae8dafe16 100644
> --- a/include/hw/ppc/openpic.h
> +++ b/include/hw/ppc/openpic.h
> @@ -55,7 +55,7 @@ typedef enum IRQType {
>    * Round up to the nearest 64 IRQs so that the queue length
>    * won't change when moving between 32 and 64 bit hosts.
>    */
> -#define IRQQUEUE_SIZE_BITS ((OPENPIC_MAX_IRQ + 63) & ~63)
> +#define IRQQUEUE_SIZE_BITS ROUND_UP(OPENPIC_MAX_IRQ, 64)
>   
>   typedef struct IRQQueue {
>       unsigned long *queue;
Daniel Henrique Barboza June 6, 2023, 6:34 p.m. UTC | #4
On 5/23/23 03:15, Philippe Mathieu-Daudé wrote:
> While reviewing, the ROUND_UP() macro is easier to figure out.
> Besides, the comment confirms we want to round up here.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---


Queued in gitlab.com/danielhb/qemu/tree/ppc-next. Thanks,


Daniel

>   include/hw/ppc/openpic.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/hw/ppc/openpic.h b/include/hw/ppc/openpic.h
> index ebdaf8a493..bae8dafe16 100644
> --- a/include/hw/ppc/openpic.h
> +++ b/include/hw/ppc/openpic.h
> @@ -55,7 +55,7 @@ typedef enum IRQType {
>    * Round up to the nearest 64 IRQs so that the queue length
>    * won't change when moving between 32 and 64 bit hosts.
>    */
> -#define IRQQUEUE_SIZE_BITS ((OPENPIC_MAX_IRQ + 63) & ~63)
> +#define IRQQUEUE_SIZE_BITS ROUND_UP(OPENPIC_MAX_IRQ, 64)
>   
>   typedef struct IRQQueue {
>       unsigned long *queue;
diff mbox series

Patch

diff --git a/include/hw/ppc/openpic.h b/include/hw/ppc/openpic.h
index ebdaf8a493..bae8dafe16 100644
--- a/include/hw/ppc/openpic.h
+++ b/include/hw/ppc/openpic.h
@@ -55,7 +55,7 @@  typedef enum IRQType {
  * Round up to the nearest 64 IRQs so that the queue length
  * won't change when moving between 32 and 64 bit hosts.
  */
-#define IRQQUEUE_SIZE_BITS ((OPENPIC_MAX_IRQ + 63) & ~63)
+#define IRQQUEUE_SIZE_BITS ROUND_UP(OPENPIC_MAX_IRQ, 64)
 
 typedef struct IRQQueue {
     unsigned long *queue;