Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
7d464ed4
Commit
7d464ed4
authored
Sep 04, 2003
by
Chas Williams
Committed by
David S. Miller
Sep 04, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ATM]: reduce CONFIG_PROC_FS #ifdef clutter in .c code (from levon@movementarian.org)
parent
a203da95
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
22 deletions
+44
-22
net/atm/common.c
net/atm/common.c
+0
-4
net/atm/common.h
net/atm/common.h
+13
-0
net/atm/proc.c
net/atm/proc.c
+7
-0
net/atm/resources.c
net/atm/resources.c
+11
-17
net/atm/resources.h
net/atm/resources.h
+13
-1
No files found.
net/atm/common.c
View file @
7d464ed4
...
...
@@ -1114,12 +1114,10 @@ static int __init atm_init(void)
printk
(
KERN_ERR
"atmsvc_init() failed with %d
\n
"
,
error
);
goto
failure
;
}
#ifdef CONFIG_PROC_FS
if
((
error
=
atm_proc_init
())
<
0
)
{
printk
(
KERN_ERR
"atm_proc_init() failed with %d
\n
"
,
error
);
goto
failure
;
}
#endif
return
0
;
failure:
...
...
@@ -1130,9 +1128,7 @@ static int __init atm_init(void)
static
void
__exit
atm_exit
(
void
)
{
#ifdef CONFIG_PROC_FS
atm_proc_exit
();
#endif
atmsvc_exit
();
atmpvc_exit
();
}
...
...
net/atm/common.h
View file @
7d464ed4
...
...
@@ -33,8 +33,21 @@ int atmpvc_init(void);
void
atmpvc_exit
(
void
);
int
atmsvc_init
(
void
);
void
atmsvc_exit
(
void
);
#ifdef CONFIG_PROC_FS
int
atm_proc_init
(
void
);
void
atm_proc_exit
(
void
);
#else
static
inline
int
atm_proc_init
(
void
)
{
return
0
;
}
static
inline
void
atm_proc_exit
(
void
)
{
/* nothing */
}
#endif
/* CONFIG_PROC_FS */
/* SVC */
...
...
net/atm/proc.c
View file @
7d464ed4
...
...
@@ -593,6 +593,10 @@ int atm_proc_dev_register(struct atm_dev *dev)
int
digits
,
num
;
int
error
;
/* No proc info */
if
(
!
dev
->
ops
->
proc_read
)
return
0
;
error
=
-
ENOMEM
;
digits
=
0
;
for
(
num
=
dev
->
number
;
num
;
num
/=
10
)
digits
++
;
...
...
@@ -619,6 +623,9 @@ int atm_proc_dev_register(struct atm_dev *dev)
void
atm_proc_dev_deregister
(
struct
atm_dev
*
dev
)
{
if
(
!
dev
->
ops
->
proc_read
)
return
;
remove_proc_entry
(
dev
->
proc_name
,
atm_proc_root
);
kfree
(
dev
->
proc_name
);
}
...
...
net/atm/resources.c
View file @
7d464ed4
...
...
@@ -110,20 +110,16 @@ struct atm_dev *atm_dev_register(const char *type, const struct atmdev_ops *ops,
list_add_tail
(
&
dev
->
dev_list
,
&
atm_devs
);
spin_unlock
(
&
atm_dev_lock
);
#ifdef CONFIG_PROC_FS
if
(
ops
->
proc_read
)
{
if
(
atm_proc_dev_register
(
dev
)
<
0
)
{
printk
(
KERN_ERR
"atm_dev_register: "
"atm_proc_dev_register failed for dev %s
\n
"
,
type
);
spin_lock
(
&
atm_dev_lock
);
list_del
(
&
dev
->
dev_list
);
spin_unlock
(
&
atm_dev_lock
);
__free_atm_dev
(
dev
);
return
NULL
;
}
if
(
atm_proc_dev_register
(
dev
)
<
0
)
{
printk
(
KERN_ERR
"atm_dev_register: "
"atm_proc_dev_register failed for dev %s
\n
"
,
type
);
spin_lock
(
&
atm_dev_lock
);
list_del
(
&
dev
->
dev_list
);
spin_unlock
(
&
atm_dev_lock
);
__free_atm_dev
(
dev
);
return
NULL
;
}
#endif
return
dev
;
}
...
...
@@ -133,10 +129,8 @@ void atm_dev_deregister(struct atm_dev *dev)
{
unsigned
long
warning_time
;
#ifdef CONFIG_PROC_FS
if
(
dev
->
ops
->
proc_read
)
atm_proc_dev_deregister
(
dev
);
#endif
atm_proc_dev_deregister
(
dev
);
spin_lock
(
&
atm_dev_lock
);
list_del
(
&
dev
->
dev_list
);
spin_unlock
(
&
atm_dev_lock
);
...
...
net/atm/resources.h
View file @
7d464ed4
...
...
@@ -24,6 +24,18 @@ int atm_dev_ioctl(unsigned int cmd, unsigned long arg);
int
atm_proc_dev_register
(
struct
atm_dev
*
dev
);
void
atm_proc_dev_deregister
(
struct
atm_dev
*
dev
);
#endif
#else
static
inline
int
atm_proc_dev_register
(
struct
atm_dev
*
dev
)
{
return
0
;
}
static
inline
void
atm_proc_dev_deregister
(
struct
atm_dev
*
dev
)
{
/* nothing */
}
#endif
/* CONFIG_PROC_FS */
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment