[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen staging] xen/console: debugtrace: Compute the buffer length is O(1) rather O(n)



commit a1dc65aaf470fa01f394e01ab6747d135961a0ae
Author:     Julien Grall <julien.grall@xxxxxxx>
AuthorDate: Wed Aug 21 22:19:17 2019 +0100
Commit:     Julien Grall <julien.grall@xxxxxxx>
CommitDate: Wed Aug 21 22:19:17 2019 +0100

    xen/console: debugtrace: Compute the buffer length is O(1) rather O(n)
    
    This was meant to be part of commit e0bf98394e "xen/console: Fix build
    when CONFIG_DEBUG_TRACE" but not addressed before been committed.
    
    Signed-off-by: Julien Grall <julien.grall@xxxxxxx>
    Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 xen/drivers/char/console.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index 75e493466e..d67e1993f2 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -1187,7 +1187,7 @@ static void debugtrace_dump_worker(void)
     ASSERT(debugtrace_buf[debugtrace_bytes - 1] == 0);
     if ( debugtrace_buf[debugtrace_prd] != '\0' )
         sercon_puts(&debugtrace_buf[debugtrace_prd],
-                    strlen(&debugtrace_buf[debugtrace_prd]));
+                    debugtrace_bytes - debugtrace_prd - 1);
 
     /* Print youngest portion of the ring. */
     debugtrace_buf[debugtrace_prd] = '\0';
--
generated by git-patchbot for /home/xen/git/xen.git#staging

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.