Skip to contentSkip to conversation

hw/gpio/aspeed_gpio.c: Don't directly include assert.h

PATCH In review Peter Maydell 4 participants 4 messages Apr 3, 2020 – Apr 5, 2020 Arm/Aspeed machine support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/gpio/aspeed_gpio.c: Don't directly include assert.h

Remove a direct include of assert.h -- this is already provided by qemu/osdep.h, and it breaks our rule that the first include must always be osdep.h.

In particular we must get the assert() macro via osdep.h to avoid compile failures on mingw (see the comment in osdep.h where we redefine assert() for that platform).

---
Reported via a random comment on our github mirror... we should probably do a proper clean-includes run post-5.0.

 hw/gpio/aspeed_gpio.c | 2 --
 1 file changed, 2 deletions(-)
hw/gpio/aspeed_gpio.c +0 -2
index 41e11ea9b04..e52fcfd9a03 100644
@@ -6,8 +6,6 @@
  * SPDX-License-Identifier: GPL-2.0-or-later
  */
 
-#include <assert.h>
-
 #include "qemu/osdep.h"
 #include "qemu/host-utils.h"
 #include "qemu/log.h"
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Peter Maydell

Remove a direct include of assert.h -- this is already provided by qemu/osdep.h, and it breaks our rule that the first include must always be osdep.h.

Seems a leftover for debugging added between v3:
https://www.mail-archive.com/[email protected]/msg634251.html
and v4:
https://www.mail-archive.com/[email protected]/msg637329.html
since not commented in v4 cover:
https://www.mail-archive.com/[email protected]/msg637328.html

Quoted 9 lines

In particular we must get the assert() macro via osdep.h to avoid compile failures on mingw (see the comment in osdep.h where we redefine assert() for that platform).

---
Reported via a random comment on our github mirror... we should probably do a proper clean-includes run post-5.0.

Yes... Or schedule/include a pre-soft-freeze tasklist in the wiki "things to do 1month before soft-freeze".

- refresh MAINTAINERS entries
- look at what we can deprecate
- run cocci cleanup scripts

Quoted 18 lines
  hw/gpio/aspeed_gpio.c | 2 --
  1 file changed, 2 deletions(-)
hw/gpio/aspeed_gpio.c +0 -2
index 41e11ea9b04..e52fcfd9a03 100644
@@ -6,8 +6,6 @@
   * SPDX-License-Identifier: GPL-2.0-or-later
   */
 
-#include <assert.h>
-
  #include "qemu/osdep.h"
  #include "qemu/host-utils.h"
  #include "qemu/log.h"
Reviewed-by on v1 1/1
#2 lore raw
In reply to Peter Maydell
Quoted 9 lines · Peter Maydell

Remove a direct include of assert.h -- this is already provided by qemu/osdep.h, and it breaks our rule that the first include must always be osdep.h.

In particular we must get the assert() macro via osdep.h to avoid compile failures on mingw (see the comment in osdep.h where we redefine assert() for that platform).

Quoted 3 lines

---
Reported via a random comment on our github mirror... we should probably do a proper clean-includes run post-5.0.

with a 'sort' maybe.

Thanks,

C.

Quoted 18 lines
 hw/gpio/aspeed_gpio.c | 2 --
 1 file changed, 2 deletions(-)
hw/gpio/aspeed_gpio.c +0 -2
index 41e11ea9b04..e52fcfd9a03 100644
@@ -6,8 +6,6 @@
  * SPDX-License-Identifier: GPL-2.0-or-later
  */
 
-#include <assert.h>
-
 #include "qemu/osdep.h"
 #include "qemu/host-utils.h"
 #include "qemu/log.h"
Acked-by on v1 1/1
#3 lore raw
In reply to Peter Maydell
Quoted 9 lines · Peter Maydell

Remove a direct include of assert.h -- this is already provided by qemu/osdep.h, and it breaks our rule that the first include must always be osdep.h.

In particular we must get the assert() macro via osdep.h to avoid compile failures on mingw (see the comment in osdep.h where we redefine assert() for that platform).