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

Re: [PATCH] mini-os: console.c: Rename static variable from buf to __print_buf



Costin Lupu, le mar. 18 août 2020 16:44:06 +0300, a ecrit:
> lwip soure code also has a static variable called 'buf' in ip_frag.c. This can
> get confusing when inspecting the binary (e.g. with objdump or something
> similar). Therefore this patch renames the 'buf' variable used by print()
> function to '__print_buf'.
> 
> Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx>

Reviewed-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxx>

> ---
>  console/console.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/console/console.c b/console/console.c
> index 9ddae9d..af1a6dd 100644
> --- a/console/console.c
> +++ b/console/console.c
> @@ -122,21 +122,21 @@ void console_print(struct consfront_dev *dev, char 
> *data, int length)
>  
>  void print(int direct, const char *fmt, va_list args)
>  {
> -    static char   buf[1024];
> +    static char __print_buf[1024];
>      
> -    (void)vsnprintf(buf, sizeof(buf), fmt, args);
> +    (void)vsnprintf(__print_buf, sizeof(__print_buf), fmt, args);
>  
>      if(direct)
>      {
> -        (void)HYPERVISOR_console_io(CONSOLEIO_write, strlen(buf), buf);
> +        (void)HYPERVISOR_console_io(CONSOLEIO_write, strlen(__print_buf), 
> __print_buf);
>          return;
>      } else {
>  #ifndef CONFIG_USE_XEN_CONSOLE
>      if(!console_initialised)
>  #endif    
> -            (void)HYPERVISOR_console_io(CONSOLEIO_write, strlen(buf), buf);
> +            (void)HYPERVISOR_console_io(CONSOLEIO_write, 
> strlen(__print_buf), __print_buf);
>          
> -        console_print(NULL, buf, strlen(buf));
> +        console_print(NULL, __print_buf, strlen(__print_buf));
>      }
>  }
>  
> -- 
> 2.20.1
> 

-- 
Samuel
<c> xlnt comme sujet de stage je peux essayer de donner une description 
formelle de automake
 -+- #ens-mim -+-



 


Rackspace

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