Patchwork [U-Boot,v2] FPGA: constify Lattice FPGA code

login
register
mail settings
Submitter Wolfgang Denk
Date Aug. 5, 2011, 12:29 p.m.
Message ID <1312547354-20051-1-git-send-email-wd@denx.de>
Download mbox | patch
Permalink /patch/108647/
State Accepted
Headers show

Comments

Wolfgang Denk - Aug. 5, 2011, 12:29 p.m.
The Lattice code was missed by commit e6a857d "fpga: constify to fix
build warning" resulting in such warnings:

fpga.c: In function 'fpga_load':
fpga.c:238: warning: passing argument 2 of 'lattice_load' discards qualifiers from pointer target type
fpga.c: In function 'fpga_dump':
fpga.c:278: warning: passing argument 2 of 'lattice_dump' discards qualifiers from pointer target type

Signed-off-by: Wolfgang Denk <wd@denx.de>
cc: Stefano Babic <sbabic@denx.de>
---
v2:	Fix typo in Subject:

 drivers/fpga/lattice.c |    6 +++---
 include/lattice.h      |    4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)
Stefano Babic - Aug. 5, 2011, 12:55 p.m.
On 08/05/2011 02:29 PM, Wolfgang Denk wrote:
> The Lattice code was missed by commit e6a857d "fpga: constify to fix
> build warning" resulting in such warnings:
> 
> fpga.c: In function 'fpga_load':
> fpga.c:238: warning: passing argument 2 of 'lattice_load' discards qualifiers from pointer target type
> fpga.c: In function 'fpga_dump':
> fpga.c:278: warning: passing argument 2 of 'lattice_dump' discards qualifiers from pointer target type
> 
> Signed-off-by: Wolfgang Denk <wd@denx.de>
> cc: Stefano Babic <sbabic@denx.de>

Acked-by: Stefano Babic <sbabic@denx.de>

Best regards,
Stefano Babic
Stefano Babic - Aug. 30, 2011, 5:54 p.m.
On 08/05/2011 02:29 PM, Wolfgang Denk wrote:
> The Lattice code was missed by commit e6a857d "fpga: constify to fix
> build warning" resulting in such warnings:
> 
> fpga.c: In function 'fpga_load':
> fpga.c:238: warning: passing argument 2 of 'lattice_load' discards qualifiers from pointer target type
> fpga.c: In function 'fpga_dump':
> fpga.c:278: warning: passing argument 2 of 'lattice_dump' discards qualifiers from pointer target type
> 
> Signed-off-by: Wolfgang Denk <wd@denx.de>
> cc: Stefano Babic <sbabic@denx.de>

Applied to u-boot-imx (it was supposed to be merged into u-boot-imx,
right ?), thanks.

Best regards,
Stefano Babic
Wolfgang Denk - Aug. 30, 2011, 7:02 p.m.
Dear Stefano Babic,

In message <4E5D23C6.3050208@denx.de> you wrote:
> On 08/05/2011 02:29 PM, Wolfgang Denk wrote:
> > The Lattice code was missed by commit e6a857d "fpga: constify to fix
> > build warning" resulting in such warnings:
> > 
> > fpga.c: In function 'fpga_load':
> > fpga.c:238: warning: passing argument 2 of 'lattice_load' discards qualifiers from pointer target type
> > fpga.c: In function 'fpga_dump':
> > fpga.c:278: warning: passing argument 2 of 'lattice_dump' discards qualifiers from pointer target type
> > 
> > Signed-off-by: Wolfgang Denk <wd@denx.de>
> > cc: Stefano Babic <sbabic@denx.de>
> 
> Applied to u-boot-imx (it was supposed to be merged into u-boot-imx,
> right ?), thanks.

Well, actually this is generic code that has nothing to do with i.MX
so I intended to pull this myself once a little time had passed to
allow for review comments.

But now you applied it, let's keep it as is.

Best regards,

Wolfgang Denk
Wolfgang Denk - Sept. 5, 2011, 9:37 a.m.
Dear Wolfgang Denk,

In message <1312547354-20051-1-git-send-email-wd@denx.de> you wrote:
> The Lattice code was missed by commit e6a857d "fpga: constify to fix
> build warning" resulting in such warnings:
> 
> fpga.c: In function 'fpga_load':
> fpga.c:238: warning: passing argument 2 of 'lattice_load' discards qualifiers from pointer target type
> fpga.c: In function 'fpga_dump':
> fpga.c:278: warning: passing argument 2 of 'lattice_dump' discards qualifiers from pointer target type
> 
> Signed-off-by: Wolfgang Denk <wd@denx.de>
> cc: Stefano Babic <sbabic@denx.de>
> ---
> v2:	Fix typo in Subject:
> 
>  drivers/fpga/lattice.c |    6 +++---
>  include/lattice.h      |    4 ++--
>  2 files changed, 5 insertions(+), 5 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Patch

diff --git a/drivers/fpga/lattice.c b/drivers/fpga/lattice.c
index c3b2355..50d9e54 100644
--- a/drivers/fpga/lattice.c
+++ b/drivers/fpga/lattice.c
@@ -34,7 +34,7 @@ 
 #include <lattice.h>
 
 static lattice_board_specific_func *pfns;
-static char *fpga_image;
+static const char *fpga_image;
 static unsigned long read_bytes;
 static unsigned long bufsize;
 static unsigned short expectedCRC;
@@ -302,7 +302,7 @@  static int lattice_validate(Lattice_desc *desc, const char *fn)
 	return ret_val;
 }
 
-int lattice_load(Lattice_desc *desc, void *buf, size_t bsize)
+int lattice_load(Lattice_desc *desc, const void *buf, size_t bsize)
 {
 	int ret_val = FPGA_FAIL;
 
@@ -335,7 +335,7 @@  int lattice_load(Lattice_desc *desc, void *buf, size_t bsize)
 	return ret_val;
 }
 
-int lattice_dump(Lattice_desc *desc, void *buf, size_t bsize)
+int lattice_dump(Lattice_desc *desc, const void *buf, size_t bsize)
 {
 	puts("Dump not supported for Lattice FPGA\n");
 
diff --git a/include/lattice.h b/include/lattice.h
index e965663..6a2cf93 100755
--- a/include/lattice.h
+++ b/include/lattice.h
@@ -302,8 +302,8 @@  void sclock(void);
 void ispVMDelay(unsigned short int a_usMicroSecondDelay);
 void calibration(void);
 
-int lattice_load(Lattice_desc *desc, void *buf, size_t bsize);
-int lattice_dump(Lattice_desc *desc, void *buf, size_t bsize);
+int lattice_load(Lattice_desc *desc, const void *buf, size_t bsize);
+int lattice_dump(Lattice_desc *desc, const void *buf, size_t bsize);
 int lattice_info(Lattice_desc *desc);
 
 void ispVMStart(void);