Skip to content
Snippets Groups Projects
  1. May 10, 2020
  2. May 09, 2020
    • Tom Rini's avatar
      Merge branch '2020-05-08-assorted-fixes' · c5c65764
      Tom Rini authored
      c5c65764
    • Heinrich Schuchardt's avatar
      test: fix naming of test functions in the log test suite · be51c3ca
      Heinrich Schuchardt authored
      
      Both the nolog as well as the syslog tests were not found by Python
      function generate_ut_subtest() due to not following the nameing
      requirements imposed by the regular expression used to find linker
      generated list entries in file u-boot.sym.
      
      Adjust the naming of test functions.
      
      With the patch the following tests are executed successfully for
      sandbox_defconfig:
      
      test/py/tests/test_ut.py::test_ut[ut_log_syslog_debug] PASSED
      test/py/tests/test_ut.py::test_ut[ut_log_syslog_err] PASSED
      test/py/tests/test_ut.py::test_ut[ut_log_syslog_info] PASSED
      test/py/tests/test_ut.py::test_ut[ut_log_syslog_nodebug] PASSED
      test/py/tests/test_ut.py::test_ut[ut_log_syslog_notice] PASSED
      test/py/tests/test_ut.py::test_ut[ut_log_syslog_warning] PASSED
      
      The nolog tests are only executed if CONFIG_LOG=n and
      CONFIG_CONSOLE_RECORD=y.
      
      Reported-by: default avatarSimon Glass <sjg@chromium.org>
      Signed-off-by: default avatarHeinrich Schuchardt <xypron.glpk@gmx.de>
      be51c3ca
    • Heinrich Schuchardt's avatar
      test: describe naming conventions for macro UNIT_TEST · d0ba026b
      Heinrich Schuchardt authored
      
      Strict naming conventions have to be followed for Python function
      generate_ut_subtest() to collect C unit tests to be executed via
      command 'ut'.
      
      Describe the requirements both on the C as well on the Python side.
      
      Signed-off-by: default avatarHeinrich Schuchardt <xypron.glpk@gmx.de>
      Reviewed-by: default avatarStephen Warren <swarren@nvidia.com>
      Reviewed-by: default avatarSimon Glass <sjg@chromium.org>
      d0ba026b
    • Rasmus Villemoes's avatar
      env/sf.c: honour CONFIG_SPL_SAVEENV · 6d3524c2
      Rasmus Villemoes authored
      
      Deciding whether to compile the env_sf_save() function based solely on
      CONFIG_SPL_BUILD is wrong: For U-Boot proper, it leads to a build
      warning in case CONFIG_CMD_SAVEENV=n (because the initialization of
      the .save member is guarded by CONFIG_CMD_SAVEENV, while the
      env_sf_save() function is built if !CONFIG_SPL_BUILD - and even
      without the CONFIG_CMD_SAVEENV guard, the env_save_ptr() macro would
      just expand to NULL, with no reference to env_sf_save visible to the
      compiler). And for SPL, when one selects CONFIG_SPL_SAVEENV, one
      obviously expects to actually be able to save the environment.
      
      The compiler warning can be fixed by using a "<something> ?
      env_sf_save : NULL" construction instead of a macro that just eats its
      argument and expands to NULL. That way, if <something> is false,
      env_sf_save gets eliminated as dead code, but the compiler still sees
      the reference to it.
      
      For <something>, we can use CONFIG_IS_ENABLED(SAVEENV), which is true
      precisely:
      
      - For U-Boot proper, when CONFIG_CMD_SAVEENV is set (because
        CONFIG_SAVEENV is a hidden config symbol that gets set if and only
        if CONFIG_CMD_SAVEENV is set).
      - For SPL, when CONFIG_SPL_SAVEENV is set.
      
      As a bonus, this also removes quite a few preprocessor conditionals.
      
      This has been run-time tested on a mpc8309-derived board to verify
      that saving the environment does indeed work in SPL with these patches
      applied.
      
      Signed-off-by: default avatarRasmus Villemoes <rasmus.villemoes@prevas.dk>
      6d3524c2
    • Ye Li's avatar
      sata: dwc_ahsata: Fix memory issue in reset_sata · 6b6c620c
      Ye Li authored
      
      The reset_sata should reset the sata device info and free the
      probe_ent memory. Otherwise, it will cause memory leak if we
      init the sata again.
      
      Signed-off-by: default avatarYe Li <ye.li@nxp.com>
      Signed-off-by: default avatarPeng Fan <peng.fan@nxp.com>
      6b6c620c
    • Ye Li's avatar
      sata: dwc_ahsata: Fix incorrect free · cdff6fba
      Ye Li authored
      
      Fix coverity issue CID 43665: Free of address-of expression (BAD_FREE)
      incorrect_free: free frees incorrect pointer pp.
      
      pp points the port array field of struct ahci_uc_priv, should not free it.
      
      Acked-by: default avatarPeng Fan <peng.fan@nxp.com>
      Signed-off-by: default avatarYe Li <ye.li@nxp.com>
      Signed-off-by: default avatarPeng Fan <peng.fan@nxp.com>
      Reviewed-by: default avatarSimon Glass <sjg@chromium.org>
      cdff6fba
    • Ye Li's avatar
      sata: ahsata: Fix wrong operand for checking SERR DIAG_X · 87e2cb53
      Ye Li authored
      
      Fix coverity issue CID 3261683: Wrong operator used
      (CONSTANT_EXPRESSION_RESULT) operator_confusion:
      ({...; __v;}) | 67108864 is always 1/true regardless of the values
      of its operand. This occurs as the logical operand of !
      
      When DIAG_X is set, the PHY COMINIT signal is detected, so
      should use '&' to check whether it is set.
      
      Signed-off-by: default avatarYe Li <ye.li@nxp.com>
      Signed-off-by: default avatarPeng Fan <peng.fan@nxp.com>
      Reviewed-by: default avatarSimon Glass <sjg@chromium.org>
      87e2cb53
Loading