On (Mon) 22 Jul 2013 [23:41:00], Dan Carpenter wrote:
> The PTR_ERR(NULL) here is not useful.
> 
> Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com>
> ---
> v2: completely different
> 
> diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
> index 1b456fe..4cf46d8 100644
> --- a/drivers/char/virtio_console.c
> +++ b/drivers/char/virtio_console.c
> @@ -2215,10 +2215,8 @@ static int __init init(void)
>       }
>  
>       pdrvdata.debugfs_dir = debugfs_create_dir("virtio-ports", NULL);
> -     if (!pdrvdata.debugfs_dir) {
> -             pr_warning("Error %ld creating debugfs dir for virtio-ports\n",
> -                        PTR_ERR(pdrvdata.debugfs_dir));
> -     }
> +     if (!pdrvdata.debugfs_dir)
> +             pr_warning("Error creating debugfs dir for virtio-ports\n");

When debugfs is enabled and creating the dir fails, we'll print this
warning message.

When debugfs is disabled, we'll get an error return, and not print any
message.

Seems OK to me.

Reviewed-by: Amit Shah <amit.s...@redhat.com>

Rusty, please pick this up.

                Amit
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Reply via email to