xiaoxiang781216 commented on code in PR #4040:
URL: https://github.com/apache/nuttx-apps/pull/4040#discussion_r4558551201


##########
system/dd/dd_main.c:
##########
@@ -515,9 +515,13 @@ int main(int argc, FAR char **argv)
 
   fprintf(stderr, "%" PRIu64 " bytes (%" PRIu32 " blocks) copied, %u usec, ",
          total, sector, (unsigned int)elapsed);
-  fprintf(stderr, "%u KB/s\n" ,
-         (unsigned int)(((double)total / 1024)
-         / ((double)elapsed / USEC_PER_SEC)));
+
+  /* KB/s in integer arithmetic: the doubles pull the whole floating
+   * point library into the image.
+   */
+
+  fprintf(stderr, "%u KB/s\n",
+         (unsigned int)(total * USEC_PER_SEC / 1024) / elapsed);

Review Comment:
   remove the cast



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to