On 14/03/2019 14:33, Jan Beulich wrote:
>>>> On 14.03.19 at 10:37, <jgr...@suse.com> wrote:
>> --- a/xen/drivers/char/console.c
>> +++ b/xen/drivers/char/console.c
>> @@ -1225,13 +1225,28 @@ void debugtrace_dump(void)
>>      watchdog_enable();
>>  }
>>  
>> +static void debugtrace_add_to_buf(char *buf)
>> +{
>> +    char *p;
>> +
>> +    for ( p = buf; *p != '\0'; p++ )
>> +    {
>> +        debugtrace_buf[debugtrace_prd++] = *p;
>> +        /* Always leave a nul byte at the end of the buffer. */
>> +        if ( debugtrace_prd == (debugtrace_bytes - 1) )
>> +            debugtrace_prd = 0;
>> +    }
>> +}
>> +
>>  void debugtrace_printk(const char *fmt, ...)
>>  {
>> -    static char    buf[1024];
>> -    static u32 count;
>> +    static char buf[1024];
>> +    static char last_buf[1024];
>> +    static u32 count, last_count;
> 
> Please change to uint32_t or even better simply to unsigned int.

Okay.

> 
>> @@ -1243,25 +1258,32 @@ void debugtrace_printk(const char *fmt, ...)
>>  
>>      ASSERT(debugtrace_buf[debugtrace_bytes - 1] == 0);
>>  
>> -    snprintf(buf, sizeof(buf), "%u ", ++count);
>> -
>>      va_start(args, fmt);
>> -    (void)vsnprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), fmt, 
>> args);
>> +    (void)vsnprintf(buf, sizeof(buf), fmt, args);
> 
> Please take the opportunity and drop the stray cast.

Will do.


Juergen

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to