cleanup: const definition, unused includes,...
authorSam Sortais <sam.sortais@xilinx.com>
Thu, 18 Aug 2016 00:46:28 +0000 (17:46 -0700)
committerWendy Liang <jliang@xilinx.com>
Thu, 13 Oct 2016 05:01:49 +0000 (22:01 -0700)
Signed-off-by: Sam Sortais <sam.sortais@xilinx.com>
apps/machine/zynqmp_r5/platform_info.c
apps/system/generic/machine/zynqmp_r5/helper.c
apps/system/generic/machine/zynqmp_r5/sys_init.c

index 37a49610d0cc7c97ebaf7125ec4b1c369dbe6108..0a9f8d9bad2562d4f48834c2a05c1e55983cdd68 100755 (executable)
@@ -111,4 +111,4 @@ const struct firmware_info fw_table[] =
         0}
 };
 
-int fw_table_size = sizeof(fw_table)/sizeof(struct firmware_info);
+const int fw_table_size = sizeof(fw_table)/sizeof(struct firmware_info);
index 7e775f61472a8f395c94dabd2dc4f2d67e60eca5..4ca349086feabc44a38257c5fe5e5e6e77fd7b67 100644 (file)
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  */
-#include <string.h>
+
 #include "xparameters.h"
 #include "xil_exception.h"
 #include "xscugic.h"
 #include "xil_cache.h"
 #include "metal/sys.h"
+#include "metal/irq.h"
+#include "metal/system/generic/irq.h"
+
 
 #define INTC_DEVICE_ID         XPAR_SCUGIC_0_DEVICE_ID
 /** IPI IRQ ID */
 #define IPI_IRQ_VECT_ID         65
 
-XScuGic InterruptController;
-
-extern void metal_irq_isr(unsigned int irq);
 extern int platform_register_metal_device(void);
 
-int zynqmp_r5_gic_initialize()
+static XScuGic InterruptController;
+
+
+static int zynqmp_r5_gic_initialize(void)
 {
        u32 Status;
+       XScuGic_Config *IntcConfig;     /* The configuration parameters of the interrupt controller */
 
        Xil_ExceptionDisable();
 
-       XScuGic_Config *IntcConfig;     /* The configuration parameters of the interrupt controller */
-
        /*
         * Initialize the interrupt controller driver
         */
@@ -76,6 +78,7 @@ int zynqmp_r5_gic_initialize()
                        &InterruptController);
 
        Xil_ExceptionEnable();
+
        /* Connect Interrupt ID with ISR */
        XScuGic_Connect(&InterruptController, IPI_IRQ_VECT_ID,
                           (Xil_ExceptionHandler)metal_irq_isr,
@@ -84,7 +87,7 @@ int zynqmp_r5_gic_initialize()
        return 0;
 }
 
-void init_system()
+void init_system(void)
 {
        struct metal_init_params metal_param = METAL_INIT_DEFAULTS;
 
@@ -96,6 +99,7 @@ void init_system()
 void cleanup_system()
 {
        metal_finish();
+
        Xil_DCacheDisable();
        Xil_ICacheDisable();
        Xil_DCacheInvalidate();
index fd847f1e08b56d56d42047f46bfa242f761f05a2..3c449fc8ca0874a1e22d14b3a165c7fafacf03d0 100644 (file)
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  */
-#include <string.h>
-#include "xparameters.h"
-#include "xil_exception.h"
-#include "xscugic.h"
+
 #include "metal/sys.h"
 #include "metal/device.h"
 #include "metal/io.h"
@@ -113,10 +110,12 @@ struct metal_generic_shmem shm = {
        {NULL, NULL},
 };
 
+const int metal_dev_table_sz = sizeof (metal_dev_table)/sizeof(struct metal_device);
+
+
 /**
  * This funciton is to install baremeta/RTOS libmetal devices.
  */
-extern char RPROC_DEBUG[];
 int platform_register_metal_device(void)
 {
        int i;
@@ -125,9 +124,7 @@ int platform_register_metal_device(void)
 
        /* Register device */
        metal_bus_register(&metal_generic_bus);
-       for (i = 0;
-            i < (int)(sizeof(metal_dev_table)/sizeof(struct metal_device));
-            i++) {
+        for (i = 0; i < metal_dev_table_sz; i++) {
                dev = &metal_dev_table[i];
                ret = metal_register_generic_device(dev);
                if (ret)