MLK-18141-1 env: sata: Fix build warning and break
authorYe Li <ye.li@nxp.com>
Fri, 23 Mar 2018 06:21:48 +0000 (23:21 -0700)
committerYe Li <ye.li@nxp.com>
Wed, 28 Apr 2021 20:49:33 +0000 (13:49 -0700)
commit669c40a712b7043480f9d7e144e67acea0e77915
tree2871036545cc11db5d066f35fc663fbce4fedd27
parentc3c050e9b0e87f275f14d87b795ec9828cf85586
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>
(cherry picked from commit ffdc4c02e0a3eb18c7fddf307887265aa97699a6)
(cherry picked from commit 25cb0daa9128f15e0da7efeea2bfc436e610648c)
env/sata.c
include/env_internal.h
include/part.h