]> git.sur5r.net Git - u-boot/blobdiff - post/cpu/mpc8xx/ether.c
fix compile warning for env tools
[u-boot] / post / cpu / mpc8xx / ether.c
index 5622cb7d2a6679ab4bdc5241ce504bf2f39b85e7..fcbb30067eee6a4a6dd5e5fdf4527477d54f74fc 100644 (file)
@@ -67,8 +67,6 @@ static int ctlr_list[][2] = { {CTLR_SCC, 1} };
 static int ctlr_list[][2] = { };
 #endif
 
-#define CTRL_LIST_SIZE (sizeof(ctlr_list) / sizeof(ctlr_list[0]))
-
 static struct {
        void (*init) (int index);
        void (*halt) (int index);
@@ -109,13 +107,20 @@ static RTXBD *rtx;
 
 static void scc_init (int scc_index)
 {
-       bd_t *bd = gd->bd;
-
-       static int proff[] =
-                       { PROFF_SCC1, PROFF_SCC2, PROFF_SCC3, PROFF_SCC4 };
-       static unsigned int cpm_cr[] =
-                       { CPM_CR_CH_SCC1, CPM_CR_CH_SCC2, CPM_CR_CH_SCC3,
-CPM_CR_CH_SCC4 };
+       uchar ea[6];
+
+       static int proff[] = {
+                               PROFF_SCC1,
+                               PROFF_SCC2,
+                               PROFF_SCC3,
+                               PROFF_SCC4,
+       };
+       static unsigned int cpm_cr[] = {
+                               CPM_CR_CH_SCC1,
+                               CPM_CR_CH_SCC2,
+                               CPM_CR_CH_SCC3,
+                               CPM_CR_CH_SCC4,
+       };
 
        int i;
        scc_enet_t *pram_ptr;
@@ -296,11 +301,10 @@ CPM_CR_CH_SCC4 };
        pram_ptr->sen_gaddr3 = 0x0;     /* Group Address Filter 3 (unused) */
        pram_ptr->sen_gaddr4 = 0x0;     /* Group Address Filter 4 (unused) */
 
-#define ea bd->bi_enetaddr
+       eth_getenv_enetaddr("ethaddr", ea);
        pram_ptr->sen_paddrh = (ea[5] << 8) + ea[4];
        pram_ptr->sen_paddrm = (ea[3] << 8) + ea[2];
        pram_ptr->sen_paddrl = (ea[1] << 8) + ea[0];
-#undef ea
 
        pram_ptr->sen_pper = 0x0;       /* Persistence (unused) */
        pram_ptr->sen_iaddr1 = 0x0;     /* Individual Address Filter 1 (unused) */
@@ -612,7 +616,7 @@ int ether_post_test (int flags)
        ctlr_proc[CTLR_SCC].send = scc_send;
        ctlr_proc[CTLR_SCC].recv = scc_recv;
 
-       for (i = 0; i < CTRL_LIST_SIZE; i++) {
+       for (i = 0; i < ARRAY_SIZE(ctlr_list); i++) {
                if (test_ctlr (ctlr_list[i][0], ctlr_list[i][1]) != 0) {
                        res = -1;
                }