On 10/24/18 07:12, Li Qiang wrote:
> Also remove unnecessary 'res' variable.
> 
> Signed-off-by: Li Qiang <liq...@gmail.com>
> ---
>  hw/nvram/fw_cfg.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
> index 946f765..f4a52d8 100644
> --- a/hw/nvram/fw_cfg.c
> +++ b/hw/nvram/fw_cfg.c
> @@ -68,15 +68,14 @@ static char *read_splashfile(char *filename, gsize 
> *file_sizep,
>                               int *file_typep)
>  {
>      GError *err = NULL;
> -    gboolean res;
>      gchar *content;
>      int file_type;
>      unsigned int filehead;
>      int bmp_bpp;
>  
> -    res = g_file_get_contents(filename, &content, file_sizep, &err);
> -    if (res == FALSE) {
> -        error_report("failed to read splash file '%s'", filename);
> +    if (!g_file_get_contents(filename, &content, file_sizep, &err)) {
> +        error_report("failed to read splash file '%s', %s",
> +                     filename, err->message);
>          g_error_free(err);
>          return NULL;
>      }
> 

Seems to be OK, according to
<https://developer.gnome.org/glib/stable/glib-Error-Reporting.html#glib-Error-Reporting.description>.

Reviewed-by: Laszlo Ersek <ler...@redhat.com>

Reply via email to