Skip to content
Snippets Groups Projects
  1. Dec 04, 2020
    • Simon Glass's avatar
      env: Allow returning errors from hdelete_r() · 96434a76
      Simon Glass authored and Tom Rini's avatar Tom Rini committed
      
      At present this function returns 1 on success and 0 on failure. But in
      the latter case it provides no indication of what went wrong.
      
      If an attempt is made to delete a non-existent variable, the caller may
      want to ignore this error. This happens when setting a non-existent
      variable to "", for example.
      
      Update the function to return 0 on success and a useful error code on
      failure. Add a function comment too.
      
      Make sure that env_set() does not return an error if it is deleting a
      variable that doesn't exist. We could update env_set() to return useful
      error numbers also, but that is beyond the scope of this change.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      
      wip
      96434a76
  2. May 19, 2020
  3. May 18, 2020
    • Simon Glass's avatar
      command: Remove the cmd_tbl_t typedef · 09140113
      Simon Glass authored and Tom Rini's avatar Tom Rini committed
      
      We should not use typedefs in U-Boot. They cannot be used as forward
      declarations which means that header files must include the full header to
      access them.
      
      Drop the typedef and rename the struct to remove the _s suffix which is
      now not useful.
      
      This requires quite a few header-file additions.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      09140113
  4. Jan 07, 2020
    • Philippe Reynes's avatar
      cmd_ut: add a parameter prefix to the function cmd_ut_category · 4ad4edfe
      Philippe Reynes authored and Tom Rini's avatar Tom Rini committed
      
      There is black magic in the file conftest.py that list
      all the test unit. Then, all those test unit are called
      in pytest. This call is done with the end of the name
      (for example checksum if the full name is bloblist_test_checksum).
      
      The result is that only test for dm are really executed.
      by pytest, all others tests are listed but never executed.
      
      This behaviour happens because the dm test unit only check
      the end of the name and others tests checks the full name.
      
      To fix this issue, I've added a prefix to the function
      cmd_ut_category, and this prefix is removed when looking
      for the unit test.
      
      Signed-off-by: default avatarPhilippe Reynes <philippe.reynes@softathome.com>
      Tested-by: Heinrich Schuchardt's avatarHeinrich Schuchardt <xypron.glpk@gmx.de>
      4ad4edfe
  5. Aug 11, 2019
    • Simon Glass's avatar
      env: Drop the ACTION typedef · 3f0d6807
      Simon Glass authored and Tom Rini's avatar Tom Rini committed
      
      Avoid using a typedef here which is unnecessary. Add an 'env_' prefix to
      both the enum and its members to make it clear that these are related to
      the environment.
      
      Add an ENV prefix to these two flags so that it is clear what they relate
      to. Also move them to env.h since they are part of the public API. Use an
      enum rather than a #define to tie them together.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      3f0d6807
    • Simon Glass's avatar
      env: Drop the ENTRY typedef · dd2408ca
      Simon Glass authored and Tom Rini's avatar Tom Rini committed
      
      U-Boot is not supposed to use typedef for structs anymore. Also this name
      is the same as the ENTRY() macro used in assembler files, and 'entry'
      itself is widely used in U-Boot (>8k matches).
      
      Drop the typedef and rename the struct to env_entry to reduce confusion.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      Acked-by: Joe Hershberger's avatarJoe Hershberger <joe.hershberger@ni.com>
      dd2408ca
  6. Apr 24, 2019
  7. Feb 09, 2019
    • Roman Kapl's avatar
      hashtable: fix environment variable corruption · 9dfdbd9f
      Roman Kapl authored and Tom Rini's avatar Tom Rini committed
      
      Only first previously deleted entry was recognized, leading hsearch_r
      to think that there was no previously deleted entry. It then conluded
      that a free entry was found, even if there were no free entries and it
      overwrote a random entry.
      
      This patch makes sure all deleted or free entries are always found and
      also introduces constants for the 0 and -1 numbers. Unit tests to excersise a
      simple hash table usage and catch the corruption were added.
      
      To trash your environment, simply run this loop:
      
      setenv i 0
      while true; do
          setenv v_$i $i
          setenv v_$i
          setexpr i $i + 1
      done
      
      Signed-off-by: default avatarRoman Kapl <rka@sysgo.com>
      9dfdbd9f
  8. May 07, 2018
    • Tom Rini's avatar
      SPDX: Convert all of our single license tags to Linux Kernel style · 83d290c5
      Tom Rini authored
      
      When U-Boot started using SPDX tags we were among the early adopters and
      there weren't a lot of other examples to borrow from.  So we picked the
      area of the file that usually had a full license text and replaced it
      with an appropriate SPDX-License-Identifier: entry.  Since then, the
      Linux Kernel has adopted SPDX tags and they place it as the very first
      line in a file (except where shebangs are used, then it's second line)
      and with slightly different comment styles than us.
      
      In part due to community overlap, in part due to better tag visibility
      and in part for other minor reasons, switch over to that style.
      
      This commit changes all instances where we have a single declared
      license in the tag as both the before and after are identical in tag
      contents.  There's also a few places where I found we did not have a tag
      and have introduced one.
      
      Signed-off-by: default avatarTom Rini <trini@konsulko.com>
      83d290c5
  9. Dec 02, 2017
  10. May 21, 2015
Loading