* [PATCH] Make LLC2 compile with PROC_FS=n
@ 2003-10-20 5:03 Noah J. Misch
2003-10-20 7:44 ` Arnaldo Carvalho de Melo
2003-10-20 17:16 ` Stephen Hemminger
0 siblings, 2 replies; 6+ messages in thread
From: Noah J. Misch @ 2003-10-20 5:03 UTC (permalink / raw)
To: acme; +Cc: rddunlap, linux-kernel, netdev
Hello Arnaldo,
This patch allows the LLC2 code to link properly when CONFIG_PROC_FS=n. The
problem was that the Makefile only built llc_proc.c when PROC_FS=y/m, but
af_llc.c called functions in that file in all cases. The log details how I
fixed this.
I think this is the best fix, but of course there are a number of less intrusive
fixes, including (I think) one as simple as making llc_proc.c always compile.
This one does apply cleanly to linux-2.5 BK as of 0400 UTC 10/20/2003 and passes
allyesconfig and (allyesconfig - PROC_FS) compiles on i386.
Please let me know if I should supply you with further information.
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.34 -> 1.1340.1.35
# net/llc/af_llc.c 1.50 -> 1.51
# net/llc/llc_proc.c 1.17 -> 1.18
# include/net/llc_proc.h 1.1 -> 1.3 net/llc/llc_proc.h (moved)
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/10/17 noah@caltech.edu 1.1340.1.35
# Move include/net/llc_proc.h to net/llc/llc_proc.h since it is a private
# header file. Add static inline stub functions to that header and remove
# the extern stub functions from llc_proc.c This fixes a link error and
# saves space. Also mark two private structs in llc_proc.c static.
# --------------------------------------------
#
diff -Nru a/include/net/llc_proc.h b/include/net/llc_proc.h
--- a/include/net/llc_proc.h Fri Oct 17 16:24:05 2003
+++ /dev/null Wed Dec 31 16:00:00 1969
@@ -1,18 +0,0 @@
-#ifndef LLC_PROC_H
-#define LLC_PROC_H
-/*
- * Copyright (c) 1997 by Procom Technology, Inc.
- * 2002 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
- *
- * This program can be redistributed or modified under the terms of the
- * GNU General Public License as published by the Free Software Foundation.
- * This program is distributed without any warranty or implied warranty
- * of merchantability or fitness for a particular purpose.
- *
- * See the GNU General Public License for more details.
- */
-
-extern int llc_proc_init(void);
-extern void llc_proc_exit(void);
-
-#endif /* LLC_PROC_H */
diff -Nru a/net/llc/af_llc.c b/net/llc/af_llc.c
--- a/net/llc/af_llc.c Fri Oct 17 16:24:05 2003
+++ b/net/llc/af_llc.c Fri Oct 17 16:24:05 2003
@@ -30,7 +30,7 @@
#include <net/llc_sap.h>
#include <net/llc_pdu.h>
#include <net/llc_conn.h>
-#include <net/llc_proc.h>
+#include "llc_proc.h"
/* remember: uninitialized global data is zeroed because its in .bss */
static u16 llc_ui_sap_last_autoport = LLC_SAP_DYN_START;
diff -Nru a/net/llc/llc_proc.c b/net/llc/llc_proc.c
--- a/net/llc/llc_proc.c Fri Oct 17 16:24:05 2003
+++ b/net/llc/llc_proc.c Fri Oct 17 16:24:05 2003
@@ -14,7 +14,6 @@
#include <linux/config.h>
#include <linux/init.h>
-#ifdef CONFIG_PROC_FS
#include <linux/kernel.h>
#include <linux/proc_fs.h>
#include <linux/errno.h>
@@ -193,14 +192,14 @@
return 0;
}
-struct seq_operations llc_seq_socket_ops = {
+static struct seq_operations llc_seq_socket_ops = {
.start = llc_seq_start,
.next = llc_seq_next,
.stop = llc_seq_stop,
.show = llc_seq_socket_show,
};
-struct seq_operations llc_seq_core_ops = {
+static struct seq_operations llc_seq_core_ops = {
.start = llc_seq_start,
.next = llc_seq_next,
.stop = llc_seq_stop,
@@ -273,13 +272,3 @@
remove_proc_entry("core", llc_proc_dir);
remove_proc_entry("llc", proc_net);
}
-#else /* CONFIG_PROC_FS */
-int __init llc_proc_init(void)
-{
- return 0;
-}
-
-void llc_proc_exit(void)
-{
-}
-#endif /* CONFIG_PROC_FS */
diff -Nru a/net/llc/llc_proc.h b/net/llc/llc_proc.h
--- /dev/null Wed Dec 31 16:00:00 1969
+++ b/net/llc/llc_proc.h Fri Oct 17 16:24:05 2003
@@ -0,0 +1,23 @@
+#ifndef LLC_PROC_H
+#define LLC_PROC_H
+/*
+ * Copyright (c) 1997 by Procom Technology, Inc.
+ * 2002 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
+ *
+ * This program can be redistributed or modified under the terms of the
+ * GNU General Public License as published by the Free Software Foundation.
+ * This program is distributed without any warranty or implied warranty
+ * of merchantability or fitness for a particular purpose.
+ *
+ * See the GNU General Public License for more details.
+ */
+
+#ifdef CONFIG_PROC_FS
+extern int llc_proc_init(void);
+extern void llc_proc_exit(void);
+#else /* CONFIG_PROC_FS */
+static inline int llc_proc_init(void) { return 0; }
+static inline void llc_proc_exit(void) { }
+#endif /* CONFIG_PROC_FS */
+
+#endif /* LLC_PROC_H */
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Make LLC2 compile with PROC_FS=n
2003-10-20 5:03 [PATCH] Make LLC2 compile with PROC_FS=n Noah J. Misch
@ 2003-10-20 7:44 ` Arnaldo Carvalho de Melo
2003-10-20 17:16 ` Stephen Hemminger
1 sibling, 0 replies; 6+ messages in thread
From: Arnaldo Carvalho de Melo @ 2003-10-20 7:44 UTC (permalink / raw)
To: Noah J. Misch; +Cc: rddunlap, linux-kernel, netdev
Em Sun, Oct 19, 2003 at 10:03:52PM -0700, Noah J. Misch escreveu:
> Hello Arnaldo,
>
> This patch allows the LLC2 code to link properly when CONFIG_PROC_FS=n. The
> problem was that the Makefile only built llc_proc.c when PROC_FS=y/m, but
> af_llc.c called functions in that file in all cases. The log details how I
> fixed this.
>
> I think this is the best fix, but of course there are a number of less intrusive
> fixes, including (I think) one as simple as making llc_proc.c always compile.
> This one does apply cleanly to linux-2.5 BK as of 0400 UTC 10/20/2003 and passes
> allyesconfig and (allyesconfig - PROC_FS) compiles on i386.
>
> Please let me know if I should supply you with further information.
I'm OK with this patch.
- Arnaldo
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Make LLC2 compile with PROC_FS=n
2003-10-20 5:03 [PATCH] Make LLC2 compile with PROC_FS=n Noah J. Misch
2003-10-20 7:44 ` Arnaldo Carvalho de Melo
@ 2003-10-20 17:16 ` Stephen Hemminger
2003-10-21 5:32 ` David S. Miller
1 sibling, 1 reply; 6+ messages in thread
From: Stephen Hemminger @ 2003-10-20 17:16 UTC (permalink / raw)
To: Noah J. Misch; +Cc: acme, rddunlap, linux-kernel, netdev
Why make up a whole separate llc_proc.h file for two prototypes?
Put them on the end of llc.h
diff -Nru a/include/net/llc.h b/include/net/llc.h
--- a/include/net/llc.h Mon Oct 20 10:14:56 2003
+++ b/include/net/llc.h Mon Oct 20 10:14:56 2003
@@ -88,4 +88,12 @@
extern int llc_station_init(void);
extern void llc_station_exit(void);
+
+#ifdef CONFIG_PROC_FS
+extern int llc_proc_init(void);
+extern void llc_proc_exit(void);
+#else
+#define llc_proc_init() (0)
+#define llc_proc_exit() do { } while(0)
+#endif /* CONFIG_PROC_FS */
#endif /* LLC_H */
diff -Nru a/include/net/llc_proc.h b/include/net/llc_proc.h
--- a/include/net/llc_proc.h Mon Oct 20 10:14:56 2003
+++ /dev/null Wed Dec 31 16:00:00 1969
@@ -1,18 +0,0 @@
-#ifndef LLC_PROC_H
-#define LLC_PROC_H
-/*
- * Copyright (c) 1997 by Procom Technology, Inc.
- * 2002 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
- *
- * This program can be redistributed or modified under the terms of the
- * GNU General Public License as published by the Free Software Foundation.
- * This program is distributed without any warranty or implied warranty
- * of merchantability or fitness for a particular purpose.
- *
- * See the GNU General Public License for more details.
- */
-
-extern int llc_proc_init(void);
-extern void llc_proc_exit(void);
-
-#endif /* LLC_PROC_H */
diff -Nru a/net/llc/af_llc.c b/net/llc/af_llc.c
--- a/net/llc/af_llc.c Mon Oct 20 10:14:56 2003
+++ b/net/llc/af_llc.c Mon Oct 20 10:14:56 2003
@@ -30,7 +30,6 @@
#include <net/llc_sap.h>
#include <net/llc_pdu.h>
#include <net/llc_conn.h>
-#include <net/llc_proc.h>
/* remember: uninitialized global data is zeroed because its in .bss */
static u16 llc_ui_sap_last_autoport = LLC_SAP_DYN_START;
diff -Nru a/net/llc/llc_proc.c b/net/llc/llc_proc.c
--- a/net/llc/llc_proc.c Mon Oct 20 10:14:56 2003
+++ b/net/llc/llc_proc.c Mon Oct 20 10:14:56 2003
@@ -14,7 +14,6 @@
#include <linux/config.h>
#include <linux/init.h>
-#ifdef CONFIG_PROC_FS
#include <linux/kernel.h>
#include <linux/proc_fs.h>
#include <linux/errno.h>
@@ -273,13 +272,3 @@
remove_proc_entry("core", llc_proc_dir);
remove_proc_entry("llc", proc_net);
}
-#else /* CONFIG_PROC_FS */
-int __init llc_proc_init(void)
-{
- return 0;
-}
-
-void llc_proc_exit(void)
-{
-}
-#endif /* CONFIG_PROC_FS */
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Make LLC2 compile with PROC_FS=n
2003-10-20 17:16 ` Stephen Hemminger
@ 2003-10-21 5:32 ` David S. Miller
2003-10-21 11:13 ` Noah J. Misch
2003-10-22 21:18 ` Arnaldo Carvalho de Melo
0 siblings, 2 replies; 6+ messages in thread
From: David S. Miller @ 2003-10-21 5:32 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: noah, acme, rddunlap, linux-kernel, netdev
On Mon, 20 Oct 2003 10:16:07 -0700
Stephen Hemminger <shemminger@osdl.org> wrote:
> Why make up a whole separate llc_proc.h file for two prototypes?
> Put them on the end of llc.h
I definitely prefer this version of the fix.
Since Arnaldo appears to be busy, I'll apply this.
Thanks Noah and Stephen.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Make LLC2 compile with PROC_FS=n
2003-10-21 5:32 ` David S. Miller
@ 2003-10-21 11:13 ` Noah J. Misch
2003-10-22 21:18 ` Arnaldo Carvalho de Melo
1 sibling, 0 replies; 6+ messages in thread
From: Noah J. Misch @ 2003-10-21 11:13 UTC (permalink / raw)
To: Stephen Hemminger, David S. Miller; +Cc: acme, linux-kernel, netdev
On Mon, 20 Oct 2003, David S. Miller wrote:
> On Mon, 20 Oct 2003 10:16:07 -0700
> Stephen Hemminger <shemminger@osdl.org> wrote:
>
> > Why make up a whole separate llc_proc.h file for two prototypes?
> > Put them on the end of llc.h
>
> I definitely prefer this version of the fix.
I agree completely. Thanks, Stephen.
> Since Arnaldo appears to be busy, I'll apply this.
Great.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Make LLC2 compile with PROC_FS=n
2003-10-21 5:32 ` David S. Miller
2003-10-21 11:13 ` Noah J. Misch
@ 2003-10-22 21:18 ` Arnaldo Carvalho de Melo
1 sibling, 0 replies; 6+ messages in thread
From: Arnaldo Carvalho de Melo @ 2003-10-22 21:18 UTC (permalink / raw)
To: David S. Miller; +Cc: Stephen Hemminger, noah, rddunlap, linux-kernel, netdev
Em Mon, Oct 20, 2003 at 10:32:37PM -0700, David S. Miller escreveu:
> On Mon, 20 Oct 2003 10:16:07 -0700
> Stephen Hemminger <shemminger@osdl.org> wrote:
>
> > Why make up a whole separate llc_proc.h file for two prototypes?
> > Put them on the end of llc.h
>
> I definitely prefer this version of the fix.
>
> Since Arnaldo appears to be busy, I'll apply this.
>
> Thanks Noah and Stephen.
Thanks a lot, I'm back from Europe, hope to become more active again.
Regards,
- Arnaldo
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2003-10-22 21:18 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-20 5:03 [PATCH] Make LLC2 compile with PROC_FS=n Noah J. Misch
2003-10-20 7:44 ` Arnaldo Carvalho de Melo
2003-10-20 17:16 ` Stephen Hemminger
2003-10-21 5:32 ` David S. Miller
2003-10-21 11:13 ` Noah J. Misch
2003-10-22 21:18 ` Arnaldo Carvalho de Melo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).