[U-Boot] [PATCH] arm: zynq: Remove double const qualifier

Michal Simek michal.simek at xilinx.com
Fri Nov 10 13:07:17 UTC 2017


The patch fix these warnings:
include/fpga.h:56:24: warning: type qualifiers ignored on function
return type [-Wignored-qualifiers]
 const fpga_desc *const fpga_get_desc(int devnum);
                        ^
include/fpga.h:65:24: warning: type qualifiers ignored on function
return type [-Wignored-qualifiers]
 const fpga_desc *const fpga_validate(int devnum, const void *buf,
                        ^
drivers/fpga/fpga.c:41:24: warning: type qualifiers ignored on function
return type [-Wignored-qualifiers]
 const fpga_desc *const fpga_get_desc(int devnum)
                        ^
drivers/fpga/fpga.c:58:24: warning: type qualifiers ignored on function
return type [-Wignored-qualifiers]
 const fpga_desc *const fpga_validate(int devnum, const void *buf,
                        ^
...

Signed-off-by: Michal Simek <michal.simek at xilinx.com>
---

 common/image.c      | 2 +-
 drivers/fpga/fpga.c | 8 ++++----
 include/fpga.h      | 6 +++---
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/common/image.c b/common/image.c
index 06fdca129caf..ebab94a53a01 100644
--- a/common/image.c
+++ b/common/image.c
@@ -1234,7 +1234,7 @@ int boot_get_fpga(int argc, char * const argv[], bootm_headers_t *images,
 	const char *uname, *name;
 	int err;
 	int devnum = 0; /* TODO support multi fpga platforms */
-	const fpga_desc * const desc = fpga_get_desc(devnum);
+	const fpga_desc *desc = fpga_get_desc(devnum);
 	xilinx_desc *desc_xilinx = desc->devdesc;
 
 	/* Check to see if the images struct has a FIT configuration */
diff --git a/drivers/fpga/fpga.c b/drivers/fpga/fpga.c
index e0fb1b4e783b..af7e12e98624 100644
--- a/drivers/fpga/fpga.c
+++ b/drivers/fpga/fpga.c
@@ -38,7 +38,7 @@ static void fpga_no_sup(char *fn, char *msg)
 /* fpga_get_desc
  *	map a device number to a descriptor
  */
-const fpga_desc *const fpga_get_desc(int devnum)
+const fpga_desc *fpga_get_desc(int devnum)
 {
 	fpga_desc *desc = (fpga_desc *)NULL;
 
@@ -55,8 +55,8 @@ const fpga_desc *const fpga_get_desc(int devnum)
  * fpga_validate
  *	generic parameter checking code
  */
-const fpga_desc *const fpga_validate(int devnum, const void *buf,
-				     size_t bsize, char *fn)
+const fpga_desc *fpga_validate(int devnum, const void *buf,
+			       size_t bsize, char *fn)
 {
 	const fpga_desc *desc = fpga_get_desc(devnum);
 
@@ -77,7 +77,7 @@ const fpga_desc *const fpga_validate(int devnum, const void *buf,
 static int fpga_dev_info(int devnum)
 {
 	int ret_val = FPGA_FAIL; /* assume failure */
-	const fpga_desc * const desc = fpga_get_desc(devnum);
+	const fpga_desc *desc = fpga_get_desc(devnum);
 
 	if (desc) {
 		debug("%s: Device Descriptor @ 0x%p\n",
diff --git a/include/fpga.h b/include/fpga.h
index d768fb14171a..95e44f238dda 100644
--- a/include/fpga.h
+++ b/include/fpga.h
@@ -53,7 +53,7 @@ typedef enum {
 void fpga_init(void);
 int fpga_add(fpga_type devtype, void *desc);
 int fpga_count(void);
-const fpga_desc *const fpga_get_desc(int devnum);
+const fpga_desc *fpga_get_desc(int devnum);
 int fpga_load(int devnum, const void *buf, size_t bsize,
 	      bitstream_type bstype);
 int fpga_fsload(int devnum, const void *buf, size_t size,
@@ -62,7 +62,7 @@ int fpga_loadbitstream(int devnum, char *fpgadata, size_t size,
 		       bitstream_type bstype);
 int fpga_dump(int devnum, const void *buf, size_t bsize);
 int fpga_info(int devnum);
-const fpga_desc *const fpga_validate(int devnum, const void *buf,
-				     size_t bsize, char *fn);
+const fpga_desc *fpga_validate(int devnum, const void *buf,
+			       size_t bsize, char *fn);
 
 #endif	/* _FPGA_H_ */
-- 
1.9.1



More information about the U-Boot mailing list