[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20141009103143.GA6787@amd>
Date: Thu, 9 Oct 2014 12:31:43 +0200
From: Pavel Machek <pavel@....cz>
To: Guenter Roeck <linux@...ck-us.net>
Cc: linux-kernel@...r.kernel.org,
adi-buildroot-devel@...ts.sourceforge.net,
devel@...verdev.osuosl.org, devicetree@...r.kernel.org,
lguest@...ts.ozlabs.org, linux-acpi@...r.kernel.org,
linux-alpha@...r.kernel.org, linux-am33-list@...hat.com,
linux-cris-kernel@...s.com, linux-efi@...r.kernel.org,
linux-hexagon@...r.kernel.org, linux-m32r-ja@...linux-m32r.org,
linuxppc-dev@...ts.ozlabs.org, linux-s390@...r.kernel.org,
linux-tegra@...r.kernel.org, linux-xtensa@...ux-xtensa.org,
openipmi-developer@...ts.sourceforge.net,
user-mode-linux-devel@...ts.sourceforge.net,
linux-arm-kernel@...ts.infradead.org, linux-c6x-dev@...ux-c6x.org,
linux-ia64@...r.kernel.org, linux-m68k@...ts.linux-m68k.org,
linux-metag@...r.kernel.org, linux-mips@...ux-mips.org,
linux-parisc@...r.kernel.org, linux-pm@...r.kernel.org,
linux-sh@...r.kernel.org, xen-devel@...ts.xenproject.org,
Andrew Morton <akpm@...ux-foundation.org>,
Heiko Stuebner <heiko@...ech.de>,
Romain Perier <romain.perier@...il.com>,
"Rafael J. Wysocki" <rjw@...ysocki.net>,
Len Brown <len.brown@...el.com>,
Alexander Graf <agraf@...e.de>,
Geert Uytterhoeven <geert@...ux-m68k.org>
Subject: Re: [PATCH 01/44] kernel: Add support for poweroff handler call chain
Hi!
> +/**
> + * register_poweroff_handler_simple - Register function to be called to power off
> + * the system
> + * @handler: Function to be called to power off the system
> + * @priority: Handler priority. For priority guidelines see
> + * register_poweroff_handler.
> + *
> + * This is a simplified version of register_poweroff_handler. It does not
> + * take a notifier as argument, but a function pointer. The function
> + * registers a poweroff handler with specified priority. Poweroff
> + * handlers registered with this function can not be unregistered,
> + * and only a single poweroff handler can be installed using it.
> + *
> + * This function must not be called from modules and is therefore
> + * not exported.
> + *
> + * Returns -EBUSY if a poweroff handler has already been registered
> + * using register_poweroff_handler_simple. Otherwise returns zero,
> + * since atomic_notifier_chain_register() currently always returns zero.
> + */
> +int register_poweroff_handler_simple(void (*handler)(void), int priority)
> +{
> + char symname[KSYM_NAME_LEN];
> +
> + if (poweroff_handler_data.handler) {
> + lookup_symbol_name((unsigned long)poweroff_handler_data.handler,
> + symname);
> + pr_warn("Poweroff function already registered (%s)", symname);
> + lookup_symbol_name((unsigned long)handler, symname);
> + pr_cont(", cannot register %s\n", symname);
> + return -EBUSY;
> + }
Dunno, are you maybe overdoing the debugging infrastructure a bit?
This is not going to happen in production, and if it does happen,
developer can look the symbol name himself.
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists