diff options
author | Ye Li <ye.li@nxp.com> | 2018-03-22 23:21:48 -0700 |
---|---|---|
committer | Ye Li <ye.li@nxp.com> | 2018-04-26 02:26:37 -0700 |
commit | aaef173cba9912834db08d6f0194216e8fe3c6d1 (patch) | |
tree | b78d45655136267c18b94931f78e31696046dc00 | |
parent | dbb414245b73f29666622f8c07da48ac797eb848 (diff) |
MLK-18141-1 env: sata: Fix build warning and break
Fix below build warning and errors:
env/sata.c: In function ‘env_sata_save’:
env/sata.c:59:9: warning: implicit declaration of function ‘sata_get_dev’ [-Wimplicit-function-declaration]
sata = sata_get_dev(env_sata);
^~~~~~~~~~~~
env/sata.c:59:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
sata = sata_get_dev(env_sata);
^
env/sata.c: In function ‘env_sata_load’:
env/sata.c:101:10: warning: ‘return’ with a value, in function returning void
return -EIO;
^
env/sata.c:94:13: note: declared here
static void env_sata_load(void)
^~~~~~~~~~~~~
env/sata.c:105:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
sata = sata_get_dev(env_sata);
^
env/sata.c:108:10: warning: ‘return’ with a value, in function returning void
return -EIO;
^
env/sata.c:94:13: note: declared here
static void env_sata_load(void)
^~~~~~~~~~~~~
env/sata.c:113:10: warning: ‘return’ with a value, in function returning void
return -EIO;
^
env/sata.c:94:13: note: declared here
static void env_sata_load(void)
^~~~~~~~~~~~~
env/sata.c:116:9: warning: ‘return’ with a value, in function returning void
return env_import(buf, 1);
^~~~~~~~~~~~~~~~~~
env/sata.c:94:13: note: declared here
static void env_sata_load(void)
^~~~~~~~~~~~~
env/sata.c: At top level:
env/sata.c:120:14: error: ‘ENVL_ESATA’ undeclared here (not in a function)
.location = ENVL_ESATA,
^~~~~~~~~~
env/sata.c:122:11: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
.load = env_sata_load,
Signed-off-by: Ye Li <ye.li@nxp.com>
-rw-r--r-- | env/sata.c | 2 | ||||
-rw-r--r-- | include/environment.h | 1 | ||||
-rw-r--r-- | include/part.h | 2 |
3 files changed, 4 insertions, 1 deletions
diff --git a/env/sata.c b/env/sata.c index a537b22ce7b..fed799b817b 100644 --- a/env/sata.c +++ b/env/sata.c @@ -91,7 +91,7 @@ static inline int read_env(struct blk_desc *sata, unsigned long size, return (n == blk_cnt) ? 0 : -1; } -static void env_sata_load(void) +static int env_sata_load(void) { ALLOC_CACHE_ALIGN_BUFFER(char, buf, CONFIG_ENV_SIZE); struct blk_desc *sata = NULL; diff --git a/include/environment.h b/include/environment.h index 7986a242778..ec12af55c19 100644 --- a/include/environment.h +++ b/include/environment.h @@ -190,6 +190,7 @@ enum env_valid { enum env_location { ENVL_UNKNOWN, ENVL_EEPROM, + ENVL_ESATA, ENVL_EXT4, ENVL_FAT, ENVL_FLASH, diff --git a/include/part.h b/include/part.h index 0caceafc5f7..c129699bad8 100644 --- a/include/part.h +++ b/include/part.h @@ -94,6 +94,7 @@ struct disk_part { struct blk_desc *blk_get_dev(const char *ifname, int dev); struct blk_desc *mg_disk_get_dev(int dev); +struct blk_desc *sata_get_dev(int dev); int host_get_dev_err(int dev, struct blk_desc **blk_devp); /* disk/part.c */ @@ -221,6 +222,7 @@ extern const struct block_drvr block_drvr[]; static inline struct blk_desc *blk_get_dev(const char *ifname, int dev) { return NULL; } static inline struct blk_desc *mg_disk_get_dev(int dev) { return NULL; } +static inline struct blk_desc *sata_get_dev(int dev) { return NULL; } static inline int part_get_info(struct blk_desc *dev_desc, int part, disk_partition_t *info) { return -1; } |