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

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


The following commit(s) were added to refs/heads/master by this push:
     new e511d3b61b7 fs/procfs: Print the uptime with integers in all 
configurations.
e511d3b61b7 is described below

commit e511d3b61b72089316b0c49aa0fb14252cb771f2
Author: Marco Casaroli <[email protected]>
AuthorDate: Thu Nov 5 18:13:25 2026 +0100

    fs/procfs: Print the uptime with integers in all configurations.
    
    With CONFIG_LIBC_FLOATINGPOINT on, /proc/uptime computed its one number in
    double.  On a CPU with no FPU this pulls in soft-float code that the rest of
    the image may not need.  The integer path gives the same format: 7 digits,
    a point and 2 digits.
    
    Delete the double path, so that all configurations use the integer path.
    
    Assisted-by: Claude Code:claude-opus-5-5
    Signed-off-by: Marco Casaroli <[email protected]>
---
 fs/procfs/fs_procfsuptime.c | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/fs/procfs/fs_procfsuptime.c b/fs/procfs/fs_procfsuptime.c
index 4188a1941fd..55b67e33f2c 100644
--- a/fs/procfs/fs_procfsuptime.c
+++ b/fs/procfs/fs_procfsuptime.c
@@ -191,14 +191,9 @@ static ssize_t uptime_read(FAR struct file *filep, FAR 
char *buffer,
   off_t offset;
   ssize_t ret;
   clock_t ticktime;
-
-#if defined(CONFIG_HAVE_DOUBLE) && defined(CONFIG_LIBC_FLOATINGPOINT)
-  double now;
-#else
   uint64_t sec;
   unsigned int remainder;
   unsigned int csec;
-#endif
 
   finfo("buffer=%p buflen=%d\n", buffer, (int)buflen);
 
@@ -220,14 +215,6 @@ static ssize_t uptime_read(FAR struct file *filep, FAR 
char *buffer,
 
       ticktime = clock_systime_ticks() - INITIAL_SYSTEM_TIMER_TICKS;
 
-#if defined(CONFIG_HAVE_DOUBLE) && defined(CONFIG_LIBC_FLOATINGPOINT)
-      /* Convert the up time to a seconds + hundredths of seconds string */
-
-      now       = (double)ticktime / (double)CLK_TCK;
-      linesize  = procfs_snprintf(attr->line, UPTIME_LINELEN,
-                                  "%10.2f\n", now);
-
-#else
       /* Convert the system up time to seconds + hundredths of seconds */
 
       sec       = ticktime / CLK_TCK;
@@ -249,7 +236,6 @@ static ssize_t uptime_read(FAR struct file *filep, FAR char 
*buffer,
       linesize = procfs_snprintf(attr->line, UPTIME_LINELEN,
                                  "%7" PRIu64 ".%02u\n", sec, csec);
 
-#endif
       /* Save the linesize in case we are re-entered with f_pos > 0 */
 
       attr->linesize = linesize;

Reply via email to