[PATCH] Make appletalk link with SYSCTL=n

From: Noah J. Misch
Date: Mon Oct 20 2003 - 03:47:05 EST


Hello Jay,

This patch allows the appletalk network layer support to link properly when
CONFIG_SYSCTL=n. The Makefile only built sysctl_net_appletalk.o when
SYSCTL=y/m, but ddp.c called the register function therein regardless of
CONFIG_SYSCTL. The log details my implementation of the fix.

An alternate, less intrusive fix would be to make sysctl_net_appletalk.o build
always and add an #ifdef around the call to atalk_register_sysctl.

This applies to linux-2.5 BK as of 0700 UTC 10/20/2003 and builds under an
allyesconfig on i386. I haven't tested it in operation because I think the
change is straightforward, but I can do so if you would like.

Thanks,
Noah

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
# ChangeSet 1.1340.1.33 -> 1.1340.1.34
# net/appletalk/sysctl_net_atalk.c 1.4 -> 1.5
# net/appletalk/ddp.c 1.37 -> 1.38
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/10/16 torvalds@xxxxxxxxxxxxx 1.1340.19.2
# Merge http://lia64.bkbits.net/to-linus-2.5
# into home.osdl.org:/home/torvalds/v2.5/linux
# --------------------------------------------
# 03/10/16 torvalds@xxxxxxxxxxxxx 1.1342
# Merge http://mdomsch.bkbits.net/linux-2.5-edd
# into home.osdl.org:/home/torvalds/v2.5/linux
# --------------------------------------------
# 03/10/17 noah@xxxxxxxxxxx 1.1340.1.34
# Add static inline stubs of atalk_(un)?register_sysctl to net/appletalk/ddp.c
# and remove the #ifdef CONFIG_SYSCTL and the extern stub functions from
# net/appletalk/sysctl_net_atalk.c. This fixes a link error in the absence of
# CONFIG_SYSCTL and saves space.
# --------------------------------------------
#
diff -Nru a/net/appletalk/ddp.c b/net/appletalk/ddp.c
--- a/net/appletalk/ddp.c Fri Oct 17 16:23:47 2003
+++ b/net/appletalk/ddp.c Fri Oct 17 16:23:47 2003
@@ -68,8 +68,13 @@
struct atalk_addr *sa);
extern void aarp_proxy_remove(struct net_device *dev, struct atalk_addr *sa);

+#ifdef CONFIG_SYSCTL
extern void atalk_register_sysctl(void);
extern void atalk_unregister_sysctl(void);
+#else /* CONFIG_SYSCTL */
+static inline void atalk_register_sysctl(void) { }
+static inline void atalk_unregister_sysctl(void) { }
+#endif /* CONFIG_SYSCTL */

struct datalink_proto *ddp_dl, *aarp_dl;
static struct proto_ops atalk_dgram_ops;
@@ -1919,9 +1924,7 @@
*/
static void __exit atalk_exit(void)
{
-#ifdef CONFIG_SYSCTL
atalk_unregister_sysctl();
-#endif /* CONFIG_SYSCTL */
atalk_proc_exit();
aarp_cleanup_module(); /* General aarp clean-up. */
unregister_netdevice_notifier(&ddp_notifier);
diff -Nru a/net/appletalk/sysctl_net_atalk.c b/net/appletalk/sysctl_net_atalk.c
--- a/net/appletalk/sysctl_net_atalk.c Fri Oct 17 16:23:47 2003
+++ b/net/appletalk/sysctl_net_atalk.c Fri Oct 17 16:23:47 2003
@@ -7,8 +7,6 @@
*/

#include <linux/config.h>
-
-#ifdef CONFIG_SYSCTL
#include <linux/sysctl.h>
extern int sysctl_aarp_expiry_time;
extern int sysctl_aarp_tick_time;
@@ -82,13 +80,3 @@
{
unregister_sysctl_table(atalk_table_header);
}
-
-#else /* CONFIG_PROC_FS */
-void atalk_register_sysctl(void)
-{
-}
-
-void atalk_unregister_sysctl(void)
-{
-}
-#endif /* CONFIG_PROC_FS */

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