[U-Boot-Users] [PATCH] Fpga: fix incorrect test of CFG_FPGA_XILINX macro

From: Grant Likely grant.likely@secretlab.ca
CFG_FPGA_XILINX is a bit value used to test against the value in CONFIG_FPGA. Testing for a value will always return TRUE. I don't think that is the intention in this code.
Signed-off-by: Grant Likely grant.likely@secretlab.ca ---
Wolfgang, this is a bug-fix only. It might be a good idea to go into 1.3.0, but all I've done is compile tested it. I don't have any hardware which is affected by this.
Cheers, g.
common/cmd_fpga.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/common/cmd_fpga.c b/common/cmd_fpga.c index 000406e..377a692 100644 --- a/common/cmd_fpga.c +++ b/common/cmd_fpga.c @@ -58,6 +58,7 @@ static int fpga_get_op (char *opstr); /* Convert bitstream data and load into the fpga */ int fpga_loadbitstream(unsigned long dev, char* fpgadata, size_t size) { +#if (CONFIG_FPGA & CFG_FPGA_XILINX) unsigned int length; unsigned char* swapdata; unsigned int swapsize; @@ -70,7 +71,6 @@ int fpga_loadbitstream(unsigned long dev, char* fpgadata, size_t size)
dataptr = (unsigned char *)fpgadata;
-#if CFG_FPGA_XILINX /* skip the first bytes of the bitsteam, their meaning is unknown */ length = (*dataptr << 8) + *(dataptr+1); dataptr+=2;

Dear Grant,
in message 20070925214558.4771.56775.stgit@trillian.cg.shawcable.net you wrote:
CFG_FPGA_XILINX is a bit value used to test against the value in CONFIG_FPGA. Testing for a value will always return TRUE. I don't think that is the intention in this code.
Signed-off-by: Grant Likely grant.likely@secretlab.ca
Wolfgang, this is a bug-fix only. It might be a good idea to go into 1.3.0, but all I've done is compile tested it. I don't have any hardware which is affected by this.
I agree, it's an obvious fix. I will pull it into 1.3.0 ASAP.
Best regards,
Wolfgang Denk
participants (2)
-
Grant Likely
-
Wolfgang Denk