From cb064b1133c0f5a004ae6682eb6300b00538fa9b Mon Sep 17 00:00:00 2001 From: "Yang, Yu-chu" Date: Tue, 26 Jun 2018 17:54:33 -0700 Subject: [PATCH] HV: Do not return expression contains subexpression Operation should be done outside return expression. Signed-off-by: Yang, Yu-chu --- hypervisor/debug/printf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hypervisor/debug/printf.c b/hypervisor/debug/printf.c index 7c8efc169..84f3c3af3 100644 --- a/hypervisor/debug/printf.c +++ b/hypervisor/debug/printf.c @@ -23,7 +23,8 @@ static int charout(int cmd, const char *s, int sz, void *hnd) else s += console_write(s, sz); - return (*nchars += (s - p)); + *nchars += (s - p); + return *nchars; } /* fill mode */ else {