You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2020/12/08 18:58:50 UTC

[incubator-nuttx] branch master updated (33125e9 -> 21271c4)

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

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


    from 33125e9  stm32f103-minimum: add Android Debug Bridge defconfig
     new cd41ed9  fs: fully parenthesize MIN and MAX macros
     new 7bc7b61  arch/arm/src/lc823450: fully parenthesize MIN and MAX macros
     new 6626699  drivers/power/bq769x0.c: fully parenthesize MIN and MAX macros
     new 21271c4  libs/libc/string/lib_strcspn.c: fix function name in comment

The 4 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:
 arch/arm/src/lc823450/lc823450_mpuinit2.c    |  4 ++--
 arch/arm/src/lc823450/lc823450_procfs_dvfs.c |  5 +++--
 arch/arm/src/lc823450/lc823450_serial.c      |  6 +-----
 arch/arm/src/lc823450/lc823450_spi.c         |  2 +-
 arch/arm/src/lc823450/lc823450_usbdev.c      |  6 +-----
 drivers/power/bq769x0.c                      |  5 +----
 fs/fat/fs_fat32.h                            | 14 --------------
 fs/fat/fs_fat32dirent.c                      |  8 ++++++++
 fs/hostfs/hostfs.h                           | 10 ----------
 fs/nxffs/nxffs.h                             |  4 ++--
 fs/procfs/fs_procfsutil.c                    | 13 +++++--------
 fs/smartfs/smartfs.h                         | 10 ----------
 libs/libc/string/lib_strcspn.c               |  4 ++--
 13 files changed, 26 insertions(+), 65 deletions(-)


[incubator-nuttx] 03/04: drivers/power/bq769x0.c: fully parenthesize MIN and MAX macros

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

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

commit 6626699ec76c4f86a33b0060255c70f0d6c44f24
Author: Juha Niskanen <ju...@haltian.com>
AuthorDate: Tue Dec 8 18:34:25 2020 +0200

    drivers/power/bq769x0.c: fully parenthesize MIN and MAX macros
    
    Signed-off-by: Juha Niskanen <ju...@haltian.com>
---
 drivers/power/bq769x0.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/power/bq769x0.c b/drivers/power/bq769x0.c
index 882f51a..19920ff 100644
--- a/drivers/power/bq769x0.c
+++ b/drivers/power/bq769x0.c
@@ -65,10 +65,7 @@
 /* Helpers ******************************************************************/
 
 #ifndef MIN
-#  define MIN(a,b) (a < b ? a : b)
-#endif
-#ifndef MAX
-#  define MAX(a,b) (a > b ? a : b)
+#  define MIN(a,b) ((a) < (b) ? (a) : (b))
 #endif
 
 /* The CRC function expects to see address bytes as they appear on the wire */


[incubator-nuttx] 02/04: arch/arm/src/lc823450: fully parenthesize MIN and MAX macros

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

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

commit 7bc7b611d693ae3b1cc1befc45c0b6bc42b30def
Author: Juha Niskanen <ju...@haltian.com>
AuthorDate: Tue Dec 8 18:33:49 2020 +0200

    arch/arm/src/lc823450: fully parenthesize MIN and MAX macros
    
    Signed-off-by: Juha Niskanen <ju...@haltian.com>
---
 arch/arm/src/lc823450/lc823450_mpuinit2.c    | 4 ++--
 arch/arm/src/lc823450/lc823450_procfs_dvfs.c | 5 +++--
 arch/arm/src/lc823450/lc823450_serial.c      | 6 +-----
 arch/arm/src/lc823450/lc823450_spi.c         | 2 +-
 arch/arm/src/lc823450/lc823450_usbdev.c      | 6 +-----
 5 files changed, 8 insertions(+), 15 deletions(-)

diff --git a/arch/arm/src/lc823450/lc823450_mpuinit2.c b/arch/arm/src/lc823450/lc823450_mpuinit2.c
index 51f71aa..f40cc86 100644
--- a/arch/arm/src/lc823450/lc823450_mpuinit2.c
+++ b/arch/arm/src/lc823450/lc823450_mpuinit2.c
@@ -39,11 +39,11 @@
  ****************************************************************************/
 
 #ifndef MAX
-#  define MAX(a,b) a > b ? a : b
+#  define MAX(a,b) ((a) > (b) ? (a) : (b))
 #endif
 
 #ifndef MIN
-#  define MIN(a,b) a < b ? a : b
+#  define MIN(a,b) ((a) < (b) ? (a) : (b))
 #endif
 
 /****************************************************************************
diff --git a/arch/arm/src/lc823450/lc823450_procfs_dvfs.c b/arch/arm/src/lc823450/lc823450_procfs_dvfs.c
index bd3e597..8d5d6ce 100644
--- a/arch/arm/src/lc823450/lc823450_procfs_dvfs.c
+++ b/arch/arm/src/lc823450/lc823450_procfs_dvfs.c
@@ -56,7 +56,7 @@
 #define DVFS_LINELEN  128
 
 #ifndef MIN
-#  define MIN(a,b) (a < b ? a : b)
+#  define MIN(a,b) ((a) < (b) ? (a) : (b))
 #endif
 
 #ifndef CONFIG_SMP_NCPUS
@@ -286,7 +286,8 @@ static ssize_t dvfs_write(FAR struct file *filep, FAR const char *buffer,
   strncpy(line, buffer, n);
   line[n] = '\0';
 
-  n = MIN(strcspn(line, " "), sizeof(cmd) - 1);
+  n = strcspn(line, " ");
+  n = MIN(n, sizeof(cmd) - 1);
   strncpy(cmd, line, n);
   cmd[n] = '\0';
 
diff --git a/arch/arm/src/lc823450/lc823450_serial.c b/arch/arm/src/lc823450/lc823450_serial.c
index 6e83ee1..03a06ad 100644
--- a/arch/arm/src/lc823450/lc823450_serial.c
+++ b/arch/arm/src/lc823450/lc823450_serial.c
@@ -141,12 +141,8 @@ int g_console_disable;
 #  define HS_DMAACT_ACT2      3
 #endif
 
-#ifndef MAX
-#define MAX(a, b) ((a) > (b) ? a : b)
-#endif
-
 #ifndef MIN
-#define MIN(a, b) ((a) > (b) ? b : a)
+#  define MIN(a, b) ((a) > (b) ? (b) : (a))
 #endif
 
 /****************************************************************************
diff --git a/arch/arm/src/lc823450/lc823450_spi.c b/arch/arm/src/lc823450/lc823450_spi.c
index 2a99d6d..8781c50 100644
--- a/arch/arm/src/lc823450/lc823450_spi.c
+++ b/arch/arm/src/lc823450/lc823450_spi.c
@@ -53,7 +53,7 @@
 #endif
 
 #ifndef MIN
-#  define MIN(a, b) ((a) > (b) ? b : a)
+#  define MIN(a, b) ((a) > (b) ? (b) : (a))
 #endif
 
 /****************************************************************************
diff --git a/arch/arm/src/lc823450/lc823450_usbdev.c b/arch/arm/src/lc823450/lc823450_usbdev.c
index 4d603a0..8c8bd24 100644
--- a/arch/arm/src/lc823450/lc823450_usbdev.c
+++ b/arch/arm/src/lc823450/lc823450_usbdev.c
@@ -75,11 +75,7 @@
 
 #ifndef MIN
 #  define MIN(a, b) ((a) > (b) ? (b) : (a))
-#endif /* MIN */
-
-#ifndef MAX
-#  define MAX(a, b) ((a) > (b) ? (a) : (b))
-#endif /* MIN */
+#endif
 
 #if 0
 #  define DPRINTF(fmt, args...) uinfo(fmt, ##args)


[incubator-nuttx] 01/04: fs: fully parenthesize MIN and MAX macros

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

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

commit cd41ed9b6d8b968d535ba50ed0bbacb1ab314952
Author: Juha Niskanen <ju...@haltian.com>
AuthorDate: Tue Dec 8 18:29:58 2020 +0200

    fs: fully parenthesize MIN and MAX macros
    
    Signed-off-by: Juha Niskanen <ju...@haltian.com>
---
 fs/fat/fs_fat32.h         | 14 --------------
 fs/fat/fs_fat32dirent.c   |  8 ++++++++
 fs/hostfs/hostfs.h        | 10 ----------
 fs/nxffs/nxffs.h          |  4 ++--
 fs/procfs/fs_procfsutil.c | 13 +++++--------
 fs/smartfs/smartfs.h      | 10 ----------
 6 files changed, 15 insertions(+), 44 deletions(-)

diff --git a/fs/fat/fs_fat32.h b/fs/fat/fs_fat32.h
index c88179d..f646b1a 100644
--- a/fs/fat/fs_fat32.h
+++ b/fs/fat/fs_fat32.h
@@ -983,20 +983,6 @@ struct fat_dirinfo_s
   struct fs_fatdir_s dir;          /* Used with opendir, readdir, etc. */
 };
 
-/* Generic helper macros ****************************************************/
-
-#ifndef MIN
-#  define MIN(a,b) (a < b ? a : b)
-#endif
-
-#ifndef MAX
-#  define MAX(a,b) (a > b ? a : b)
-#endif
-
-/****************************************************************************
- * Public Data
- ****************************************************************************/
-
 /****************************************************************************
  * Public Function Prototypes
  ****************************************************************************/
diff --git a/fs/fat/fs_fat32dirent.c b/fs/fat/fs_fat32dirent.c
index 8ba2aae..f8a7d58 100644
--- a/fs/fat/fs_fat32dirent.c
+++ b/fs/fat/fs_fat32dirent.c
@@ -72,6 +72,14 @@
 #include "fs_fat32.h"
 
 /****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#ifndef MIN
+#  define MIN(a,b) ((a) < (b) ? (a) : (b))
+#endif
+
+/****************************************************************************
  * Private Types
  ****************************************************************************/
 
diff --git a/fs/hostfs/hostfs.h b/fs/hostfs/hostfs.h
index 47053b2..a796d4e 100644
--- a/fs/hostfs/hostfs.h
+++ b/fs/hostfs/hostfs.h
@@ -52,16 +52,6 @@
  * Pre-processor Definitions
  ****************************************************************************/
 
-/* Quasi-standard definitions */
-
-#ifndef MIN
-#  define MIN(a,b)          (a < b ? a : b)
-#endif
-
-#ifndef MAX
-#  define MAX(a,b)          (a > b ? a : b)
-#endif
-
 #define HOSTFS_MAX_PATH     256
 
 /****************************************************************************
diff --git a/fs/nxffs/nxffs.h b/fs/nxffs/nxffs.h
index 610af72..1f9866d 100644
--- a/fs/nxffs/nxffs.h
+++ b/fs/nxffs/nxffs.h
@@ -191,11 +191,11 @@
 /* Quasi-standard definitions */
 
 #ifndef MIN
-#  define MIN(a,b)                (a < b ? a : b)
+#  define MIN(a,b)                ((a) < (b) ? (a) : (b))
 #endif
 
 #ifndef MAX
-#  define MAX(a,b)                (a > b ? a : b)
+#  define MAX(a,b)                ((a) > (b) ? (a) : (b))
 #endif
 
 /****************************************************************************
diff --git a/fs/procfs/fs_procfsutil.c b/fs/procfs/fs_procfsutil.c
index 9dd4f53..dbf7987 100644
--- a/fs/procfs/fs_procfsutil.c
+++ b/fs/procfs/fs_procfsutil.c
@@ -51,11 +51,7 @@
  ****************************************************************************/
 
 #ifndef MIN
-#  define MIN(a,b) ((a < b) ? a : b)
-#endif
-
-#ifndef MAX
-#  define MAX(a,b) ((a > b) ? a : b)
+#  define MIN(a,b) ((a) < (b) ? (a) : (b))
 #endif
 
 /****************************************************************************
@@ -78,9 +74,10 @@
  *
  *   procfs_memcpy() is a helper function.  Each read() method should
  *   provide data in a local data buffer ('src' and 'srclen').  This
- *   will transfer the data to the user receive buffer ('dest' and 'destlen'),
- *   respecting both (1) the size of the destination buffer so that it will
- *   write beyond the user receiver and (1) the file position, 'offset'.
+ *   will transfer the data to the user receive buffer ('dest' and
+ *   'destlen'), respecting both (1) the size of the destination buffer so
+ *   that it will write beyond the user receiver and (1) the file position,
+ *   'offset'.
  *
  *   This function will skip over data until the under of bytes specified
  *   by 'offset' have been skipped.  Then it will transfer data from the
diff --git a/fs/smartfs/smartfs.h b/fs/smartfs/smartfs.h
index 3b887ff..f1ed3bb 100644
--- a/fs/smartfs/smartfs.h
+++ b/fs/smartfs/smartfs.h
@@ -176,16 +176,6 @@
 
 #define SMART_MAGICSIZE           4
 
-/* Quasi-standard definitions */
-
-#ifndef MIN
-#  define MIN(a,b)                (a < b ? a : b)
-#endif
-
-#ifndef MAX
-#  define MAX(a,b)                (a > b ? a : b)
-#endif
-
 /* Underlying MTD Block driver access functions */
 
 #define FS_BOPS(f)        (f)->fs_blkdriver->u.i_bops


[incubator-nuttx] 04/04: libs/libc/string/lib_strcspn.c: fix function name in comment

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

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

commit 21271c44b72640901982d127c99163eaf4c10e75
Author: Juha Niskanen <ju...@haltian.com>
AuthorDate: Tue Dec 8 18:34:49 2020 +0200

    libs/libc/string/lib_strcspn.c: fix function name in comment
    
    Signed-off-by: Juha Niskanen <ju...@haltian.com>
---
 libs/libc/string/lib_strcspn.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libs/libc/string/lib_strcspn.c b/libs/libc/string/lib_strcspn.c
index 431d8d4..711afcc 100644
--- a/libs/libc/string/lib_strcspn.c
+++ b/libs/libc/string/lib_strcspn.c
@@ -49,8 +49,8 @@
  * Name: strcspn
  *
  * Description:
- *  strspn() calculates the length of the initial segment of s which
- *  consists entirely of characters not in reject
+ *  strcspn() calculates the length of the initial segment of s which
+ *  consists entirely of characters not in reject.
  *
  ****************************************************************************/