You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by gn...@apache.org on 2020/04/22 20:07:14 UTC

[incubator-nuttx] branch master updated (02ab0cd -> 048d495)

This is an automated email from the ASF dual-hosted git repository.

gnutt pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git.


    from 02ab0cd  stm32: Fix typos, wrong comments, and nxstyle.
     new 7ddf7c6  binfmt: nxstyle fixes
     new e6b47ea  video: videomode: nxstyle cleanup
     new 048d495  crypto: nxstyle fixes

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 binfmt/binfmt.h                    |   7 +-
 binfmt/binfmt_copyargv.c           |  12 +-
 binfmt/binfmt_dumpmodule.c         |   4 +-
 binfmt/binfmt_execsymtab.c         |   3 +-
 binfmt/binfmt_globals.c            |   7 +-
 binfmt/elf.c                       |   4 +-
 binfmt/libelf/libelf.h             |  17 +-
 binfmt/libelf/libelf_sections.c    |   4 +-
 binfmt/libelf/libelf_symbols.c     |   4 +-
 binfmt/nxflat.c                    |   4 +-
 crypto/aes.c                       | 354 +++++++++++++++++++++++++++----------
 crypto/blake2s.c                   |  37 ++--
 crypto/cryptodev.c                 |  19 +-
 crypto/testmngr.c                  |   4 +-
 video/videomode/edid_dump.c        |   6 +-
 video/videomode/edid_parse.c       |  26 +--
 video/videomode/videomode_dump.c   |   8 +-
 video/videomode/videomode_lookup.c | 276 +++++++++++++++++++----------
 video/videomode/videomode_sort.c   |   6 +-
 19 files changed, 553 insertions(+), 249 deletions(-)


[incubator-nuttx] 01/03: binfmt: nxstyle fixes

Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gnutt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 7ddf7c6c25d620fe491dfafbc7397d4aa4861419
Author: Alin Jerpelea <al...@sony.com>
AuthorDate: Wed Apr 22 10:24:15 2020 +0200

    binfmt: nxstyle fixes
    
    small nxstyle fixes for binfmt to avoid CI warnings
    
    Signed-off-by: Alin Jerpelea <al...@sony.com>
---
 binfmt/binfmt.h                 |  7 ++++---
 binfmt/binfmt_copyargv.c        | 12 ++++++++----
 binfmt/binfmt_dumpmodule.c      |  4 +++-
 binfmt/binfmt_execsymtab.c      |  3 ++-
 binfmt/binfmt_globals.c         |  7 ++++---
 binfmt/elf.c                    |  4 ++--
 binfmt/libelf/libelf.h          | 17 +++++++++--------
 binfmt/libelf/libelf_sections.c |  4 +++-
 binfmt/libelf/libelf_symbols.c  |  4 +++-
 binfmt/nxflat.c                 |  4 ++--
 10 files changed, 40 insertions(+), 26 deletions(-)

diff --git a/binfmt/binfmt.h b/binfmt/binfmt.h
index 48218a8..d26bd31 100644
--- a/binfmt/binfmt.h
+++ b/binfmt/binfmt.h
@@ -61,9 +61,10 @@ extern "C"
 #define EXTERN extern
 #endif
 
-/* This is a list of registered handlers for different binary formats.  This
- * list should only be accessed by normal user programs.  It should be sufficient
- * protection to simply disable pre-emption when accessing this list.
+/* This is a list of registered handlers for different binary formats.
+ * This list should only be accessed by normal user programs.  It should be
+ * sufficient protection to simply disable pre-emption when accessing this
+ * list.
  */
 
 EXTERN FAR struct binfmt_s *g_binfmts;
diff --git a/binfmt/binfmt_copyargv.c b/binfmt/binfmt_copyargv.c
index cb1e91f..15c0f20 100644
--- a/binfmt/binfmt_copyargv.c
+++ b/binfmt/binfmt_copyargv.c
@@ -103,19 +103,23 @@ int binfmt_copyargv(FAR struct binary_s *bin, FAR char * const *argv)
 
       for (i = 0; argv[i]; i++)
         {
-          /* Increment the size of the allocation with the size of the next string */
+          /* Increment the size of the allocation with the size of the next
+           * string
+           */
 
           argsize += (strlen(argv[i]) + 1);
           nargs++;
 
-          /* This is a sanity check to prevent running away with an unterminated
-           * argv[] list.  MAX_EXEC_ARGS should be sufficiently large that this
+          /* This is a sanity check to prevent running away with an
+           * unterminated argv[] list.
+           * MAX_EXEC_ARGS should be sufficiently large that this
            * never happens in normal usage.
            */
 
           if (nargs > MAX_EXEC_ARGS)
             {
-              berr("ERROR: Too many arguments: %lu\n", (unsigned long)argvsize);
+              berr("ERROR: Too many arguments: %lu\n",
+                   (unsigned long)argvsize);
               return -E2BIG;
             }
         }
diff --git a/binfmt/binfmt_dumpmodule.c b/binfmt/binfmt_dumpmodule.c
index 1f35bc1..c10621b 100644
--- a/binfmt/binfmt_dumpmodule.c
+++ b/binfmt/binfmt_dumpmodule.c
@@ -75,7 +75,9 @@ int dump_module(FAR const struct binary_s *bin)
       binfo("  argv:      %p\n", bin->argv);
       binfo("  entrypt:   %p\n", bin->entrypt);
       binfo("  mapped:    %p size=%d\n", bin->mapped, bin->mapsize);
-      binfo("  alloc:     %p %p %p\n", bin->alloc[0], bin->alloc[1], bin->alloc[2]);
+      binfo("  alloc:     %p %p %p\n", bin->alloc[0],
+                                       bin->alloc[1],
+                                       bin->alloc[2]);
 #ifdef CONFIG_BINFMT_CONSTRUCTORS
       binfo("  ctors:     %p nctors=%d\n", bin->ctors, bin->nctors);
       binfo("  dtors:     %p ndtors=%d\n", bin->dtors, bin->ndtors);
diff --git a/binfmt/binfmt_execsymtab.c b/binfmt/binfmt_execsymtab.c
index d2e047f..89ac17b 100644
--- a/binfmt/binfmt_execsymtab.c
+++ b/binfmt/binfmt_execsymtab.c
@@ -97,7 +97,8 @@ static int g_exec_nsymbols;
  *
  * Input Parameters:
  *   symtab - The location to store the symbol table.
- *   nsymbols - The location to store the number of symbols in the symbol table.
+ *   nsymbols - The location to store the number of symbols in the symbol
+ *   table.
  *
  * Returned Value:
  *   None
diff --git a/binfmt/binfmt_globals.c b/binfmt/binfmt_globals.c
index ea01ab0..39c91f0 100644
--- a/binfmt/binfmt_globals.c
+++ b/binfmt/binfmt_globals.c
@@ -51,9 +51,10 @@
  * Public Data
  ****************************************************************************/
 
-/* This is a list of registered handlers for different binary formats.  This
- * list should only be accessed by normal user programs.  It should be sufficient
- * protection to simply disable pre-emption when accessing this list.
+/* This is a list of registered handlers for different binary formats.
+ * This list should only be accessed by normal user programs.  It should be
+ * sufficient protection to simply disable pre-emption when accessing this
+ * list.
  */
 
 FAR struct binfmt_s *g_binfmts;
diff --git a/binfmt/elf.c b/binfmt/elf.c
index 66632d7..a42b794 100644
--- a/binfmt/elf.c
+++ b/binfmt/elf.c
@@ -57,8 +57,8 @@
  * Pre-processor Definitions
  ****************************************************************************/
 
-/* CONFIG_DEBUG_FEATURES, CONFIG_DEBUG_INFO, and CONFIG_DEBUG_BINFMT have to be
- * defined or CONFIG_ELF_DUMPBUFFER does nothing.
+/* CONFIG_DEBUG_FEATURES, CONFIG_DEBUG_INFO, and CONFIG_DEBUG_BINFMT
+ * have to be defined or CONFIG_ELF_DUMPBUFFER does nothing.
  */
 
 #if !defined(CONFIG_DEBUG_INFO) || !defined (CONFIG_DEBUG_BINFMT)
diff --git a/binfmt/libelf/libelf.h b/binfmt/libelf/libelf.h
index 4190829..ecde4a1 100644
--- a/binfmt/libelf/libelf.h
+++ b/binfmt/libelf/libelf.h
@@ -169,8 +169,8 @@ int elf_readsym(FAR struct elf_loadinfo_s *loadinfo, int index,
  *   0 (OK) is returned on success and a negated errno is returned on
  *   failure.
  *
- *   EINVAL - There is something inconsistent in the symbol table (should only
- *            happen if the file is corrupted)
+ *   EINVAL - There is something inconsistent in the symbol table (should
+ *            only happen if the file is corrupted)
  *   ENOSYS - Symbol lies in common
  *   ESRCH  - Symbol has no name
  *   ENOENT - Symbol undefined and not provided via a symbol table
@@ -265,12 +265,13 @@ int elf_loaddtors(FAR struct elf_loadinfo_s *loadinfo);
  * Name: elf_addrenv_alloc
  *
  * Description:
- *   Allocate memory for the ELF image (textalloc and dataalloc). If
- *   CONFIG_ARCH_ADDRENV=n, textalloc will be allocated using kmm_zalloc() and
- *   dataalloc will be a offset from textalloc.  If CONFIG_ARCH_ADDRENV-y, then
- *   textalloc and dataalloc will be allocated using up_addrenv_create().  In
- *   either case, there will be a unique instance of textalloc and dataalloc
- *   (and stack) for each instance of a process.
+ *   Allocate memory for the ELF image (textalloc and dataalloc).
+ *   If CONFIG_ARCH_ADDRENV=n, textalloc will be allocated using kmm_zalloc()
+ *   and dataalloc will be a offset from textalloc.
+ *   If CONFIG_ARCH_ADDRENV-y, then textalloc and dataalloc will be allocated
+ *   using up_addrenv_create().
+ *   In either case, there will be a unique instance of textalloc and
+ *   dataalloc (and stack) for each instance of a process.
  *
  * Input Parameters:
  *   loadinfo - Load state information
diff --git a/binfmt/libelf/libelf_sections.c b/binfmt/libelf/libelf_sections.c
index ac0c9dc..3acc897 100644
--- a/binfmt/libelf/libelf_sections.c
+++ b/binfmt/libelf/libelf_sections.c
@@ -254,7 +254,9 @@ int elf_findsection(FAR struct elf_loadinfo_s *loadinfo,
   int ret;
   int i;
 
-  /* Search through the shdr[] array in loadinfo for a section named 'sectname' */
+  /* Search through the shdr[] array in loadinfo for a section named
+   * 'sectname'
+   */
 
   for (i = 0; i < loadinfo->ehdr.e_shnum; i++)
     {
diff --git a/binfmt/libelf/libelf_symbols.c b/binfmt/libelf/libelf_symbols.c
index f5ac359..34a3c0c 100644
--- a/binfmt/libelf/libelf_symbols.c
+++ b/binfmt/libelf/libelf_symbols.c
@@ -319,7 +319,9 @@ int elf_symvalue(FAR struct elf_loadinfo_s *loadinfo, FAR Elf_Sym *sym,
             return -ENOENT;
           }
 
-        /* Yes... add the exported symbol value to the ELF symbol table entry */
+        /* Yes... add the exported symbol value to the ELF symbol table
+         * entry
+         */
 
         binfo("SHN_UNDEF: name=%s %08x+%08x=%08x\n",
               loadinfo->iobuffer, sym->st_value, symbol->sym_value,
diff --git a/binfmt/nxflat.c b/binfmt/nxflat.c
index ab1e6f8..f3c303e 100644
--- a/binfmt/nxflat.c
+++ b/binfmt/nxflat.c
@@ -58,8 +58,8 @@
  * Pre-processor Definitions
  ****************************************************************************/
 
-/* CONFIG_DEBUG_FEATURES, CONFIG_DEBUG_INFO, and CONFIG_DEBUG_BINFMT have to be
- * defined or CONFIG_NXFLAT_DUMPBUFFER does nothing.
+/* CONFIG_DEBUG_FEATURES, CONFIG_DEBUG_INFO, and CONFIG_DEBUG_BINFMT
+ * have to be defined or CONFIG_NXFLAT_DUMPBUFFER does nothing.
  */
 
 #if !defined(CONFIG_DEBUG_INFO) || !defined (CONFIG_DEBUG_BINFMT)


[incubator-nuttx] 03/03: crypto: nxstyle fixes

Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gnutt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 048d4954a08c46486a9d9f0db19f8ce0e7253bb3
Author: Alin Jerpelea <al...@sony.com>
AuthorDate: Wed Apr 22 10:56:23 2020 +0200

    crypto: nxstyle fixes
    
    nxstyle fixes to reduce the CI warnings
    
    Signed-off-by: Alin Jerpelea <al...@sony.com>
---
 crypto/aes.c       | 354 +++++++++++++++++++++++++++++++++++++++--------------
 crypto/blake2s.c   |  37 +++---
 crypto/cryptodev.c |  19 ++-
 crypto/testmngr.c  |   4 +-
 4 files changed, 299 insertions(+), 115 deletions(-)

diff --git a/crypto/aes.c b/crypto/aes.c
index d70d3a4..c9afe47 100644
--- a/crypto/aes.c
+++ b/crypto/aes.c
@@ -53,45 +53,80 @@
 
 static const uint8_t g_sbox[256] =
 {
-/*  0     1    2      3     4    5     6     7      8    9     A      B    C     D     E     F */
-  0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, /* 0 */
-  0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, /* 1 */
-  0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, /* 2 */
-  0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, /* 3 */
-  0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, /* 4 */
-  0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, /* 5 */
-  0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8, /* 6 */
-  0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2, /* 7 */
-  0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73, /* 8 */
-  0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb, /* 9 */
-  0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79, /* A */
-  0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08, /* B */
-  0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a, /* C */
-  0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e, /* D */
-  0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf, /* E */
-  0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16  /* F */
+  /* 0    1    2      3     4     5     6     7     8    9
+   *                        A     B     C     D     E    F
+   */
+
+  0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01,
+                          0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, /* 0 */
+  0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4,
+                           0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, /* 1 */
+  0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5,
+                           0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, /* 2 */
+  0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12,
+                           0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, /* 3 */
+  0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b,
+                           0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, /* 4 */
+  0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb,
+                           0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, /* 5 */
+  0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9,
+                           0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8, /* 6 */
+  0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6,
+                           0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2, /* 7 */
+  0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7,
+                           0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73, /* 8 */
+  0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee,
+                           0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb, /* 9 */
+  0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, 0xc2, 0xd3,
+                           0xac, 0x62, 0x91, 0x95, 0xe4, 0x79, /* A */
+  0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56,
+                           0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08, /* B */
+  0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd,
+                           0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a, /* C */
+  0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35,
+                           0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e, /* D */
+  0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e,
+                           0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf, /* E */
+  0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99,
+                           0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16  /* F */
 };
 
 /* Inverse sbox */
 
 static const uint8_t g_rsbox[256] =
 {
-  0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb,
-  0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb,
-  0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d, 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e,
-  0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2, 0x76, 0x5b, 0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25,
-  0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16, 0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92,
-  0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda, 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84,
-  0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a, 0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06,
-  0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b,
-  0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea, 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73,
-  0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e,
-  0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b,
-  0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4,
-  0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f,
-  0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef,
-  0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61,
-  0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d
+  0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40,
+                          0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb,
+  0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, 0x34, 0x8e,
+                          0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb,
+  0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d, 0xee, 0x4c,
+                          0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e,
+  0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2, 0x76, 0x5b,
+                          0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25,
+  0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16, 0xd4, 0xa4,
+                          0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92,
+  0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda, 0x5e, 0x15,
+                          0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84,
+  0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a, 0xf7, 0xe4,
+                          0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06,
+  0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, 0xc1, 0xaf,
+                          0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b,
+  0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea, 0x97, 0xf2,
+                          0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73,
+  0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9,
+                          0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e,
+  0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, 0x6f, 0xb7,
+                          0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b,
+  0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb,
+                          0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4,
+  0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12,
+                          0x10, 0x59, 0x27, 0x80, 0xec, 0x5f,
+  0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5,
+                          0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef,
+  0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb,
+                          0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61,
+  0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69,
+                          0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d
 };
 
 /* Round constant */
@@ -134,27 +169,58 @@ static void expand_key(FAR uint8_t *expanded_key, FAR const uint8_t *key)
 
   for (ii = 1; ii < 11; ii++)
     {
-      buf1 = expanded_key[ii*16 - 4];
-      expanded_key[ii * 16 + 0] = g_sbox[expanded_key[ii *16 - 3]] ^ expanded_key[(ii - 1) * 16 + 0] ^ g_rcon[ii];
-      expanded_key[ii * 16 + 1] = g_sbox[expanded_key[ii *16 - 2]] ^ expanded_key[(ii - 1) * 16 + 1];
-      expanded_key[ii * 16 + 2] = g_sbox[expanded_key[ii *16 - 1]] ^ expanded_key[(ii - 1) * 16 + 2];
-      expanded_key[ii * 16 + 3] = g_sbox[buf1] ^ expanded_key[(ii - 1) * 16 + 3];
-      expanded_key[ii * 16 + 4] = expanded_key[(ii - 1) * 16 + 4] ^ expanded_key[ii * 16 + 0];
-      expanded_key[ii * 16 + 5] = expanded_key[(ii - 1) * 16 + 5] ^ expanded_key[ii * 16 + 1];
-      expanded_key[ii * 16 + 6] = expanded_key[(ii - 1) * 16 + 6] ^ expanded_key[ii * 16 + 2];
-      expanded_key[ii * 16 + 7] = expanded_key[(ii - 1) * 16 + 7] ^ expanded_key[ii * 16 + 3];
-      expanded_key[ii * 16 + 8] = expanded_key[(ii - 1) * 16 + 8] ^ expanded_key[ii * 16 + 4];
-      expanded_key[ii * 16 + 9] = expanded_key[(ii - 1) * 16 + 9] ^ expanded_key[ii * 16 + 5];
-      expanded_key[ii * 16 +10] = expanded_key[(ii - 1) * 16 +10] ^ expanded_key[ii * 16 + 6];
-      expanded_key[ii * 16 +11] = expanded_key[(ii - 1) * 16 +11] ^ expanded_key[ii * 16 + 7];
-      expanded_key[ii * 16 +12] = expanded_key[(ii - 1) * 16 +12] ^ expanded_key[ii * 16 + 8];
-      expanded_key[ii * 16 +13] = expanded_key[(ii - 1) * 16 +13] ^ expanded_key[ii * 16 + 9];
-      expanded_key[ii * 16 +14] = expanded_key[(ii - 1) * 16 +14] ^ expanded_key[ii * 16 +10];
-      expanded_key[ii * 16 +15] = expanded_key[(ii - 1) * 16 +15] ^ expanded_key[ii * 16 +11];
+      buf1 = expanded_key[ii * 16 - 4];
+      expanded_key[ii * 16 + 0] = g_sbox[expanded_key[ii *16 - 3]] ^
+                            expanded_key[(ii - 1) * 16 + 0] ^ g_rcon[ii];
+
+      expanded_key[ii * 16 + 1] = g_sbox[expanded_key[ii *16 - 2]] ^
+                            expanded_key[(ii - 1) * 16 + 1];
+
+      expanded_key[ii * 16 + 2] = g_sbox[expanded_key[ii *16 - 1]] ^
+                            expanded_key[(ii - 1) * 16 + 2];
+
+      expanded_key[ii * 16 + 3] = g_sbox[buf1] ^
+                            expanded_key[(ii - 1) * 16 + 3];
+
+      expanded_key[ii * 16 + 4] = expanded_key[(ii - 1) * 16 + 4] ^
+                            expanded_key[ii * 16 + 0];
+
+      expanded_key[ii * 16 + 5] = expanded_key[(ii - 1) * 16 + 5] ^
+                            expanded_key[ii * 16 + 1];
+
+      expanded_key[ii * 16 + 6] = expanded_key[(ii - 1) * 16 + 6] ^
+                            expanded_key[ii * 16 + 2];
+
+      expanded_key[ii * 16 + 7] = expanded_key[(ii - 1) * 16 + 7] ^
+                            expanded_key[ii * 16 + 3];
+
+      expanded_key[ii * 16 + 8] = expanded_key[(ii - 1) * 16 + 8] ^
+                            expanded_key[ii * 16 + 4];
+
+      expanded_key[ii * 16 + 9] = expanded_key[(ii - 1) * 16 + 9] ^
+                            expanded_key[ii * 16 + 5];
+
+      expanded_key[ii * 16 +10] = expanded_key[(ii - 1) * 16 +10] ^
+                            expanded_key[ii * 16 + 6];
+
+      expanded_key[ii * 16 +11] = expanded_key[(ii - 1) * 16 +11] ^
+                            expanded_key[ii * 16 + 7];
+
+      expanded_key[ii * 16 +12] = expanded_key[(ii - 1) * 16 +12] ^
+                            expanded_key[ii * 16 + 8];
+
+      expanded_key[ii * 16 +13] = expanded_key[(ii - 1) * 16 +13] ^
+                            expanded_key[ii * 16 + 9];
+
+      expanded_key[ii * 16 +14] = expanded_key[(ii - 1) * 16 +14] ^
+                            expanded_key[ii * 16 +10];
+
+      expanded_key[ii * 16 +15] = expanded_key[(ii - 1) * 16 +15] ^
+                            expanded_key[ii * 16 +11];
     }
 }
 
-/******************************************************************************
+/****************************************************************************
  * Name: galois_mul2
  *
  * Description:
@@ -166,7 +232,7 @@ static void expand_key(FAR uint8_t *expanded_key, FAR const uint8_t *key)
  * Returned Value:
  *  Multiplied argument
  *
- ******************************************************************************/
+ ****************************************************************************/
 
 static uint8_t galois_mul2(uint8_t value)
 {
@@ -181,7 +247,7 @@ static uint8_t galois_mul2(uint8_t value)
     }
 }
 
-/******************************************************************************
+/****************************************************************************
  * Name: aes_encr
  *
  * Description:
@@ -194,9 +260,10 @@ static uint8_t galois_mul2(uint8_t value)
  *    - shiftrows
  *    - mixcolums
  *
- *  is executed 9 times, after this addroundkey to finish the 9th round, after
- *  that the 10th round without mixcolums no further subfunctions to save
- *  cycles for function calls no structuring with "for (....)" to save cycles.
+ *  is executed 9 times, after this addroundkey to finish the 9th round,
+ *  after that the 10th round without mixcolums no further subfunctions
+ *  to save cycles for function calls no structuring with "for (....)"
+ *  to save cycles.
  *
  * Input Parameters:
  *  expanded_key expanded AES128 key
@@ -205,7 +272,7 @@ static uint8_t galois_mul2(uint8_t value)
  * Returned Value:
  *  None
  *
- ******************************************************************************/
+ ****************************************************************************/
 
 static void aes_encr(FAR uint8_t *state, FAR const uint8_t *expanded_key)
 {
@@ -217,6 +284,7 @@ static void aes_encr(FAR uint8_t *state, FAR const uint8_t *expanded_key)
   for (round = 0; round < 9; round ++)
     {
       /* addroundkey, sbox and shiftrows */
+
       /* Row 0 */
 
       state[0]   = g_sbox[(state[0]  ^ expanded_key[(round * 16)])];
@@ -250,41 +318,90 @@ static void aes_encr(FAR uint8_t *state, FAR const uint8_t *expanded_key)
       state[3]   = g_sbox[buf1];
 
       /* mixcolums */
+
       /* Col1 */
 
       buf1 = state[0] ^ state[1] ^ state[2] ^ state[3];
       buf2 = state[0];
-      buf3 = state[0] ^ state[1]; buf3 = galois_mul2(buf3); state[0] = state[0] ^ buf3 ^ buf1;
-      buf3 = state[1] ^ state[2]; buf3 = galois_mul2(buf3); state[1] = state[1] ^ buf3 ^ buf1;
-      buf3 = state[2] ^ state[3]; buf3 = galois_mul2(buf3); state[2] = state[2] ^ buf3 ^ buf1;
-      buf3 = state[3] ^ buf2;     buf3 = galois_mul2(buf3); state[3] = state[3] ^ buf3 ^ buf1;
+
+      buf3 = state[0] ^ state[1];
+      buf3 = galois_mul2(buf3);
+      state[0] = state[0] ^ buf3 ^ buf1;
+
+      buf3 = state[1] ^ state[2];
+      buf3 = galois_mul2(buf3);
+      state[1] = state[1] ^ buf3 ^ buf1;
+
+      buf3 = state[2] ^ state[3];
+      buf3 = galois_mul2(buf3);
+      state[2] = state[2] ^ buf3 ^ buf1;
+
+      buf3 = state[3] ^ buf2;
+      buf3 = galois_mul2(buf3);
+      state[3] = state[3] ^ buf3 ^ buf1;
 
       /* Col2 */
 
       buf1 = state[4] ^ state[5] ^ state[6] ^ state[7];
       buf2 = state[4];
-      buf3 = state[4] ^ state[5]; buf3 = galois_mul2(buf3); state[4] = state[4] ^ buf3 ^ buf1;
-      buf3 = state[5] ^ state[6]; buf3 = galois_mul2(buf3); state[5] = state[5] ^ buf3 ^ buf1;
-      buf3 = state[6] ^ state[7]; buf3 = galois_mul2(buf3); state[6] = state[6] ^ buf3 ^ buf1;
-      buf3 = state[7] ^ buf2;     buf3 = galois_mul2(buf3); state[7] = state[7] ^ buf3 ^ buf1;
+
+      buf3 = state[4] ^ state[5];
+      buf3 = galois_mul2(buf3);
+      state[4] = state[4] ^ buf3 ^ buf1;
+
+      buf3 = state[5] ^ state[6];
+      buf3 = galois_mul2(buf3);
+      state[5] = state[5] ^ buf3 ^ buf1;
+
+      buf3 = state[6] ^ state[7];
+      buf3 = galois_mul2(buf3);
+      state[6] = state[6] ^ buf3 ^ buf1;
+
+      buf3 = state[7] ^ buf2;
+      buf3 = galois_mul2(buf3);
+      state[7] = state[7] ^ buf3 ^ buf1;
 
       /* Col3 */
 
       buf1 = state[8] ^ state[9] ^ state[10] ^ state[11];
       buf2 = state[8];
-      buf3 = state[8] ^ state[9];   buf3 = galois_mul2(buf3); state[8] = state[8] ^ buf3 ^ buf1;
-      buf3 = state[9] ^ state[10];  buf3 = galois_mul2(buf3); state[9] = state[9] ^ buf3 ^ buf1;
-      buf3 = state[10] ^ state[11]; buf3 = galois_mul2(buf3); state[10] = state[10] ^ buf3 ^ buf1;
-      buf3 = state[11] ^ buf2;      buf3 = galois_mul2(buf3); state[11] = state[11] ^ buf3 ^ buf1;
+
+      buf3 = state[8] ^ state[9];
+      buf3 = galois_mul2(buf3);
+      state[8] = state[8] ^ buf3 ^ buf1;
+
+      buf3 = state[9] ^ state[10];
+      buf3 = galois_mul2(buf3);
+      state[9] = state[9] ^ buf3 ^ buf1;
+
+      buf3 = state[10] ^ state[11];
+      buf3 = galois_mul2(buf3);
+      state[10] = state[10] ^ buf3 ^ buf1;
+
+      buf3 = state[11] ^ buf2;
+      buf3 = galois_mul2(buf3);
+      state[11] = state[11] ^ buf3 ^ buf1;
 
       /* Col4 */
 
       buf1 = state[12] ^ state[13] ^ state[14] ^ state[15];
       buf2 = state[12];
-      buf3 = state[12] ^ state[13]; buf3 = galois_mul2(buf3); state[12] = state[12] ^ buf3 ^ buf1;
-      buf3 = state[13] ^ state[14]; buf3 = galois_mul2(buf3); state[13] = state[13] ^ buf3 ^ buf1;
-      buf3 = state[14] ^ state[15]; buf3 = galois_mul2(buf3); state[14] = state[14] ^ buf3 ^ buf1;
-      buf3 = state[15] ^ buf2;      buf3 = galois_mul2(buf3); state[15] = state[15] ^ buf3 ^ buf1;
+
+      buf3 = state[12] ^ state[13];
+      buf3 = galois_mul2(buf3);
+      state[12] = state[12] ^ buf3 ^ buf1;
+
+      buf3 = state[13] ^ state[14];
+      buf3 = galois_mul2(buf3);
+      state[13] = state[13] ^ buf3 ^ buf1;
+
+      buf3 = state[14] ^ state[15];
+      buf3 = galois_mul2(buf3);
+      state[14] = state[14] ^ buf3 ^ buf1;
+
+      buf3 = state[15] ^ buf2;
+      buf3 = galois_mul2(buf3);
+      state[15] = state[15] ^ buf3 ^ buf1;
     }
 
   /* 10th round without mixcols */
@@ -339,7 +456,7 @@ static void aes_encr(FAR uint8_t *state, FAR const uint8_t *expanded_key)
   state[15] ^= expanded_key[175];
 }
 
-/******************************************************************************
+/****************************************************************************
  * Name: aes_decr
  *
  * Description:
@@ -362,7 +479,7 @@ static void aes_encr(FAR uint8_t *state, FAR const uint8_t *expanded_key)
  * Returned Value:
  *  None
  *
- ******************************************************************************/
+ ****************************************************************************/
 
 static void aes_decr(FAR uint8_t *state, FAR const uint8_t *expanded_key)
 {
@@ -427,6 +544,7 @@ static void aes_decr(FAR uint8_t *state, FAR const uint8_t *expanded_key)
   for (round = 8; round >= 0; round--)
     {
       /* barreto */
+
       /* Col1 */
 
       buf1       = galois_mul2(galois_mul2(state[0] ^ state[2]));
@@ -464,43 +582,93 @@ static void aes_decr(FAR uint8_t *state, FAR const uint8_t *expanded_key)
       state[15] ^= buf2;
 
       /* mixcolums */
+
       /* Col1 */
 
       buf1 = state[0]  ^ state[1] ^ state[2] ^ state[3];
       buf2 = state[0];
-      buf3 = state[0]  ^ state[1]; buf3 = galois_mul2(buf3); state[0] = state[0] ^ buf3 ^ buf1;
-      buf3 = state[1]  ^ state[2]; buf3 = galois_mul2(buf3); state[1] = state[1] ^ buf3 ^ buf1;
-      buf3 = state[2]  ^ state[3]; buf3 = galois_mul2(buf3); state[2] = state[2] ^ buf3 ^ buf1;
-      buf3 = state[3]  ^ buf2;     buf3 = galois_mul2(buf3); state[3] = state[3] ^ buf3 ^ buf1;
+
+      buf3 = state[0]  ^ state[1];
+      buf3 = galois_mul2(buf3);
+      state[0] = state[0] ^ buf3 ^ buf1;
+
+      buf3 = state[1]  ^ state[2];
+      buf3 = galois_mul2(buf3);
+      state[1] = state[1] ^ buf3 ^ buf1;
+
+      buf3 = state[2]  ^ state[3];
+      buf3 = galois_mul2(buf3);
+      state[2] = state[2] ^ buf3 ^ buf1;
+
+      buf3 = state[3]  ^ buf2;
+      buf3 = galois_mul2(buf3);
+      state[3] = state[3] ^ buf3 ^ buf1;
 
       /* Col2 */
 
       buf1 = state[4]  ^ state[5] ^ state[6] ^ state[7];
       buf2 = state[4];
-      buf3 = state[4]  ^ state[5]; buf3 = galois_mul2(buf3); state[4] = state[4] ^ buf3 ^ buf1;
-      buf3 = state[5]  ^ state[6]; buf3 = galois_mul2(buf3); state[5] = state[5] ^ buf3 ^ buf1;
-      buf3 = state[6]  ^ state[7]; buf3 = galois_mul2(buf3); state[6] = state[6] ^ buf3 ^ buf1;
-      buf3 = state[7]  ^ buf2;     buf3 = galois_mul2(buf3); state[7] = state[7] ^ buf3 ^ buf1;
+
+      buf3 = state[4]  ^ state[5];
+      buf3 = galois_mul2(buf3);
+      state[4] = state[4] ^ buf3 ^ buf1;
+
+      buf3 = state[5]  ^ state[6];
+      buf3 = galois_mul2(buf3);
+      state[5] = state[5] ^ buf3 ^ buf1;
+
+      buf3 = state[6]  ^ state[7];
+      buf3 = galois_mul2(buf3);
+      state[6] = state[6] ^ buf3 ^ buf1;
+
+      buf3 = state[7]  ^ buf2;
+      buf3 = galois_mul2(buf3);
+      state[7] = state[7] ^ buf3 ^ buf1;
 
       /* Col3 */
 
       buf1 = state[8]  ^ state[9] ^ state[10] ^ state[11];
       buf2 = state[8];
-      buf3 = state[8]  ^ state[9];  buf3 = galois_mul2(buf3); state[8] = state[8] ^ buf3 ^ buf1;
-      buf3 = state[9]  ^ state[10]; buf3 = galois_mul2(buf3); state[9] = state[9] ^ buf3 ^ buf1;
-      buf3 = state[10] ^ state[11]; buf3 = galois_mul2(buf3); state[10] = state[10] ^ buf3 ^ buf1;
-      buf3 = state[11] ^ buf2;      buf3 = galois_mul2(buf3); state[11] = state[11] ^ buf3 ^ buf1;
+
+      buf3 = state[8]  ^ state[9];
+      buf3 = galois_mul2(buf3);
+      state[8] = state[8] ^ buf3 ^ buf1;
+
+      buf3 = state[9]  ^ state[10];
+      buf3 = galois_mul2(buf3);
+      state[9] = state[9] ^ buf3 ^ buf1;
+
+      buf3 = state[10] ^ state[11];
+      buf3 = galois_mul2(buf3);
+      state[10] = state[10] ^ buf3 ^ buf1;
+
+      buf3 = state[11] ^ buf2;
+      buf3 = galois_mul2(buf3);
+      state[11] = state[11] ^ buf3 ^ buf1;
 
       /* Col4 */
 
       buf1 = state[12] ^ state[13] ^ state[14] ^ state[15];
       buf2 = state[12];
-      buf3 = state[12] ^ state[13]; buf3 = galois_mul2(buf3); state[12] = state[12] ^ buf3 ^ buf1;
-      buf3 = state[13] ^ state[14]; buf3 = galois_mul2(buf3); state[13] = state[13] ^ buf3 ^ buf1;
-      buf3 = state[14] ^ state[15]; buf3 = galois_mul2(buf3); state[14] = state[14] ^ buf3 ^ buf1;
-      buf3 = state[15] ^ buf2;      buf3 = galois_mul2(buf3); state[15] = state[15] ^ buf3 ^ buf1;
+
+      buf3 = state[12] ^ state[13];
+      buf3 = galois_mul2(buf3);
+      state[12] = state[12] ^ buf3 ^ buf1;
+
+      buf3 = state[13] ^ state[14];
+      buf3 = galois_mul2(buf3);
+      state[13] = state[13] ^ buf3 ^ buf1;
+
+      buf3 = state[14] ^ state[15];
+      buf3 = galois_mul2(buf3);
+      state[14] = state[14] ^ buf3 ^ buf1;
+
+      buf3 = state[15] ^ buf2;
+      buf3 = galois_mul2(buf3);
+      state[15] = state[15] ^ buf3 ^ buf1;
 
       /* addroundkey, rsbox and shiftrows */
+
       /* Row 0 */
 
       state[0]   = g_rsbox[state[0]]  ^ expanded_key[(round * 16)];
@@ -558,7 +726,9 @@ static void aes_decr(FAR uint8_t *state, FAR const uint8_t *expanded_key)
  *
  ****************************************************************************/
 
-int aes_setupkey(FAR struct aes_state_s *state, FAR const uint8_t *key, int len)
+int aes_setupkey(FAR struct aes_state_s *state,
+                 FAR const uint8_t *key,
+                 int len)
 {
   if (len != 16)
     {
diff --git a/crypto/blake2s.c b/crypto/blake2s.c
index 54e751e..b48a4e0 100644
--- a/crypto/blake2s.c
+++ b/crypto/blake2s.c
@@ -62,7 +62,7 @@
  * Private Data
  ****************************************************************************/
 
-static const uint32_t blake2s_IV[8] =
+static const uint32_t blake2s_iv[8] =
 {
   0x6a09e667ul, 0xbb67ae85ul, 0x3c6ef372ul, 0xa54ff53aul, 0x510e527ful,
   0x9b05688cul, 0x1f83d9abul, 0x5be0cd19ul
@@ -129,7 +129,7 @@ static void blake2_memset(FAR void *dst, int set, size_t len)
   uint32_t mset;
 
   set &= 0xff;
-  mset = (uint32_t)set * 0x01010101UL;
+  mset = (uint32_t)set * 0x01010101ul;
 
   while (len >= sizeof(uint32_alias_t))
     {
@@ -182,7 +182,7 @@ static void blake2s_init0(FAR blake2s_state *S)
   blake2_memset(S, 0, sizeof(*S) - sizeof(S->buf));
 
   for (i = 0; i < 8; ++i)
-    S->h[i] = blake2s_IV[i];
+    S->h[i] = blake2s_iv[i];
 }
 
 static void blake2s_compress(FAR blake2s_state *S,
@@ -203,14 +203,14 @@ static void blake2s_compress(FAR blake2s_state *S,
       v[i] = S->h[i];
     }
 
-  v[8] = blake2s_IV[0];
-  v[9] = blake2s_IV[1];
-  v[10] = blake2s_IV[2];
-  v[11] = blake2s_IV[3];
-  v[12] = S->t[0] ^ blake2s_IV[4];
-  v[13] = S->t[1] ^ blake2s_IV[5];
-  v[14] = S->f[0] ^ blake2s_IV[6];
-  v[15] = S->f[1] ^ blake2s_IV[7];
+  v[8] = blake2s_iv[0];
+  v[9] = blake2s_iv[1];
+  v[10] = blake2s_iv[2];
+  v[11] = blake2s_iv[3];
+  v[12] = S->t[0] ^ blake2s_iv[4];
+  v[13] = S->t[1] ^ blake2s_iv[5];
+  v[14] = S->f[0] ^ blake2s_iv[6];
+  v[15] = S->f[1] ^ blake2s_iv[7];
 
 #define G(r,i,a,b,c,d)                      \
   do {                                      \
@@ -283,7 +283,7 @@ static void selftest_seq(FAR uint8_t *out, size_t len, uint32_t seed)
   uint32_t a;
   uint32_t b;
 
-  a = 0xDEAD4BAD * seed; /* prime */
+  a = 0xdead4bad * seed; /* prime */
   b = 1;
 
   /* fill the buf */
@@ -293,7 +293,7 @@ static void selftest_seq(FAR uint8_t *out, size_t len, uint32_t seed)
       t = a + b;
       a = b;
       b = t;
-      out[i] = (t >> 24) & 0xFF;
+      out[i] = (t >> 24) & 0xff;
     }
 }
 
@@ -314,10 +314,12 @@ static int blake2s_selftest(void)
   {
     16, 20, 28, 32
   };
+
   static const size_t b2s_in_len[6] =
   {
     0, 3, 64, 65, 255, 1024
   };
+
   size_t i;
   size_t j;
   size_t outlen;
@@ -364,7 +366,7 @@ static int blake2s_selftest(void)
   for (i = 0; i < 32; i++)
     {
       if (md[i] != blake2s_res[i])
-        goto out;
+          goto out;
     }
 
   ret = 0;
@@ -395,7 +397,7 @@ int blake2s_init_param(FAR blake2s_state *S, FAR const blake2s_param *P)
       ret = blake2s_selftest();
       DEBUGASSERT(ret == 0);
       if (ret)
-        return -1;
+          return -1;
     }
 #endif
 
@@ -442,7 +444,9 @@ int blake2s_init(FAR blake2s_state *S, size_t outlen)
   return blake2s_init_param(S, P);
 }
 
-int blake2s_init_key(FAR blake2s_state *S, size_t outlen, FAR const void *key,
+int blake2s_init_key(FAR blake2s_state *S,
+                     size_t outlen,
+                     FAR const void *key,
                      size_t keylen)
 {
   blake2s_param P[1];
@@ -548,6 +552,7 @@ int blake2s_final(FAR blake2s_state *S, FAR void *out, size_t outlen)
     {
       blake2_memset(S->buf + S->buflen, 0, padding);
     }
+
   blake2s_compress(S, S->buf);
 
   /* Output hash to out buffer */
diff --git a/crypto/cryptodev.c b/crypto/cryptodev.c
index 26536ad..b67d9ec 100644
--- a/crypto/cryptodev.c
+++ b/crypto/cryptodev.c
@@ -67,11 +67,14 @@
 
 /* Character driver methods */
 
-static ssize_t cryptodev_read(FAR struct file *filep, FAR char *buffer,
+static ssize_t cryptodev_read(FAR struct file *filep,
+                              FAR char *buffer,
                               size_t len);
-static ssize_t cryptodev_write(FAR struct file *filep, FAR const char *buffer,
+static ssize_t cryptodev_write(FAR struct file *filep,
+                               FAR const char *buffer,
                                size_t len);
-static int cryptodev_ioctl(FAR struct file *filep, int cmd,
+static int cryptodev_ioctl(FAR struct file *filep,
+                           int cmd,
                            unsigned long arg);
 
 /****************************************************************************
@@ -96,19 +99,23 @@ static const struct file_operations g_cryptodevops =
  * Private Functions
  ****************************************************************************/
 
-static ssize_t cryptodev_read(FAR struct file *filep, FAR char *buffer,
+static ssize_t cryptodev_read(FAR struct file *filep,
+                              FAR char *buffer,
                               size_t len)
 {
   return -EACCES;
 }
 
-static ssize_t cryptodev_write(FAR struct file *filep, FAR const char *buffer,
+static ssize_t cryptodev_write(FAR struct file *filep,
+                               FAR const char *buffer,
                                size_t len)
 {
   return -EACCES;
 }
 
-static int cryptodev_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
+static int cryptodev_ioctl(FAR struct file *filep,
+                           int cmd,
+                           unsigned long arg)
 {
   switch (cmd)
   {
diff --git a/crypto/testmngr.c b/crypto/testmngr.c
index 0e857b3..d002e6d 100644
--- a/crypto/testmngr.c
+++ b/crypto/testmngr.c
@@ -68,7 +68,9 @@
  * Private Functions
  ****************************************************************************/
 
-static int do_test_aes(FAR struct cipher_testvec *test, int mode, int encrypt)
+static int do_test_aes(FAR struct cipher_testvec *test,
+                       int mode,
+                       int encrypt)
 {
   FAR void *out = kmm_zalloc(test->rlen);
 


[incubator-nuttx] 02/03: video: videomode: nxstyle cleanup

Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gnutt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit e6b47ea948fa49020b16a5d85d2aaaaf87b978e0
Author: Alin Jerpelea <al...@sony.com>
AuthorDate: Wed Apr 22 17:03:37 2020 +0200

    video: videomode: nxstyle cleanup
    
    various nxstyle fixed to avoid the CI warnings
    
    Signed-off-by: Alin Jerpelea <al...@sony.com>
---
 video/videomode/edid_dump.c        |   6 +-
 video/videomode/edid_parse.c       |  26 ++--
 video/videomode/videomode_dump.c   |   8 +-
 video/videomode/videomode_lookup.c | 276 ++++++++++++++++++++++++-------------
 video/videomode/videomode_sort.c   |   6 +-
 5 files changed, 214 insertions(+), 108 deletions(-)

diff --git a/video/videomode/edid_dump.c b/video/videomode/edid_dump.c
index 13e1211..85d1c5d 100644
--- a/video/videomode/edid_dump.c
+++ b/video/videomode/edid_dump.c
@@ -209,9 +209,11 @@ void edid_dump(FAR const struct edid_info_s *edid)
   if (edid->edid_have_range)
     {
       syslog(LOG_INFO, "%-16sHorizontal: %d - %d kHz\n",
-             "Range:", edid->edid_range.er_min_hfreq, edid->edid_range.er_max_hfreq);
+             "Range:", edid->edid_range.er_min_hfreq,
+              edid->edid_range.er_max_hfreq);
       syslog(LOG_INFO, "%-16sVertical: %d - %d Hz\n",
-             "", edid->edid_range.er_min_vfreq, edid->edid_range.er_max_vfreq);
+             "", edid->edid_range.er_min_vfreq,
+             edid->edid_range.er_max_vfreq);
       syslog(LOG_INFO, "%-16sMax Dot Clock: %d MHz\n",
              "", edid->edid_range.er_max_clock);
       if (edid->edid_range.er_have_gtf2)
diff --git a/video/videomode/edid_parse.c b/video/videomode/edid_parse.c
index 7bc2146..e8803f5 100644
--- a/video/videomode/edid_parse.c
+++ b/video/videomode/edid_parse.c
@@ -353,7 +353,8 @@ static void edid_block(FAR struct edid_info_s *edid, FAR const uint8_t *desc)
           edid->edid_modes[edid->edid_nmodes] = mode;
           if (edid->edid_preferred_mode == NULL)
             {
-              edid->edid_preferred_mode = &edid->edid_modes[edid->edid_nmodes];
+              edid->edid_preferred_mode =
+                          &edid->edid_modes[edid->edid_nmodes];
             }
 
           edid->edid_nmodes++;
@@ -433,6 +434,7 @@ static void edid_block(FAR struct edid_info_s *edid, FAR const uint8_t *desc)
       break;
 
     case EDID_DESCTYPE_WHITEPOINT:
+
       /* Not implemented yet */
 
       break;
@@ -477,21 +479,24 @@ int edid_parse(FAR const uint8_t *data, FAR struct edid_info_s *edid)
 
   /* Get product identification */
 
-  manufacturer                =  (uint16_t)data[EDID_VENDOR_MANUFACTURER_OFFSET] |
-                                ((uint16_t)data[EDID_VENDOR_MANUFACTURER_OFFSET + 1] << 8);
+  manufacturer =
+            (uint16_t)data[EDID_VENDOR_MANUFACTURER_OFFSET] |
+            ((uint16_t)data[EDID_VENDOR_MANUFACTURER_OFFSET + 1] << 8);
 
   edid->edid_manufacturer[0]  = EDID_VENDOR_MANUFACTURER_1(manufacturer);
   edid->edid_manufacturer[1]  = EDID_VENDOR_MANUFACTURER_2(manufacturer);
   edid->edid_manufacturer[2]  = EDID_VENDOR_MANUFACTURER_3(manufacturer);
   edid->edid_manufacturer[3]  = 0;     /* NUL terminate for convenience */
 
-  edid->edid_product          =  (uint16_t)data[EDID_VENDOR_PRODUCTCODE_OFFSET] |
-                                ((uint16_t)data[EDID_VENDOR_PRODUCTCODE_OFFSET + 1] << 8);
+  edid->edid_product =
+            (uint16_t)data[EDID_VENDOR_PRODUCTCODE_OFFSET] |
+            ((uint16_t)data[EDID_VENDOR_PRODUCTCODE_OFFSET + 1] << 8);
 
-  edid->edid_serial           = ((uint32_t)data[EDID_VENDOR_SERIALNO_OFFSET] << 24) |
-                                ((uint32_t)data[EDID_VENDOR_SERIALNO_OFFSET + 1] << 16) |
-                                ((uint32_t)data[EDID_VENDOR_SERIALNO_OFFSET + 2] << 8) |
-                                 (uint32_t)data[EDID_VENDOR_SERIALNO_OFFSET + 3];
+  edid->edid_serial =
+            ((uint32_t)data[EDID_VENDOR_SERIALNO_OFFSET] << 24) |
+            ((uint32_t)data[EDID_VENDOR_SERIALNO_OFFSET + 1] << 16) |
+            ((uint32_t)data[EDID_VENDOR_SERIALNO_OFFSET + 2] << 8) |
+            (uint32_t)data[EDID_VENDOR_SERIALNO_OFFSET + 3];
 
   edid->edid_week             = data[EDID_VENDOR_WEEK_OFFSET];
   edid->edid_year             = data[EDID_VENDOR_YEAR_OFFSET] + 1990;
@@ -571,7 +576,8 @@ int edid_parse(FAR const uint8_t *data, FAR struct edid_info_s *edid)
 
   for (i = 0; i < EDID_DESCRIPTOR_NUMBER; i++)
     {
-      edid_block(edid, data + EDID_DESCRIPTOR_OFFSET + i * EDID_DESCRIPTOR_SIZE);
+      edid_block(edid,
+                 data + EDID_DESCRIPTOR_OFFSET + i * EDID_DESCRIPTOR_SIZE);
     }
 
   /* Some monitors lie about their maximum supported dot clock
diff --git a/video/videomode/videomode_dump.c b/video/videomode/videomode_dump.c
index c35ca84..4a5e768 100644
--- a/video/videomode/videomode_dump.c
+++ b/video/videomode/videomode_dump.c
@@ -111,8 +111,12 @@ void videomode_dump(FAR const char *prefix,
         {
           syslog(LOG_INFO, " (%lu %u %u %u %u %u %u",
                  (unsigned long)videomode->dotclock,
-                 videomode->hsync_start, videomode->hsync_end, videomode->htotal,
-                 videomode->vsync_start, videomode->vsync_end, videomode->vtotal);
+                 videomode->hsync_start,
+                 videomode->hsync_end,
+                 videomode->htotal,
+                 videomode->vsync_start,
+                 videomode->vsync_end,
+                 videomode->vtotal);
           syslog(LOG_INFO, " %s%sH %s%sV)\n",
                  videomode->flags & VID_PHSYNC ? "+" : "",
                  videomode->flags & VID_NHSYNC ? "-" : "",
diff --git a/video/videomode/videomode_lookup.c b/video/videomode/videomode_lookup.c
index e1c9dba..31ae91e 100644
--- a/video/videomode/videomode_lookup.c
+++ b/video/videomode/videomode_lookup.c
@@ -73,101 +73,193 @@
 
 static const struct videomode_s g_videomodes[] =
 {
-  M("640x350x85",    640,  350,  31500,  672,  736,  832,  382,  385,  445, HP|VN),
-  M("640x400x85",    640,  400,  31500,  672,  736,  832,  401,  404,  445, HN|VP),
-  M("720x400x70",    720,  400,  28320,  738,  846,  900,  412,  414,  449, HN|VP),
-  M("720x400x85",    720,  400,  35500,  756,  828,  936,  401,  404,  446, HN|VP),
-  M("720x400x87",    720,  400,  35500,  738,  846,  900,  421,  423,  449, HN|VN),
-  M("640x480x60",    640,  480,  25175,  656,  752,  800,  490,  492,  525, HN|VN),
-  M("640x480x72",    640,  480,  31500,  664,  704,  832,  489,  492,  520, HN|VN),
-  M("640x480x75",    640,  480,  31500,  656,  720,  840,  481,  484,  500, HN|VN),
-  M("640x480x85",    640,  480,  36000,  696,  752,  832,  481,  484,  509, HN|VN),
-  M("800x600x56",    800,  600,  36000,  824,  896, 1024,  601,  603,  625, HP|VP),
-  M("800x600x60",    800,  600,  40000,  840,  968, 1056,  601,  605,  628, HP|VP),
-  M("800x600x72",    800,  600,  50000,  856,  976, 1040,  637,  643,  666, HP|VP),
-  M("800x600x75",    800,  600,  49500,  816,  896, 1056,  601,  604,  625, HP|VP),
-  M("800x600x85",    800,  600,  56250,  832,  896, 1048,  601,  604,  631, HP|VP),
-  M("1024x768x87i", 1024,  768,  44900, 1032, 1208, 1264,  768,  776,  817, HP|VP|I),
-  M("1024x768x60",  1024,  768,  65000, 1048, 1184, 1344,  771,  777,  806, HN|VN),
-  M("1024x768x70",  1024,  768,  75000, 1048, 1184, 1328,  771,  777,  806, HN|VN),
-  M("1024x768x75",  1024,  768,  78750, 1040, 1136, 1312,  769,  772,  800, HP|VP),
-  M("1024x768x85",  1024,  768,  94500, 1072, 1168, 1376,  769,  772,  808, HP|VP),
-  M("1024x768x89",  1024,  768, 100000, 1108, 1280, 1408,  768,  780,  796, HP|VP),
-  M("1152x864x75",  1152,  864, 108000, 1216, 1344, 1600,  865,  868,  900, HP|VP),
-  M("1280x768x75",  1280,  768, 105640, 1312, 1712, 1744,  782,  792,  807, HN|VP),
-  M("1280x960x60",  1280,  960, 108000, 1376, 1488, 1800,  961,  964, 1000, HP|VP),
-  M("1280x960x85",  1280,  960, 148500, 1344, 1504, 1728,  961,  964, 1011, HP|VP),
-  M("1280x1024x60", 1280, 1024, 108000, 1328, 1440, 1688, 1025, 1028, 1066, HP|VP),
-  M("1280x1024x70", 1280, 1024, 126000, 1328, 1440, 1688, 1025, 1028, 1066, HP|VP),
-  M("1280x1024x75", 1280, 1024, 135000, 1296, 1440, 1688, 1025, 1028, 1066, HP|VP),
-  M("1280x1024x85", 1280, 1024, 157500, 1344, 1504, 1728, 1025, 1028, 1072, HP|VP),
-  M("1600x1200x60", 1600, 1200, 162000, 1664, 1856, 2160, 1201, 1204, 1250, HP|VP),
-  M("1600x1200x65", 1600, 1200, 175500, 1664, 1856, 2160, 1201, 1204, 1250, HP|VP),
-  M("1600x1200x70", 1600, 1200, 189000, 1664, 1856, 2160, 1201, 1204, 1250, HP|VP),
-  M("1600x1200x75", 1600, 1200, 202500, 1664, 1856, 2160, 1201, 1204, 1250, HP|VP),
-  M("1600x1200x85", 1600, 1200, 229500, 1664, 1856, 2160, 1201, 1204, 1250, HP|VP),
-  M("1680x1050x60", 1680, 1050, 147140, 1784, 1968, 2256, 1051, 1054, 1087, HP|VP),
-  M("1792x1344x60", 1792, 1344, 204800, 1920, 2120, 2448, 1345, 1348, 1394, HN|VP),
-  M("1792x1344x75", 1792, 1344, 261000, 1888, 2104, 2456, 1345, 1348, 1417, HN|VP),
-  M("1856x1392x60", 1856, 1392, 218300, 1952, 2176, 2528, 1393, 1396, 1439, HN|VP),
-  M("1856x1392x75", 1856, 1392, 288000, 1984, 2208, 2560, 1393, 1396, 1500, HN|VP),
-  M("1920x1440x60", 1920, 1440, 234000, 2048, 2256, 2600, 1441, 1444, 1500, HN|VP),
-  M("1920x1440x75", 1920, 1440, 297000, 2064, 2288, 2640, 1441, 1444, 1500, HN|VP),
-  M("832x624x74",    832,  624,  57284,  864,  928, 1152,  625,  628,  667, HN|VN),
-  M("1152x768x54",  1152,  768,  64995, 1178, 1314, 1472,  771,  777,  806, HP|VP),
-  M("1400x1050x60", 1400, 1050, 122000, 1488, 1640, 1880, 1052, 1064, 1082, HP|VP),
-  M("1400x1050x74", 1400, 1050, 155800, 1464, 1784, 1912, 1052, 1064, 1090, HP|VP),
-  M("1152x900x66",  1152,  900,  94500, 1192, 1320, 1528,  902,  906,  937, HN|VN),
-  M("1152x900x76",  1152,  900, 105560, 1168, 1280, 1472,  902,  906,  943, HN|VN),
+  M("640x350x85",
+    640,  350,  31500,  672,  736,  832,  382,  385,  445, HP | VN),
+  M("640x400x85",
+    640,  400,  31500,  672,  736,  832,  401,  404,  445, HN | VP),
+  M("720x400x70",
+    720,  400,  28320,  738,  846,  900,  412,  414,  449, HN | VP),
+  M("720x400x85",
+    720,  400,  35500,  756,  828,  936,  401,  404,  446, HN | VP),
+  M("720x400x87",
+    720,  400,  35500,  738,  846,  900,  421,  423,  449, HN | VN),
+  M("640x480x60",
+    640,  480,  25175,  656,  752,  800,  490,  492,  525, HN | VN),
+  M("640x480x72",
+    640,  480,  31500,  664,  704,  832,  489,  492,  520, HN | VN),
+  M("640x480x75",
+    640,  480,  31500,  656,  720,  840,  481,  484,  500, HN | VN),
+  M("640x480x85",
+    640,  480,  36000,  696,  752,  832,  481,  484,  509, HN | VN),
+  M("800x600x56",
+    800,  600,  36000,  824,  896, 1024,  601,  603,  625, HP | VP),
+  M("800x600x60",
+    800,  600,  40000,  840,  968, 1056,  601,  605,  628, HP | VP),
+  M("800x600x72",
+    800,  600,  50000,  856,  976, 1040,  637,  643,  666, HP | VP),
+  M("800x600x75",
+    800,  600,  49500,  816,  896, 1056,  601,  604,  625, HP | VP),
+  M("800x600x85",
+    800,  600,  56250,  832,  896, 1048,  601,  604,  631, HP | VP),
+  M("1024x768x87i",
+    1024,  768,  44900, 1032, 1208, 1264,  768,  776,  817, HP | VP | I),
+  M("1024x768x60",
+    1024,  768,  65000, 1048, 1184, 1344,  771,  777,  806, HN | VN),
+  M("1024x768x70",
+    1024,  768,  75000, 1048, 1184, 1328,  771,  777,  806, HN | VN),
+  M("1024x768x75",
+    1024,  768,  78750, 1040, 1136, 1312,  769,  772,  800, HP | VP),
+  M("1024x768x85",
+    1024,  768,  94500, 1072, 1168, 1376,  769,  772,  808, HP | VP),
+  M("1024x768x89",
+    1024,  768, 100000, 1108, 1280, 1408,  768,  780,  796, HP | VP),
+  M("1152x864x75",
+    1152,  864, 108000, 1216, 1344, 1600,  865,  868,  900, HP | VP),
+  M("1280x768x75",
+    1280,  768, 105640, 1312, 1712, 1744,  782,  792,  807, HN | VP),
+  M("1280x960x60",
+    1280,  960, 108000, 1376, 1488, 1800,  961,  964, 1000, HP | VP),
+  M("1280x960x85",
+    1280,  960, 148500, 1344, 1504, 1728,  961,  964, 1011, HP | VP),
+  M("1280x1024x60",
+    1280, 1024, 108000, 1328, 1440, 1688, 1025, 1028, 1066, HP | VP),
+  M("1280x1024x70",
+    1280, 1024, 126000, 1328, 1440, 1688, 1025, 1028, 1066, HP | VP),
+  M("1280x1024x75",
+    1280, 1024, 135000, 1296, 1440, 1688, 1025, 1028, 1066, HP | VP),
+  M("1280x1024x85",
+    1280, 1024, 157500, 1344, 1504, 1728, 1025, 1028, 1072, HP | VP),
+  M("1600x1200x60",
+    1600, 1200, 162000, 1664, 1856, 2160, 1201, 1204, 1250, HP | VP),
+  M("1600x1200x65",
+    1600, 1200, 175500, 1664, 1856, 2160, 1201, 1204, 1250, HP | VP),
+  M("1600x1200x70",
+    1600, 1200, 189000, 1664, 1856, 2160, 1201, 1204, 1250, HP | VP),
+  M("1600x1200x75",
+    1600, 1200, 202500, 1664, 1856, 2160, 1201, 1204, 1250, HP | VP),
+  M("1600x1200x85",
+    1600, 1200, 229500, 1664, 1856, 2160, 1201, 1204, 1250, HP | VP),
+  M("1680x1050x60",
+    1680, 1050, 147140, 1784, 1968, 2256, 1051, 1054, 1087, HP | VP),
+  M("1792x1344x60",
+    1792, 1344, 204800, 1920, 2120, 2448, 1345, 1348, 1394, HN | VP),
+  M("1792x1344x75",
+    1792, 1344, 261000, 1888, 2104, 2456, 1345, 1348, 1417, HN | VP),
+  M("1856x1392x60",
+    1856, 1392, 218300, 1952, 2176, 2528, 1393, 1396, 1439, HN | VP),
+  M("1856x1392x75",
+    1856, 1392, 288000, 1984, 2208, 2560, 1393, 1396, 1500, HN | VP),
+  M("1920x1440x60",
+    1920, 1440, 234000, 2048, 2256, 2600, 1441, 1444, 1500, HN | VP),
+  M("1920x1440x75",
+    1920, 1440, 297000, 2064, 2288, 2640, 1441, 1444, 1500, HN | VP),
+  M("832x624x74",
+    832,  624,  57284,  864,  928, 1152,  625,  628,  667, HN | VN),
+  M("1152x768x54",
+    1152,  768,  64995, 1178, 1314, 1472,  771,  777,  806, HP | VP),
+  M("1400x1050x60",
+    1400, 1050, 122000, 1488, 1640, 1880, 1052, 1064, 1082, HP | VP),
+  M("1400x1050x74",
+    1400, 1050, 155800, 1464, 1784, 1912, 1052, 1064, 1090, HP | VP),
+  M("1152x900x66",
+    1152,  900,  94500, 1192, 1320, 1528,  902,  906,  937, HN | VN),
+  M("1152x900x76",
+    1152,  900, 105560, 1168, 1280, 1472,  902,  906,  943, HN | VN),
 
   /* Derived Double Scan Modes */
 
-  M("320x175x85",    320,  175,  15750,  336,  368,  416,  191,  192,  222, HP|VN|DS),
-  M("320x200x85",    320,  200,  15750,  336,  368,  416,  200,  202,  222, HN|VP|DS),
-  M("360x200x70",    360,  200,  14160,  369,  423,  450,  206,  207,  224, HN|VP|DS),
-  M("360x200x85",    360,  200,  17750,  378,  414,  468,  200,  202,  223, HN|VP|DS),
-  M("360x200x87",    360,  200,  17750,  369,  423,  450,  210,  211,  224, HN|VN|DS),
-  M("320x240x60",    320,  240,  12587,  328,  376,  400,  245,  246,  262, HN|VN|DS),
-  M("320x240x72",    320,  240,  15750,  332,  352,  416,  244,  246,  260, HN|VN|DS),
-  M("320x240x75",    320,  240,  15750,  328,  360,  420,  240,  242,  250, HN|VN|DS),
-  M("320x240x85",    320,  240,  18000,  348,  376,  416,  240,  242,  254, HN|VN|DS),
-  M("400x300x56",    400,  300,  18000,  412,  448,  512,  300,  301,  312, HP|VP|DS),
-  M("400x300x60",    400,  300,  20000,  420,  484,  528,  300,  302,  314, HP|VP|DS),
-  M("400x300x72",    400,  300,  25000,  428,  488,  520,  318,  321,  333, HP|VP|DS),
-  M("400x300x75",    400,  300,  24750,  408,  448,  528,  300,  302,  312, HP|VP|DS),
-  M("400x300x85",    400,  300,  28125,  416,  448,  524,  300,  302,  315, HP|VP|DS),
-  M("512x384x87i",   512,  384,  22450,  516,  604,  632,  384,  388,  408, HP|VP|DS|I),
-  M("512x384x60",    512,  384,  32500,  524,  592,  672,  385,  388,  403, HN|VN|DS),
-  M("512x384x70",    512,  384,  37500,  524,  592,  664,  385,  388,  403, HN|VN|DS),
-  M("512x384x75",    512,  384,  39375,  520,  568,  656,  384,  386,  400, HP|VP|DS),
-  M("512x384x85",    512,  384,  47250,  536,  584,  688,  384,  386,  404, HP|VP|DS),
-  M("512x384x89",    512,  384,  50000,  554,  640,  704,  384,  390,  398, HP|VP|DS),
-  M("576x432x75",    576,  432,  54000,  608,  672,  800,  432,  434,  450, HP|VP|DS),
-  M("640x384x75",    640,  384,  52820,  656,  856,  872,  391,  396,  403, HN|VP|DS),
-  M("640x480x60",    640,  480,  54000,  688,  744,  900,  480,  482,  500, HP|VP|DS),
-  M("640x480x85",    640,  480,  74250,  672,  752,  864,  480,  482,  505, HP|VP|DS),
-  M("640x512x60",    640,  512,  54000,  664,  720,  844,  512,  514,  533, HP|VP|DS),
-  M("640x512x70",    640,  512,  63000,  664,  720,  844,  512,  514,  533, HP|VP|DS),
-  M("640x512x75",    640,  512,  67500,  648,  720,  844,  512,  514,  533, HP|VP|DS),
-  M("640x512x85",    640,  512,  78750,  672,  752,  864,  512,  514,  536, HP|VP|DS),
-  M("800x600x60",    800,  600,  81000,  832,  928, 1080,  600,  602,  625, HP|VP|DS),
-  M("800x600x65",    800,  600,  87750,  832,  928, 1080,  600,  602,  625, HP|VP|DS),
-  M("800x600x70",    800,  600,  94500,  832,  928, 1080,  600,  602,  625, HP|VP|DS),
-  M("800x600x75",    800,  600, 101250,  832,  928, 1080,  600,  602,  625, HP|VP|DS),
-  M("800x600x85",    800,  600, 114750,  832,  928, 1080,  600,  602,  625, HP|VP|DS),
-  M("840x525x60",    840,  525,  73570,  892,  984, 1128,  525,  527,  543, HP|VP|DS),
-  M("896x672x60",    896,  672, 102400,  960, 1060, 1224,  672,  674,  697, HN|VP|DS),
-  M("896x672x75",    896,  672, 130500,  944, 1052, 1228,  672,  674,  708, HN|VP|DS),
-  M("928x696x60",    928,  696, 109150,  976, 1088, 1264,  696,  698,  719, HN|VP|DS),
-  M("928x696x75",    928,  696, 144000,  992, 1104, 1280,  696,  698,  750, HN|VP|DS),
-  M("960x720x60",    960,  720, 117000, 1024, 1128, 1300,  720,  722,  750, HN|VP|DS),
-  M("960x720x75",    960,  720, 148500, 1032, 1144, 1320,  720,  722,  750, HN|VP|DS),
-  M("416x312x74",    416,  312,  28642,  432,  464,  576,  312,  314,  333, HN|VN|DS),
-  M("576x384x54",    576,  384,  32497,  589,  657,  736,  385,  388,  403, HP|VP|DS),
-  M("700x525x60",    700,  525,  61000,  744,  820,  940,  526,  532,  541, HP|VP|DS),
-  M("700x525x74",    700,  525,  77900,  732,  892,  956,  526,  532,  545, HP|VP|DS),
-  M("576x450x66",    576,  450,  47250,  596,  660,  764,  451,  453,  468, HN|VN|DS),
-  M("576x450x76",    576,  450,  52780,  584,  640,  736,  451,  453,  471, HN|VN|DS),
+  M("320x175x85",
+    320,  175,  15750,  336,  368,  416,  191,  192,  222, HP | VN | DS),
+  M("320x200x85",
+    320,  200,  15750,  336,  368,  416,  200,  202,  222, HN | VP | DS),
+  M("360x200x70",
+    360,  200,  14160,  369,  423,  450,  206,  207,  224, HN | VP | DS),
+  M("360x200x85",
+    360,  200,  17750,  378,  414,  468,  200,  202,  223, HN | VP | DS),
+  M("360x200x87",
+    360,  200,  17750,  369,  423,  450,  210,  211,  224, HN | VN | DS),
+  M("320x240x60",
+    320,  240,  12587,  328,  376,  400,  245,  246,  262, HN | VN | DS),
+  M("320x240x72",
+    320,  240,  15750,  332,  352,  416,  244,  246,  260, HN | VN | DS),
+  M("320x240x75",
+    320,  240,  15750,  328,  360,  420,  240,  242,  250, HN | VN | DS),
+  M("320x240x85",
+    320,  240,  18000,  348,  376,  416,  240,  242,  254, HN | VN | DS),
+  M("400x300x56",
+    400,  300,  18000,  412,  448,  512,  300,  301,  312, HP | VP | DS),
+  M("400x300x60",
+    400,  300,  20000,  420,  484,  528,  300,  302,  314, HP | VP | DS),
+  M("400x300x72",
+    400,  300,  25000,  428,  488,  520,  318,  321,  333, HP | VP | DS),
+  M("400x300x75",
+    400,  300,  24750,  408,  448,  528,  300,  302,  312, HP | VP | DS),
+  M("400x300x85",
+    400,  300,  28125,  416,  448,  524,  300,  302,  315, HP | VP | DS),
+  M("512x384x87i",
+    512,  384,  22450,  516,  604,  632,  384,  388,  408, HP | VP | DS | I),
+  M("512x384x60",
+    512,  384,  32500,  524,  592,  672,  385,  388,  403, HN | VN | DS),
+  M("512x384x70",
+    512,  384,  37500,  524,  592,  664,  385,  388,  403, HN | VN | DS),
+  M("512x384x75",
+    512,  384,  39375,  520,  568,  656,  384,  386,  400, HP | VP | DS),
+  M("512x384x85",
+    512,  384,  47250,  536,  584,  688,  384,  386,  404, HP | VP | DS),
+  M("512x384x89",
+    512,  384,  50000,  554,  640,  704,  384,  390,  398, HP | VP | DS),
+  M("576x432x75",
+    576,  432,  54000,  608,  672,  800,  432,  434,  450, HP | VP | DS),
+  M("640x384x75",
+    640,  384,  52820,  656,  856,  872,  391,  396,  403, HN | VP | DS),
+  M("640x480x60",
+    640,  480,  54000,  688,  744,  900,  480,  482,  500, HP | VP | DS),
+  M("640x480x85",
+    640,  480,  74250,  672,  752,  864,  480,  482,  505, HP | VP | DS),
+  M("640x512x60",
+    640,  512,  54000,  664,  720,  844,  512,  514,  533, HP | VP | DS),
+  M("640x512x70",
+    640,  512,  63000,  664,  720,  844,  512,  514,  533, HP | VP | DS),
+  M("640x512x75",
+    640,  512,  67500,  648,  720,  844,  512,  514,  533, HP | VP | DS),
+  M("640x512x85",
+    640,  512,  78750,  672,  752,  864,  512,  514,  536, HP | VP | DS),
+  M("800x600x60",
+    800,  600,  81000,  832,  928, 1080,  600,  602,  625, HP | VP | DS),
+  M("800x600x65",
+    800,  600,  87750,  832,  928, 1080,  600,  602,  625, HP | VP | DS),
+  M("800x600x70",
+    800,  600,  94500,  832,  928, 1080,  600,  602,  625, HP | VP | DS),
+  M("800x600x75",
+    800,  600, 101250,  832,  928, 1080,  600,  602,  625, HP | VP | DS),
+  M("800x600x85",
+    800,  600, 114750,  832,  928, 1080,  600,  602,  625, HP | VP | DS),
+  M("840x525x60",
+    840,  525,  73570,  892,  984, 1128,  525,  527,  543, HP | VP | DS),
+  M("896x672x60",
+    896,  672, 102400,  960, 1060, 1224,  672,  674,  697, HN | VP | DS),
+  M("896x672x75",
+    896,  672, 130500,  944, 1052, 1228,  672,  674,  708, HN | VP | DS),
+  M("928x696x60",
+    928,  696, 109150,  976, 1088, 1264,  696,  698,  719, HN | VP | DS),
+  M("928x696x75",
+    928,  696, 144000,  992, 1104, 1280,  696,  698,  750, HN | VP | DS),
+  M("960x720x60",
+    960,  720, 117000, 1024, 1128, 1300,  720,  722,  750, HN | VP | DS),
+  M("960x720x75",
+    960,  720, 148500, 1032, 1144, 1320,  720,  722,  750, HN | VP | DS),
+  M("416x312x74",
+    416,  312,  28642,  432,  464,  576,  312,  314,  333, HN | VN | DS),
+  M("576x384x54",
+    576,  384,  32497,  589,  657,  736,  385,  388,  403, HP | VP | DS),
+  M("700x525x60",
+    700,  525,  61000,  744,  820,  940,  526,  532,  541, HP | VP | DS),
+  M("700x525x74",
+    700,  525,  77900,  732,  892,  956,  526,  532,  545, HP | VP | DS),
+  M("576x450x66",
+    576,  450,  47250,  596,  660,  764,  451,  453,  468, HN | VN | DS),
+  M("576x450x76",
+    576,  450,  52780,  584,  640,  736,  451,  453,  471, HN | VN | DS),
 };
 
 static const int g_nvideomodes = 46;
diff --git a/video/videomode/videomode_sort.c b/video/videomode/videomode_sort.c
index 0d2cd80..b9bafb1 100644
--- a/video/videomode/videomode_sort.c
+++ b/video/videomode/videomode_sort.c
@@ -202,7 +202,8 @@ void sort_videomodes(FAR struct videomode_s *modes,
                   tmpmode = &modes[i];
                 }
 
-              if (atemp == abest || _abs(abest - atemp) <= (abest / 8))
+              if (atemp == abest ||
+                  _abs(abest - atemp) <= (abest / 8))
                 {
                   if (modes[i].hdisplay > hbest)
                     {
@@ -210,7 +211,8 @@ void sort_videomodes(FAR struct videomode_s *modes,
                       tmpmode = &modes[i];
                     }
 
-                  if (modes[i].hdisplay == hbest && modes[i].vdisplay > vbest)
+                  if (modes[i].hdisplay ==
+                      hbest && modes[i].vdisplay > vbest)
                     {
                       vbest = modes[i].vdisplay;
                       tmpmode = &modes[i];