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
31c4141f
Commit
31c4141f
authored
May 10, 2004
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Module attributes: fix build error if CONFIG_MODULE_UNLOAD=n
Thanks to Andrew Morton for pointing this out to me.
parent
b863a25d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
16 deletions
+16
-16
kernel/module.c
kernel/module.c
+16
-16
No files found.
kernel/module.c
View file @
31c4141f
...
...
@@ -379,6 +379,22 @@ static inline void percpu_modcopy(void *pcpudst, const void *src,
}
#endif
/* CONFIG_SMP */
static
int
add_attribute
(
struct
module
*
mod
,
struct
kernel_param
*
kp
)
{
struct
module_attribute
*
a
;
int
retval
;
a
=
&
mod
->
mkobj
->
attr
[
mod
->
mkobj
->
num_attributes
];
a
->
attr
.
name
=
(
char
*
)
kp
->
name
;
a
->
attr
.
owner
=
mod
;
a
->
attr
.
mode
=
kp
->
perm
;
a
->
param
=
kp
;
retval
=
sysfs_create_file
(
&
mod
->
mkobj
->
kobj
,
&
a
->
attr
);
if
(
!
retval
)
mod
->
mkobj
->
num_attributes
++
;
return
retval
;
}
#ifdef CONFIG_MODULE_UNLOAD
/* Init the unload section of the module. */
static
void
module_unload_init
(
struct
module
*
mod
)
...
...
@@ -504,22 +520,6 @@ static int try_stop_module(struct module *mod, int flags, int *forced)
return
stop_machine_run
(
__try_stop_module
,
&
sref
,
NR_CPUS
);
}
static
int
add_attribute
(
struct
module
*
mod
,
struct
kernel_param
*
kp
)
{
struct
module_attribute
*
a
;
int
retval
;
a
=
&
mod
->
mkobj
->
attr
[
mod
->
mkobj
->
num_attributes
];
a
->
attr
.
name
=
(
char
*
)
kp
->
name
;
a
->
attr
.
owner
=
mod
;
a
->
attr
.
mode
=
kp
->
perm
;
a
->
param
=
kp
;
retval
=
sysfs_create_file
(
&
mod
->
mkobj
->
kobj
,
&
a
->
attr
);
if
(
!
retval
)
mod
->
mkobj
->
num_attributes
++
;
return
retval
;
}
unsigned
int
module_refcount
(
struct
module
*
mod
)
{
unsigned
int
i
,
total
=
0
;
...
...
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