mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-11 07:24:46 +00:00
fpga: Avoid ignored-qualifiers warning
Fixes annoying warnings of the following type when built with W=1 (for each file including fpga.h): CC drivers/fpga/fpga.o In file included from /mnt/data/adahl/src/u-boot/include/xilinx.h:7, from /mnt/data/adahl/src/u-boot/drivers/fpga/fpga.c:10: /mnt/data/adahl/src/u-boot/include/fpga.h:61:1: warning: type qualifiers ignored on function return type [-Wignored-qualifiers] 61 | const fpga_desc *const fpga_get_desc(int devnum); | ^~~~~ /mnt/data/adahl/src/u-boot/include/fpga.h:81:1: warning: type qualifiers ignored on function return type [-Wignored-qualifiers] 81 | const fpga_desc *const fpga_validate(int devnum, const void *buf, | ^~~~~ /mnt/data/adahl/src/u-boot/drivers/fpga/fpga.c:36:1: warning: type qualifiers ignored on function return type [-Wignored-qualifiers] 36 | const fpga_desc *const fpga_get_desc(int devnum) | ^~~~~ /mnt/data/adahl/src/u-boot/drivers/fpga/fpga.c:53:1: warning: type qualifiers ignored on function return type [-Wignored-qualifiers] 53 | const fpga_desc *const fpga_validate(int devnum, const void *buf, | ^~~~~ Do some type and cast cleanup on that fpga_desc type while at it. Link: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wignored-qualifiers Signed-off-by: Alexander Dahl <ada@thorsis.com> Link: https://lore.kernel.org/r/20250121162213.1477506-1-ada@thorsis.com Signed-off-by: Michal Simek <michal.simek@amd.com>
This commit is contained in:
parent
c4a7112536
commit
135d2926d2
2 changed files with 10 additions and 10 deletions
|
@ -33,9 +33,9 @@ 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;
|
||||
const fpga_desc *desc = NULL;
|
||||
|
||||
if ((devnum >= 0) && (devnum < next_desc)) {
|
||||
desc = &desc_table[devnum];
|
||||
|
@ -50,8 +50,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);
|
||||
|
||||
|
@ -60,7 +60,7 @@ const fpga_desc *const fpga_validate(int devnum, const void *buf,
|
|||
|
||||
if (!buf) {
|
||||
printf("%s: Null buffer.\n", fn);
|
||||
return (fpga_desc * const)NULL;
|
||||
return NULL;
|
||||
}
|
||||
return desc;
|
||||
}
|
||||
|
@ -72,7 +72,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",
|
||||
|
@ -374,7 +374,7 @@ int fpga_info(int devnum)
|
|||
#if CONFIG_IS_ENABLED(FPGA_LOAD_SECURE)
|
||||
int fpga_compatible2flag(int devnum, const char *compatible)
|
||||
{
|
||||
const fpga_desc * const desc = fpga_get_desc(devnum);
|
||||
const fpga_desc *desc = fpga_get_desc(devnum);
|
||||
|
||||
if (!desc)
|
||||
return 0;
|
||||
|
|
|
@ -58,7 +58,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_is_partial_data(int devnum, size_t img_len);
|
||||
#if CONFIG_IS_ENABLED(FPGA)
|
||||
int fpga_load(int devnum, const void *buf, size_t bsize,
|
||||
|
@ -78,8 +78,8 @@ 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);
|
||||
int fpga_compatible2flag(int devnum, const char *compatible);
|
||||
|
||||
#endif /* _FPGA_H_ */
|
||||
|
|
Loading…
Add table
Reference in a new issue