gdsys: Drop print_fpga_state function
PATCH 1/1 gdsys: Drop print_fpga_state function
On most platforms the print_fpga_state function is never called. Only on dlvision-10g do we, so in that case inline it. Drop it from everywhere else to avoid extra strings.
--- board/gdsys/405ep/405ep.c | 8 -------- board/gdsys/405ep/dlvision-10g.c | 5 ++++- board/gdsys/405ex/405ex.c | 8 -------- board/gdsys/mpc8308/mpc8308.c | 8 -------- include/gdsys_fpga.h | 1 - 5 files changed, 4 insertions(+), 26 deletions(-)
board/gdsys/405ep/405ep.c +0 -8
@@ -31,14 +31,6 @@ int get_fpga_state(unsigned dev)return gd->arch.fpga_state[dev]; } -void print_fpga_state (unsigned dev) -{ -if (gd->arch.fpga_state[dev] &FPGA_STATE_DONE_FAILED ) -puts (" Waiting for FPGA-DONE timed out.\n" ); -if (gd->arch.fpga_state[dev] &FPGA_STATE_REFLECTION_FAILED ) -puts (" FPGA reflection test failed.\n" ); -} -int board_early_init_f (void ) {unsigned k;
board/gdsys/405ep/dlvision-10g.c +4 -1
@@ -109,7 +109,10 @@ static void print_fpga_info(unsigned dev) && !((hardware_version == HWVER_101) && (fpga_state == FPGA_STATE_DONE_FAILED))) {puts ("not available\n" ); -print_fpga_state (dev); +if (gd->arch.fpga_state[dev] &FPGA_STATE_DONE_FAILED ) +puts (" Waiting for FPGA-DONE timed out.\n" ); +if (gd->arch.fpga_state[dev] &FPGA_STATE_REFLECTION_FAILED ) +puts (" FPGA reflection test failed.\n" );return ; }
board/gdsys/405ex/405ex.c +0 -8
@@ -24,14 +24,6 @@ int get_fpga_state(unsigned dev)return gd->arch.fpga_state[dev]; } -void print_fpga_state (unsigned dev) -{ -if (gd->arch.fpga_state[dev] &FPGA_STATE_DONE_FAILED ) -puts (" Waiting for FPGA-DONE timed out.\n" ); -if (gd->arch.fpga_state[dev] &FPGA_STATE_REFLECTION_FAILED ) -puts (" FPGA reflection test failed.\n" ); -} -int board_early_init_f (void ) {u32 val;
board/gdsys/mpc8308/mpc8308.c +0 -8
@@ -31,14 +31,6 @@ int get_fpga_state(unsigned dev)return gd->arch.fpga_state[dev]; } -void print_fpga_state (unsigned dev) -{ -if (gd->arch.fpga_state[dev] &FPGA_STATE_DONE_FAILED ) -puts (" Waiting for FPGA-DONE timed out.\n" ); -if (gd->arch.fpga_state[dev] &FPGA_STATE_REFLECTION_FAILED ) -puts (" FPGA reflection test failed.\n" ); -} -int board_early_init_f (void ) {unsigned k;
include/gdsys_fpga.h +0 -1
@@ -17,7 +17,6 @@ enum { };int get_fpga_state (unsigned dev); -void print_fpga_state (unsigned dev);int fpga_set_reg (u32 fpga,u16 *reg,off_t regoff,u16 data);int fpga_get_reg (u32 fpga,u16 *reg,off_t regoff,u16 *data);
Signature · 1 line
1.7.9.5
PATCH 1/1 gdsys: Drop print_fpga_state function
Hi Tom,
I think, Dirk had missed this message. Sorry for a late reply.
Inlining the func is basically OK.
But could you please make a little change at the inlined code (see below)?
Beside this:
Greetings,
Reinhard.
On 2016-01-14 00:12, Tom Rini wrote:
[...]
Quoted 6 lines
board/gdsys/405ep/dlvision-10g.c +0
-0
board/gdsys/405ep/dlvision-10g.c static void print_fpga_info(unsigned dev) · line 115
Quoted 8 lines
board/gdsys/405ep/dlvision-10g.c +4
-1@@ -109,7 +109,10 @@ static void print_fpga_info(unsigned dev) && !((hardware_version == HWVER_101) && (fpga_state == FPGA_STATE_DONE_FAILED))) {puts ("not available\n" ); -print_fpga_state (dev); +if (gd->arch.fpga_state[dev] &FPGA_STATE_DONE_FAILED ) +puts (" Waiting for FPGA-DONE timed out.\n" ); +if (gd->arch.fpga_state[dev] &FPGA_STATE_REFLECTION_FAILED ) +puts (" FPGA reflection test failed.\n" );
At this point the FPGA state is already available in the local var "fpga_state".
So please replace "gd->arch.fpga_state[dev]" with just "fpga_state".
Quoted 3 lines
board/gdsys/405ep/dlvision-10g.c +0
-0return ; }
[...]
PATCH 1/1 gdsys: Drop print_fpga_state function
Hi Tom,
sorry for the delay, and thanks for keeping iocon alive :)
2016-06-02 16:05 GMT+02:00 Reinhard Pfau <[email protected]>:
...
Quoted 21 lines
Quoted 6 lines
board/gdsys/405ep/dlvision-10g.c +0
-0board/gdsys/405ep/dlvision-10g.c static void print_fpga_info(unsigned dev) · line 116
Quoted 9 lines
board/gdsys/405ep/dlvision-10g.c +4
-1@@ -109,7 +109,10 @@ static void print_fpga_info(unsigned dev) && !((hardware_version == HWVER_101) && (fpga_state == FPGA_STATE_DONE_FAILED))) {puts ("not available\n" ); -print_fpga_state (dev); +if (gd->arch.fpga_state[dev] &FPGA_STATE_DONE_FAILED ) +puts (" Waiting for FPGA-DONE timed out.\n" ); +if (gd->arch.fpga_state[dev] &FPGA_STATE_REFLECTION_FAILED ) +puts (" FPGA reflection test failed.\n" );At this point the FPGA state is already available in the local var "
fpga_state".
So please replace "gd->arch.fpga_state[dev]" with just "fpga_state".
Quoted 5 lines
Quoted 3 lines
board/gdsys/405ep/dlvision-10g.c +0
-0return ; }[...]
Apart from that
PATCH 1/1 gdsys: Drop print_fpga_state function
Quoted 27 lines · Dirk Eibach
Hi Tom,
sorry for the delay, and thanks for keeping iocon alive :)
2016-06-02 16:05 GMT+02:00 Reinhard Pfau <[email protected]>:
...Quoted 21 lines
Quoted 6 lines
board/gdsys/405ep/dlvision-10g.c +0
-0board/gdsys/405ep/dlvision-10g.c static void print_fpga_info(unsigned dev) · line 116
Quoted 9 lines
board/gdsys/405ep/dlvision-10g.c +4
-1@@ -109,7 +109,10 @@ static void print_fpga_info(unsigned dev) && !((hardware_version == HWVER_101) && (fpga_state == FPGA_STATE_DONE_FAILED))) {puts ("not available\n" ); -print_fpga_state (dev); +if (gd->arch.fpga_state[dev] &FPGA_STATE_DONE_FAILED ) +puts (" Waiting for FPGA-DONE timed out.\n" ); +if (gd->arch.fpga_state[dev] &FPGA_STATE_REFLECTION_FAILED ) +puts (" FPGA reflection test failed.\n" );At this point the FPGA state is already available in the local var "
fpga_state".
So please replace "gd->arch.fpga_state[dev]" with just "fpga_state".
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
board/gdsys/405ep/dlvision-10g.c +0
-0return ; }[...]
Apart from that
Acked-by Dirk Eibach <[email protected]>
Will do, thanks guys!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160602/1a4fd503/attachment.sig>