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

Re: [Xen-devel] [PATCH v2] xen/mce: don't issue error message for failed /dev/mcelog registration



* Juergen Gross <jgross@xxxxxxxx> wrote:

> When running under Xen as dom0 /dev/mcelog is being registered by Xen
> instead of the normal mcelog driver. Avoid an error message being
> issued by the mcelog driver in this case. Instead issue an informative
> message that Xen has registered the device.
> 
> Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
> ---
>  arch/x86/kernel/cpu/mcheck/dev-mcelog.c | 11 +++++++++--
>  drivers/xen/mcelog.c                    |  2 ++
>  2 files changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/x86/kernel/cpu/mcheck/dev-mcelog.c 
> b/arch/x86/kernel/cpu/mcheck/dev-mcelog.c
> index 9c632cb88546..4eb5f7d1d593 100644
> --- a/arch/x86/kernel/cpu/mcheck/dev-mcelog.c
> +++ b/arch/x86/kernel/cpu/mcheck/dev-mcelog.c
> @@ -388,9 +388,16 @@ static __init int dev_mcelog_init_device(void)
>       /* register character device /dev/mcelog */
>       err = misc_register(&mce_chrdev_device);
>       if (err) {
> -             pr_err("Unable to init device /dev/mcelog (rc: %d)\n", err);
> -             return err;
> +             if (err == -EBUSY)
> +                     /* Xen dom0 might have registered the device already. */
> +                     pr_info("Unable to init device /dev/mcelog, already 
> registered");
> +             else {
> +                     pr_err("Unable to init device /dev/mcelog (rc: %d)\n",
> +                            err);
> +                     return err;
> +             }

Please only use balanced curly braces in conditional statements.

Thanks,

        Ingo

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

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