Skip to contentSkip to conversation

microblaze: clean includes

PATCH In review Peter Maydell 3 participants 6 messages Jan 26, 2016 – Jan 28, 2016

lore
Share & tools
lore
#0 lore raw

cover microblaze: clean includes

I'm sending this small series separately because cleaning the microblaze files' use of includes requires a manual code fix to disas/microblaze.c. That file manually defines TRUE and FALSE, which clash with the standard defines that osdep.h will pull in. Patch 1 fixes this, and then patch 2 is the usual automated cleanup of the remaining files.

thanks
-- PMM

Peter Maydell (2):
disas/microblaze.c: Don't define TRUE or FALSE
microblaze: Clean up includes

 disas/microblaze.c                       | 5 +----
 hw/microblaze/boot.c                     | 1 +
 hw/microblaze/petalogix_ml605_mmu.c      | 1 +
 hw/microblaze/petalogix_s3adsp1800_mmu.c | 1 +
 target-microblaze/cpu.c                  | 1 +
 target-microblaze/gdbstub.c              | 2 +-
 target-microblaze/helper.c               | 1 +
 target-microblaze/mmu.c                  | 1 +
 target-microblaze/op_helper.c            | 1 +
 target-microblaze/translate.c            | 1 +
 10 files changed, 10 insertions(+), 5 deletions(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/2 disas/microblaze.c: Don't define TRUE or FALSE

Don't define TRUE and FALSE locally or manually include stdio.h; instead use osdep.h which provides them.

This is a necessary prerequisite for moving to "everywhere includes osdep.h", because otherwise there is a compile error due to the redefinition of TRUE and FALSE.

---
 disas/microblaze.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
disas/microblaze.c +1 -4
index 5d15907..91b30ac 100644
@@ -33,13 +33,10 @@ along with this program; if not, see <http://www.gnu.org/licenses/>. */
  */
 
 
-#include <stdio.h>
+#include "qemu/osdep.h"
 #define STATIC_TABLE
 #define DEFINE_TABLE
 
-#define TRUE   1
-#define FALSE  0
-
 #ifndef MICROBLAZE_OPC
 #define MICROBLAZE_OPC
 /* Assembler instructions for Xilinx's microblaze processor
Signature · 1 line
1.9.1
Reviewed-by on v1 1/2
#2 lore raw

Re: [Qemu-devel] [PATCH 1/2] disas/microblaze.c: Don't define TRUE or FALSE

Quoted 11 lines · Peter Maydell

Don't define TRUE and FALSE locally or manually include stdio.h; instead use osdep.h which provides them.

This is a necessary prerequisite for moving to "everywhere includes osdep.h", because otherwise there is a compile error due to the redefinition of TRUE and FALSE.

---
 disas/microblaze.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
Signature · 2 lines
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org
#3 lore raw

PATCH 2/2 microblaze: Clean up includes

In reply to Peter Maydell

Clean up includes so that osdep.h is included first and headers which it implies are not included manually.

This commit was created with scripts/clean-includes.

---
 hw/microblaze/boot.c                     | 1 +
 hw/microblaze/petalogix_ml605_mmu.c      | 1 +
 hw/microblaze/petalogix_s3adsp1800_mmu.c | 1 +
 target-microblaze/cpu.c                  | 1 +
 target-microblaze/gdbstub.c              | 2 +-
 target-microblaze/helper.c               | 1 +
 target-microblaze/mmu.c                  | 1 +
 target-microblaze/op_helper.c            | 1 +
 target-microblaze/translate.c            | 1 +
 9 files changed, 9 insertions(+), 1 deletion(-)
hw/microblaze/boot.c +1 -0
index d7eaa1f..26cc378 100644
@@ -24,6 +24,7 @@
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include "qemu/option.h"
 #include "qemu/config-file.h"
 #include "qemu/error-report.h"
hw/microblaze/petalogix_ml605_mmu.c +1 -0
index 3f9fa5f..85e974b 100644
@@ -25,6 +25,7 @@
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include "hw/sysbus.h"
 #include "hw/hw.h"
 #include "net/net.h"
hw/microblaze/petalogix_s3adsp1800_mmu.c +1 -0
index 1c84b75..606ba1f 100644
@@ -23,6 +23,7 @@
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include "hw/sysbus.h"
 #include "hw/hw.h"
 #include "net/net.h"
target-microblaze/cpu.c +1 -0
index 52959e1..7a42897 100644
@@ -21,6 +21,7 @@
  * <http://www.gnu.org/licenses/lgpl-2.1.html>
  */
 
+#include "qemu/osdep.h"
 #include "cpu.h"
 #include "qemu-common.h"
 #include "hw/qdev-properties.h"
target-microblaze/gdbstub.c +1 -1
index a70e2ee..89d3898 100644
@@ -17,7 +17,7 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
-#include "config.h"
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "exec/gdbstub.h"
 
target-microblaze/helper.c +1 -0
index a482e47..3b0fae8 100644
@@ -18,6 +18,7 @@
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "qemu/osdep.h"
 #include "cpu.h"
 #include "qemu/host-utils.h"
 
target-microblaze/mmu.c +1 -0
index ee95a04..4ac3040 100644
@@ -18,6 +18,7 @@
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "qemu/osdep.h"
 #include "cpu.h"
 
 #define D(x)
target-microblaze/op_helper.c +1 -0
index 5637462..9733388 100644
@@ -18,6 +18,7 @@
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "qemu/osdep.h"
 #include "cpu.h"
 #include "exec/helper-proto.h"
 #include "qemu/host-utils.h"
target-microblaze/translate.c +1 -0
index 9e52011..2e1293d 100644
@@ -18,6 +18,7 @@
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "qemu/osdep.h"
 #include "cpu.h"
 #include "disas/disas.h"
 #include "tcg-op.h"
Signature · 1 line
1.9.1
Acked-by on the v1 series
#4 lore raw
In reply to Peter Maydell
Quoted 7 lines · Peter Maydell

I'm sending this small series separately because cleaning the microblaze files' use of includes requires a manual code fix to disas/microblaze.c. That file manually defines TRUE and FALSE, which clash with the standard defines that osdep.h will pull in. Patch 1 fixes this, and then patch 2 is the usual automated cleanup of the remaining files.

Ack on both patches, thanks

Quoted 24 lines

thanks
-- PMM

Peter Maydell (2):
disas/microblaze.c: Don't define TRUE or FALSE
microblaze: Clean up includes

 disas/microblaze.c                       | 5 +----
 hw/microblaze/boot.c                     | 1 +
 hw/microblaze/petalogix_ml605_mmu.c      | 1 +
 hw/microblaze/petalogix_s3adsp1800_mmu.c | 1 +
 target-microblaze/cpu.c                  | 1 +
 target-microblaze/gdbstub.c              | 2 +-
 target-microblaze/helper.c               | 1 +
 target-microblaze/mmu.c                  | 1 +
 target-microblaze/op_helper.c            | 1 +
 target-microblaze/translate.c            | 1 +
 10 files changed, 10 insertions(+), 5 deletions(-)
Signature · 1 line
1.9.1
#5 lore raw
Quoted 10 lines · Edgar E. Iglesias
Quoted 7 lines · Peter Maydell

I'm sending this small series separately because cleaning the microblaze files' use of includes requires a manual code fix to disas/microblaze.c. That file manually defines TRUE and FALSE, which clash with the standard defines that osdep.h will pull in. Patch 1 fixes this, and then patch 2 is the usual automated cleanup of the remaining files.

Quoted 3 lines

Ack on both patches, thanks

thanks; applied to master.

-- PMM