[PATCH for-5.0] hw/gpio/aspeed_gpio.c: Don't directly include assert.h

Peter Maydell posted 1 patch 4 years, 1 month ago
Test docker-quick@centos7 passed
Test docker-mingw@fedora passed
Test FreeBSD passed
Test checkpatch passed
Test asan passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200403124712.24826-1-peter.maydell@linaro.org
Maintainers: Peter Maydell <peter.maydell@linaro.org>, "Cédric Le Goater" <clg@kaod.org>, Joel Stanley <joel@jms.id.au>, Andrew Jeffery <andrew@aj.id.au>
hw/gpio/aspeed_gpio.c | 2 --
1 file changed, 2 deletions(-)
[PATCH for-5.0] hw/gpio/aspeed_gpio.c: Don't directly include assert.h
Posted by Peter Maydell 4 years, 1 month ago
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).

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
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(-)

diff --git a/hw/gpio/aspeed_gpio.c b/hw/gpio/aspeed_gpio.c
index 41e11ea9b04..e52fcfd9a03 100644
--- a/hw/gpio/aspeed_gpio.c
+++ b/hw/gpio/aspeed_gpio.c
@@ -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"
-- 
2.20.1


Re: [PATCH for-5.0] hw/gpio/aspeed_gpio.c: Don't directly include assert.h
Posted by Andrew Jeffery 4 years, 1 month ago

On Fri, 3 Apr 2020, at 23:17, Peter Maydell wrote:
> 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).
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Acked-by: Andrew Jeffery <andrew@aj.id.au>

Re: [PATCH for-5.0] hw/gpio/aspeed_gpio.c: Don't directly include assert.h
Posted by Cédric Le Goater 4 years, 1 month ago
On 4/3/20 2:47 PM, Peter Maydell wrote:
> 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).
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Reviewed-by: Cédric Le Goater <clg@kaod.org>

> ---
> 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. 

> 
>  hw/gpio/aspeed_gpio.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/hw/gpio/aspeed_gpio.c b/hw/gpio/aspeed_gpio.c
> index 41e11ea9b04..e52fcfd9a03 100644
> --- a/hw/gpio/aspeed_gpio.c
> +++ b/hw/gpio/aspeed_gpio.c
> @@ -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"
> 


Re: [PATCH for-5.0] hw/gpio/aspeed_gpio.c: Don't directly include assert.h
Posted by Philippe Mathieu-Daudé 4 years, 1 month ago
On 4/3/20 2:47 PM, Peter Maydell wrote:
> 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/qemu-devel@nongnu.org/msg634251.html
and v4:
https://www.mail-archive.com/qemu-devel@nongnu.org/msg637329.html
since not commented in v4 cover:
https://www.mail-archive.com/qemu-devel@nongnu.org/msg637328.html

> 
> 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).
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> 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

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

> 
>   hw/gpio/aspeed_gpio.c | 2 --
>   1 file changed, 2 deletions(-)
> 
> diff --git a/hw/gpio/aspeed_gpio.c b/hw/gpio/aspeed_gpio.c
> index 41e11ea9b04..e52fcfd9a03 100644
> --- a/hw/gpio/aspeed_gpio.c
> +++ b/hw/gpio/aspeed_gpio.c
> @@ -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"
>