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
Kirill Smelkov
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)
...
@@ -1114,12 +1114,10 @@ static int __init atm_init(void)
printk
(
KERN_ERR
"atmsvc_init() failed with %d
\n
"
,
error
);
printk
(
KERN_ERR
"atmsvc_init() failed with %d
\n
"
,
error
);
goto
failure
;
goto
failure
;
}
}
#ifdef CONFIG_PROC_FS
if
((
error
=
atm_proc_init
())
<
0
)
{
if
((
error
=
atm_proc_init
())
<
0
)
{
printk
(
KERN_ERR
"atm_proc_init() failed with %d
\n
"
,
error
);
printk
(
KERN_ERR
"atm_proc_init() failed with %d
\n
"
,
error
);
goto
failure
;
goto
failure
;
}
}
#endif
return
0
;
return
0
;
failure:
failure:
...
@@ -1130,9 +1128,7 @@ static int __init atm_init(void)
...
@@ -1130,9 +1128,7 @@ static int __init atm_init(void)
static
void
__exit
atm_exit
(
void
)
static
void
__exit
atm_exit
(
void
)
{
{
#ifdef CONFIG_PROC_FS
atm_proc_exit
();
atm_proc_exit
();
#endif
atmsvc_exit
();
atmsvc_exit
();
atmpvc_exit
();
atmpvc_exit
();
}
}
...
...
net/atm/common.h
View file @
7d464ed4
...
@@ -33,8 +33,21 @@ int atmpvc_init(void);
...
@@ -33,8 +33,21 @@ int atmpvc_init(void);
void
atmpvc_exit
(
void
);
void
atmpvc_exit
(
void
);
int
atmsvc_init
(
void
);
int
atmsvc_init
(
void
);
void
atmsvc_exit
(
void
);
void
atmsvc_exit
(
void
);
#ifdef CONFIG_PROC_FS
int
atm_proc_init
(
void
);
int
atm_proc_init
(
void
);
void
atm_proc_exit
(
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 */
/* SVC */
...
...
net/atm/proc.c
View file @
7d464ed4
...
@@ -593,6 +593,10 @@ int atm_proc_dev_register(struct atm_dev *dev)
...
@@ -593,6 +593,10 @@ int atm_proc_dev_register(struct atm_dev *dev)
int
digits
,
num
;
int
digits
,
num
;
int
error
;
int
error
;
/* No proc info */
if
(
!
dev
->
ops
->
proc_read
)
return
0
;
error
=
-
ENOMEM
;
error
=
-
ENOMEM
;
digits
=
0
;
digits
=
0
;
for
(
num
=
dev
->
number
;
num
;
num
/=
10
)
digits
++
;
for
(
num
=
dev
->
number
;
num
;
num
/=
10
)
digits
++
;
...
@@ -619,6 +623,9 @@ int atm_proc_dev_register(struct atm_dev *dev)
...
@@ -619,6 +623,9 @@ int atm_proc_dev_register(struct atm_dev *dev)
void
atm_proc_dev_deregister
(
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
);
remove_proc_entry
(
dev
->
proc_name
,
atm_proc_root
);
kfree
(
dev
->
proc_name
);
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,
...
@@ -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
);
list_add_tail
(
&
dev
->
dev_list
,
&
atm_devs
);
spin_unlock
(
&
atm_dev_lock
);
spin_unlock
(
&
atm_dev_lock
);
#ifdef CONFIG_PROC_FS
if
(
atm_proc_dev_register
(
dev
)
<
0
)
{
if
(
ops
->
proc_read
)
{
printk
(
KERN_ERR
"atm_dev_register: "
if
(
atm_proc_dev_register
(
dev
)
<
0
)
{
"atm_proc_dev_register failed for dev %s
\n
"
,
printk
(
KERN_ERR
"atm_dev_register: "
type
);
"atm_proc_dev_register failed for dev %s
\n
"
,
spin_lock
(
&
atm_dev_lock
);
type
);
list_del
(
&
dev
->
dev_list
);
spin_lock
(
&
atm_dev_lock
);
spin_unlock
(
&
atm_dev_lock
);
list_del
(
&
dev
->
dev_list
);
__free_atm_dev
(
dev
);
spin_unlock
(
&
atm_dev_lock
);
return
NULL
;
__free_atm_dev
(
dev
);
return
NULL
;
}
}
}
#endif
return
dev
;
return
dev
;
}
}
...
@@ -133,10 +129,8 @@ void atm_dev_deregister(struct atm_dev *dev)
...
@@ -133,10 +129,8 @@ void atm_dev_deregister(struct atm_dev *dev)
{
{
unsigned
long
warning_time
;
unsigned
long
warning_time
;
#ifdef CONFIG_PROC_FS
atm_proc_dev_deregister
(
dev
);
if
(
dev
->
ops
->
proc_read
)
atm_proc_dev_deregister
(
dev
);
#endif
spin_lock
(
&
atm_dev_lock
);
spin_lock
(
&
atm_dev_lock
);
list_del
(
&
dev
->
dev_list
);
list_del
(
&
dev
->
dev_list
);
spin_unlock
(
&
atm_dev_lock
);
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);
...
@@ -24,6 +24,18 @@ int atm_dev_ioctl(unsigned int cmd, unsigned long arg);
int
atm_proc_dev_register
(
struct
atm_dev
*
dev
);
int
atm_proc_dev_register
(
struct
atm_dev
*
dev
);
void
atm_proc_dev_deregister
(
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
#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