lkml.org 
[lkml]   [2005]   [Apr]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC/PATCH] unregister_node() for hotplug use
On Fri, Apr 22, 2005 at 12:30:09AM +0900, Keiichiro Tokunaga wrote:
> +#ifdef CONFIG_HOTPLUG
> +void unregister_node(struct node *node)
> +{
> + sysdev_remove_file(&node->sysdev, &attr_cpumap);
> + sysdev_remove_file(&node->sysdev, &attr_meminfo);
> + sysdev_remove_file(&node->sysdev, &attr_numastat);
> + sysdev_remove_file(&node->sysdev, &attr_distance);
> +
> + sysdev_unregister(&node->sysdev);
> +}
> +EXPORT_SYMBOL_GPL(register_node);
> +EXPORT_SYMBOL_GPL(unregister_node);
> +#else /* !CONFIG_HOTPLUG */
> +void unregister_node(struct node *node)
> +{
> +}
> +#endif /* !CONFIG_HOTPLUG */

Oops, you only exported the symbols if CONFIG_HOTPLUG is enabled, not a
good idea. Either make the null functions in a .h file if the option is
not enabled, or always export them.

And the comment for the #endif isn't really needed, as the whole #ifdef
fits on a single screen :)

And hey, what's the real big deal here, why not always have this
function no matter if CONFIG_HOTPLUG is enabled or not? I really want
to just make that an option that is always enabled anyway, but changable
if you are using CONFIG_TINY or something...

thanks,

greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-04-22 02:59    [W:2.076 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site