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
3c0ba99c
Commit
3c0ba99c
authored
Mar 05, 2003
by
David S. Miller
Browse files
Options
Browse Files
Download
Plain Diff
Merge davem@nuts.ninka.net:/home/davem/src/BK/net-2.5
into kernel.bkbits.net:/home/davem/net-2.5
parents
485b8d29
c3136961
Changes
17
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
143 additions
and
94 deletions
+143
-94
arch/i386/oprofile/nmi_int.c
arch/i386/oprofile/nmi_int.c
+3
-3
arch/i386/oprofile/op_model_p4.c
arch/i386/oprofile/op_model_p4.c
+1
-1
drivers/base/platform.c
drivers/base/platform.c
+2
-5
drivers/cpufreq/userspace.c
drivers/cpufreq/userspace.c
+2
-2
drivers/oprofile/buffer_sync.c
drivers/oprofile/buffer_sync.c
+38
-18
drivers/oprofile/cpu_buffer.c
drivers/oprofile/cpu_buffer.c
+52
-32
drivers/oprofile/cpu_buffer.h
drivers/oprofile/cpu_buffer.h
+3
-4
drivers/oprofile/oprofile_stats.c
drivers/oprofile/oprofile_stats.c
+0
-3
drivers/parport/ieee1284.c
drivers/parport/ieee1284.c
+1
-1
drivers/parport/ieee1284_ops.c
drivers/parport/ieee1284_ops.c
+4
-4
fs/filesystems.c
fs/filesystems.c
+1
-3
fs/sysfs/mount.c
fs/sysfs/mount.c
+1
-1
include/linux/jiffies.h
include/linux/jiffies.h
+9
-2
include/linux/kernel.h
include/linux/kernel.h
+11
-0
include/linux/profile.h
include/linux/profile.h
+12
-12
sound/pci/ac97/ac97_codec.c
sound/pci/ac97/ac97_codec.c
+2
-2
sound/pci/intel8x0.c
sound/pci/intel8x0.c
+1
-1
No files found.
arch/i386/oprofile/nmi_int.c
View file @
3c0ba99c
...
@@ -58,7 +58,7 @@ static void nmi_save_registers(struct op_msrs * msrs)
...
@@ -58,7 +58,7 @@ static void nmi_save_registers(struct op_msrs * msrs)
unsigned
int
const
nr_ctrls
=
model
->
num_controls
;
unsigned
int
const
nr_ctrls
=
model
->
num_controls
;
struct
op_msr_group
*
counters
=
&
msrs
->
counters
;
struct
op_msr_group
*
counters
=
&
msrs
->
counters
;
struct
op_msr_group
*
controls
=
&
msrs
->
controls
;
struct
op_msr_group
*
controls
=
&
msrs
->
controls
;
int
i
;
unsigned
int
i
;
for
(
i
=
0
;
i
<
nr_ctrs
;
++
i
)
{
for
(
i
=
0
;
i
<
nr_ctrs
;
++
i
)
{
rdmsr
(
counters
->
addrs
[
i
],
rdmsr
(
counters
->
addrs
[
i
],
...
@@ -108,7 +108,7 @@ static void nmi_restore_registers(struct op_msrs * msrs)
...
@@ -108,7 +108,7 @@ static void nmi_restore_registers(struct op_msrs * msrs)
unsigned
int
const
nr_ctrls
=
model
->
num_controls
;
unsigned
int
const
nr_ctrls
=
model
->
num_controls
;
struct
op_msr_group
*
counters
=
&
msrs
->
counters
;
struct
op_msr_group
*
counters
=
&
msrs
->
counters
;
struct
op_msr_group
*
controls
=
&
msrs
->
controls
;
struct
op_msr_group
*
controls
=
&
msrs
->
controls
;
int
i
;
unsigned
int
i
;
for
(
i
=
0
;
i
<
nr_ctrls
;
++
i
)
{
for
(
i
=
0
;
i
<
nr_ctrls
;
++
i
)
{
wrmsr
(
controls
->
addrs
[
i
],
wrmsr
(
controls
->
addrs
[
i
],
...
@@ -182,7 +182,7 @@ struct op_counter_config counter_config[OP_MAX_COUNTER];
...
@@ -182,7 +182,7 @@ struct op_counter_config counter_config[OP_MAX_COUNTER];
static
int
nmi_create_files
(
struct
super_block
*
sb
,
struct
dentry
*
root
)
static
int
nmi_create_files
(
struct
super_block
*
sb
,
struct
dentry
*
root
)
{
{
int
i
;
unsigned
int
i
;
for
(
i
=
0
;
i
<
model
->
num_counters
;
++
i
)
{
for
(
i
=
0
;
i
<
model
->
num_counters
;
++
i
)
{
struct
dentry
*
dir
;
struct
dentry
*
dir
;
...
...
arch/i386/oprofile/op_model_p4.c
View file @
3c0ba99c
...
@@ -389,7 +389,7 @@ static unsigned long reset_value[NUM_COUNTERS_NON_HT];
...
@@ -389,7 +389,7 @@ static unsigned long reset_value[NUM_COUNTERS_NON_HT];
static
void
p4_fill_in_addresses
(
struct
op_msrs
*
const
msrs
)
static
void
p4_fill_in_addresses
(
struct
op_msrs
*
const
msrs
)
{
{
int
i
;
unsigned
int
i
;
unsigned
int
addr
,
stag
;
unsigned
int
addr
,
stag
;
setup_num_counters
();
setup_num_counters
();
...
...
drivers/base/platform.c
View file @
3c0ba99c
...
@@ -59,12 +59,9 @@ void platform_device_unregister(struct platform_device * pdev)
...
@@ -59,12 +59,9 @@ void platform_device_unregister(struct platform_device * pdev)
static
int
platform_match
(
struct
device
*
dev
,
struct
device_driver
*
drv
)
static
int
platform_match
(
struct
device
*
dev
,
struct
device_driver
*
drv
)
{
{
char
name
[
BUS_ID_SIZE
]
;
struct
platform_device
*
pdev
=
container_of
(
dev
,
struct
platform_device
,
dev
)
;
if
(
sscanf
(
dev
->
bus_id
,
"%s"
,
name
))
return
(
strncmp
(
pdev
->
name
,
drv
->
name
,
BUS_ID_SIZE
)
==
0
);
return
(
strcmp
(
name
,
drv
->
name
)
==
0
);
return
0
;
}
}
struct
bus_type
platform_bus_type
=
{
struct
bus_type
platform_bus_type
=
{
...
...
drivers/cpufreq/userspace.c
View file @
3c0ba99c
...
@@ -511,7 +511,7 @@ static int cpufreq_governor_userspace(struct cpufreq_policy *policy,
...
@@ -511,7 +511,7 @@ static int cpufreq_governor_userspace(struct cpufreq_policy *policy,
cpu_min_freq
[
cpu
]
=
policy
->
min
;
cpu_min_freq
[
cpu
]
=
policy
->
min
;
cpu_max_freq
[
cpu
]
=
policy
->
max
;
cpu_max_freq
[
cpu
]
=
policy
->
max
;
cpu_cur_freq
[
cpu
]
=
policy
->
cur
;
cpu_cur_freq
[
cpu
]
=
policy
->
cur
;
device_create_file
(
policy
->
intf
.
dev
,
&
dev_attr_scaling_setspeed
);
device_create_file
(
policy
->
dev
,
&
dev_attr_scaling_setspeed
);
memcpy
(
&
current_policy
[
cpu
],
policy
,
sizeof
(
struct
cpufreq_policy
));
memcpy
(
&
current_policy
[
cpu
],
policy
,
sizeof
(
struct
cpufreq_policy
));
up
(
&
userspace_sem
);
up
(
&
userspace_sem
);
break
;
break
;
...
@@ -520,7 +520,7 @@ static int cpufreq_governor_userspace(struct cpufreq_policy *policy,
...
@@ -520,7 +520,7 @@ static int cpufreq_governor_userspace(struct cpufreq_policy *policy,
cpu_is_managed
[
cpu
]
=
0
;
cpu_is_managed
[
cpu
]
=
0
;
cpu_min_freq
[
cpu
]
=
0
;
cpu_min_freq
[
cpu
]
=
0
;
cpu_max_freq
[
cpu
]
=
0
;
cpu_max_freq
[
cpu
]
=
0
;
device_remove_file
(
policy
->
intf
.
dev
,
&
dev_attr_scaling_setspeed
);
device_remove_file
(
policy
->
dev
,
&
dev_attr_scaling_setspeed
);
up
(
&
userspace_sem
);
up
(
&
userspace_sem
);
module_put
(
THIS_MODULE
);
module_put
(
THIS_MODULE
);
break
;
break
;
...
...
drivers/oprofile/buffer_sync.c
View file @
3c0ba99c
...
@@ -277,10 +277,7 @@ static void release_mm(struct mm_struct * mm)
...
@@ -277,10 +277,7 @@ static void release_mm(struct mm_struct * mm)
*/
*/
static
struct
mm_struct
*
take_task_mm
(
struct
task_struct
*
task
)
static
struct
mm_struct
*
take_task_mm
(
struct
task_struct
*
task
)
{
{
struct
mm_struct
*
mm
;
struct
mm_struct
*
mm
=
task
->
mm
;
task_lock
(
task
);
mm
=
task
->
mm
;
task_unlock
(
task
);
/* if task->mm !NULL, mm_count must be at least 1. It cannot
/* if task->mm !NULL, mm_count must be at least 1. It cannot
* drop to 0 without the task exiting, which will have to sleep
* drop to 0 without the task exiting, which will have to sleep
...
@@ -310,6 +307,32 @@ static inline int is_ctx_switch(unsigned long val)
...
@@ -310,6 +307,32 @@ static inline int is_ctx_switch(unsigned long val)
}
}
/* compute number of filled slots in cpu_buffer queue */
static
unsigned
long
nr_filled_slots
(
struct
oprofile_cpu_buffer
*
b
)
{
unsigned
long
head
=
b
->
head_pos
;
unsigned
long
tail
=
b
->
tail_pos
;
if
(
head
>=
tail
)
return
head
-
tail
;
return
head
+
(
b
->
buffer_size
-
tail
);
}
static
void
increment_tail
(
struct
oprofile_cpu_buffer
*
b
)
{
unsigned
long
new_tail
=
b
->
tail_pos
+
1
;
rmb
();
if
(
new_tail
<
(
b
->
buffer_size
))
b
->
tail_pos
=
new_tail
;
else
b
->
tail_pos
=
0
;
}
/* Sync one of the CPU's buffers into the global event buffer.
/* Sync one of the CPU's buffers into the global event buffer.
* Here we need to go through each batch of samples punctuated
* Here we need to go through each batch of samples punctuated
* by context switch notes, taking the task's mmap_sem and doing
* by context switch notes, taking the task's mmap_sem and doing
...
@@ -322,10 +345,14 @@ static void sync_buffer(struct oprofile_cpu_buffer * cpu_buf)
...
@@ -322,10 +345,14 @@ static void sync_buffer(struct oprofile_cpu_buffer * cpu_buf)
struct
task_struct
*
new
;
struct
task_struct
*
new
;
unsigned
long
cookie
;
unsigned
long
cookie
;
int
in_kernel
=
1
;
int
in_kernel
=
1
;
int
i
;
unsigned
int
i
;
for
(
i
=
0
;
i
<
cpu_buf
->
pos
;
++
i
)
{
/* Remember, only we can modify tail_pos */
struct
op_sample
*
s
=
&
cpu_buf
->
buffer
[
i
];
unsigned
long
const
available_elements
=
nr_filled_slots
(
cpu_buf
);
for
(
i
=
0
;
i
<
available_elements
;
++
i
)
{
struct
op_sample
*
s
=
&
cpu_buf
->
buffer
[
cpu_buf
->
tail_pos
];
if
(
is_ctx_switch
(
s
->
eip
))
{
if
(
is_ctx_switch
(
s
->
eip
))
{
if
(
s
->
event
<=
1
)
{
if
(
s
->
event
<=
1
)
{
...
@@ -345,6 +372,8 @@ static void sync_buffer(struct oprofile_cpu_buffer * cpu_buf)
...
@@ -345,6 +372,8 @@ static void sync_buffer(struct oprofile_cpu_buffer * cpu_buf)
}
else
{
}
else
{
add_sample
(
mm
,
s
,
in_kernel
);
add_sample
(
mm
,
s
,
in_kernel
);
}
}
increment_tail
(
cpu_buf
);
}
}
release_mm
(
mm
);
release_mm
(
mm
);
...
@@ -369,17 +398,8 @@ static void sync_cpu_buffers(void)
...
@@ -369,17 +398,8 @@ static void sync_cpu_buffers(void)
cpu_buf
=
&
cpu_buffer
[
i
];
cpu_buf
=
&
cpu_buffer
[
i
];
/* We take a spin lock even though we might
* sleep. It's OK because other users are try
* lockers only, and this region is already
* protected by buffer_sem. It's raw to prevent
* the preempt bogometer firing. Fruity, huh ? */
if
(
cpu_buf
->
pos
>
0
)
{
_raw_spin_lock
(
&
cpu_buf
->
int_lock
);
add_cpu_switch
(
i
);
add_cpu_switch
(
i
);
sync_buffer
(
cpu_buf
);
sync_buffer
(
cpu_buf
);
_raw_spin_unlock
(
&
cpu_buf
->
int_lock
);
}
}
}
up
(
&
buffer_sem
);
up
(
&
buffer_sem
);
...
...
drivers/oprofile/cpu_buffer.c
View file @
3c0ba99c
...
@@ -26,8 +26,6 @@
...
@@ -26,8 +26,6 @@
struct
oprofile_cpu_buffer
cpu_buffer
[
NR_CPUS
]
__cacheline_aligned
;
struct
oprofile_cpu_buffer
cpu_buffer
[
NR_CPUS
]
__cacheline_aligned
;
static
unsigned
long
buffer_size
;
static
void
__free_cpu_buffers
(
int
num
)
static
void
__free_cpu_buffers
(
int
num
)
{
{
int
i
;
int
i
;
...
@@ -47,7 +45,7 @@ int alloc_cpu_buffers(void)
...
@@ -47,7 +45,7 @@ int alloc_cpu_buffers(void)
{
{
int
i
;
int
i
;
buffer_size
=
fs_cpu_buffer_size
;
unsigned
long
buffer_size
=
fs_cpu_buffer_size
;
for
(
i
=
0
;
i
<
NR_CPUS
;
++
i
)
{
for
(
i
=
0
;
i
<
NR_CPUS
;
++
i
)
{
struct
oprofile_cpu_buffer
*
b
=
&
cpu_buffer
[
i
];
struct
oprofile_cpu_buffer
*
b
=
&
cpu_buffer
[
i
];
...
@@ -59,12 +57,12 @@ int alloc_cpu_buffers(void)
...
@@ -59,12 +57,12 @@ int alloc_cpu_buffers(void)
if
(
!
b
->
buffer
)
if
(
!
b
->
buffer
)
goto
fail
;
goto
fail
;
spin_lock_init
(
&
b
->
int_lock
);
b
->
pos
=
0
;
b
->
last_task
=
0
;
b
->
last_task
=
0
;
b
->
last_is_kernel
=
-
1
;
b
->
last_is_kernel
=
-
1
;
b
->
buffer_size
=
buffer_size
;
b
->
tail_pos
=
0
;
b
->
head_pos
=
0
;
b
->
sample_received
=
0
;
b
->
sample_received
=
0
;
b
->
sample_lost_locked
=
0
;
b
->
sample_lost_overflow
=
0
;
b
->
sample_lost_overflow
=
0
;
b
->
sample_lost_task_exit
=
0
;
b
->
sample_lost_task_exit
=
0
;
}
}
...
@@ -81,10 +79,40 @@ void free_cpu_buffers(void)
...
@@ -81,10 +79,40 @@ void free_cpu_buffers(void)
}
}
/* Note we can't use a semaphore here as this is supposed to
/* compute number of available slots in cpu_buffer queue */
* be safe from any context. Instead we trylock the CPU's int_lock.
static
unsigned
long
nr_available_slots
(
struct
oprofile_cpu_buffer
const
*
b
)
* int_lock is taken by the processing code in sync_cpu_buffers()
{
* so we avoid disturbing that.
unsigned
long
head
=
b
->
head_pos
;
unsigned
long
tail
=
b
->
tail_pos
;
if
(
tail
==
head
)
return
b
->
buffer_size
;
if
(
tail
>
head
)
return
tail
-
head
;
return
tail
+
(
b
->
buffer_size
-
head
);
}
static
void
increment_head
(
struct
oprofile_cpu_buffer
*
b
)
{
unsigned
long
new_head
=
b
->
head_pos
+
1
;
/* Ensure anything written to the slot before we
* increment is visible */
wmb
();
if
(
new_head
<
(
b
->
buffer_size
))
b
->
head_pos
=
new_head
;
else
b
->
head_pos
=
0
;
}
/* This must be safe from any context. It's safe writing here
* because of the head/tail separation of the writer and reader
* of the CPU buffer.
*
*
* is_kernel is needed because on some architectures you cannot
* is_kernel is needed because on some architectures you cannot
* tell if you are in kernel or user space simply by looking at
* tell if you are in kernel or user space simply by looking at
...
@@ -101,14 +129,10 @@ void oprofile_add_sample(unsigned long eip, unsigned int is_kernel,
...
@@ -101,14 +129,10 @@ void oprofile_add_sample(unsigned long eip, unsigned int is_kernel,
cpu_buf
->
sample_received
++
;
cpu_buf
->
sample_received
++
;
if
(
!
spin_trylock
(
&
cpu_buf
->
int_lock
))
{
cpu_buf
->
sample_lost_locked
++
;
return
;
}
if
(
cpu_buf
->
pos
>
buffer_size
-
2
)
{
if
(
nr_available_slots
(
cpu_buf
)
<
3
)
{
cpu_buf
->
sample_lost_overflow
++
;
cpu_buf
->
sample_lost_overflow
++
;
goto
out
;
return
;
}
}
task
=
current
;
task
=
current
;
...
@@ -116,18 +140,18 @@ void oprofile_add_sample(unsigned long eip, unsigned int is_kernel,
...
@@ -116,18 +140,18 @@ void oprofile_add_sample(unsigned long eip, unsigned int is_kernel,
/* notice a switch from user->kernel or vice versa */
/* notice a switch from user->kernel or vice versa */
if
(
cpu_buf
->
last_is_kernel
!=
is_kernel
)
{
if
(
cpu_buf
->
last_is_kernel
!=
is_kernel
)
{
cpu_buf
->
last_is_kernel
=
is_kernel
;
cpu_buf
->
last_is_kernel
=
is_kernel
;
cpu_buf
->
buffer
[
cpu_buf
->
pos
].
eip
=
~
0UL
;
cpu_buf
->
buffer
[
cpu_buf
->
head_
pos
].
eip
=
~
0UL
;
cpu_buf
->
buffer
[
cpu_buf
->
pos
].
event
=
is_kernel
;
cpu_buf
->
buffer
[
cpu_buf
->
head_
pos
].
event
=
is_kernel
;
cpu_buf
->
pos
++
;
increment_head
(
cpu_buf
)
;
}
}
/* notice a task switch */
/* notice a task switch */
if
(
cpu_buf
->
last_task
!=
task
)
{
if
(
cpu_buf
->
last_task
!=
task
)
{
cpu_buf
->
last_task
=
task
;
cpu_buf
->
last_task
=
task
;
if
(
!
(
task
->
flags
&
PF_EXITING
))
{
if
(
!
(
task
->
flags
&
PF_EXITING
))
{
cpu_buf
->
buffer
[
cpu_buf
->
pos
].
eip
=
~
0UL
;
cpu_buf
->
buffer
[
cpu_buf
->
head_
pos
].
eip
=
~
0UL
;
cpu_buf
->
buffer
[
cpu_buf
->
pos
].
event
=
(
unsigned
long
)
task
;
cpu_buf
->
buffer
[
cpu_buf
->
head_
pos
].
event
=
(
unsigned
long
)
task
;
cpu_buf
->
pos
++
;
increment_head
(
cpu_buf
)
;
}
}
}
}
...
@@ -138,23 +162,20 @@ void oprofile_add_sample(unsigned long eip, unsigned int is_kernel,
...
@@ -138,23 +162,20 @@ void oprofile_add_sample(unsigned long eip, unsigned int is_kernel,
*/
*/
if
(
task
->
flags
&
PF_EXITING
)
{
if
(
task
->
flags
&
PF_EXITING
)
{
cpu_buf
->
sample_lost_task_exit
++
;
cpu_buf
->
sample_lost_task_exit
++
;
goto
out
;
return
;
}
}
cpu_buf
->
buffer
[
cpu_buf
->
pos
].
eip
=
eip
;
cpu_buf
->
buffer
[
cpu_buf
->
head_pos
].
eip
=
eip
;
cpu_buf
->
buffer
[
cpu_buf
->
pos
].
event
=
event
;
cpu_buf
->
buffer
[
cpu_buf
->
head_pos
].
event
=
event
;
cpu_buf
->
pos
++
;
increment_head
(
cpu_buf
);
out:
spin_unlock
(
&
cpu_buf
->
int_lock
);
}
}
/* resets the cpu buffer to a sane state - should be called with
/* resets the cpu buffer to a sane state - should be called with
* cpu_buf->int_lock held
* cpu_buf->int_lock held
*/
*/
void
cpu_buffer_reset
(
struct
oprofile_cpu_buffer
*
cpu_buf
)
void
cpu_buffer_reset
(
struct
oprofile_cpu_buffer
*
cpu_buf
)
{
{
cpu_buf
->
pos
=
0
;
/* reset these to invalid values; the next sample
/* reset these to invalid values; the next sample
* collected will populate the buffer with proper
* collected will populate the buffer with proper
* values to initialize the buffer
* values to initialize the buffer
...
@@ -162,4 +183,3 @@ void cpu_buffer_reset(struct oprofile_cpu_buffer *cpu_buf)
...
@@ -162,4 +183,3 @@ void cpu_buffer_reset(struct oprofile_cpu_buffer *cpu_buf)
cpu_buf
->
last_is_kernel
=
-
1
;
cpu_buf
->
last_is_kernel
=
-
1
;
cpu_buf
->
last_task
=
0
;
cpu_buf
->
last_task
=
0
;
}
}
drivers/oprofile/cpu_buffer.h
View file @
3c0ba99c
...
@@ -30,14 +30,13 @@ struct op_sample {
...
@@ -30,14 +30,13 @@ struct op_sample {
};
};
struct
oprofile_cpu_buffer
{
struct
oprofile_cpu_buffer
{
spinlock_t
int_lock
;
volatile
unsigned
long
head_pos
;
/* protected by int_lock */
volatile
unsigned
long
tail_pos
;
unsigned
long
pos
;
unsigned
long
buffer_size
;
struct
task_struct
*
last_task
;
struct
task_struct
*
last_task
;
int
last_is_kernel
;
int
last_is_kernel
;
struct
op_sample
*
buffer
;
struct
op_sample
*
buffer
;
unsigned
long
sample_received
;
unsigned
long
sample_received
;
unsigned
long
sample_lost_locked
;
unsigned
long
sample_lost_overflow
;
unsigned
long
sample_lost_overflow
;
unsigned
long
sample_lost_task_exit
;
unsigned
long
sample_lost_task_exit
;
}
____cacheline_aligned
;
}
____cacheline_aligned
;
...
...
drivers/oprofile/oprofile_stats.c
View file @
3c0ba99c
...
@@ -27,7 +27,6 @@ void oprofile_reset_stats(void)
...
@@ -27,7 +27,6 @@ void oprofile_reset_stats(void)
cpu_buf
=
&
cpu_buffer
[
i
];
cpu_buf
=
&
cpu_buffer
[
i
];
cpu_buf
->
sample_received
=
0
;
cpu_buf
->
sample_received
=
0
;
cpu_buf
->
sample_lost_locked
=
0
;
cpu_buf
->
sample_lost_overflow
=
0
;
cpu_buf
->
sample_lost_overflow
=
0
;
cpu_buf
->
sample_lost_task_exit
=
0
;
cpu_buf
->
sample_lost_task_exit
=
0
;
}
}
...
@@ -63,8 +62,6 @@ void oprofile_create_stats_files(struct super_block * sb, struct dentry * root)
...
@@ -63,8 +62,6 @@ void oprofile_create_stats_files(struct super_block * sb, struct dentry * root)
*/
*/
oprofilefs_create_ro_ulong
(
sb
,
cpudir
,
"sample_received"
,
oprofilefs_create_ro_ulong
(
sb
,
cpudir
,
"sample_received"
,
&
cpu_buf
->
sample_received
);
&
cpu_buf
->
sample_received
);
oprofilefs_create_ro_ulong
(
sb
,
cpudir
,
"sample_lost_locked"
,
&
cpu_buf
->
sample_lost_locked
);
oprofilefs_create_ro_ulong
(
sb
,
cpudir
,
"sample_lost_overflow"
,
oprofilefs_create_ro_ulong
(
sb
,
cpudir
,
"sample_lost_overflow"
,
&
cpu_buf
->
sample_lost_overflow
);
&
cpu_buf
->
sample_lost_overflow
);
oprofilefs_create_ro_ulong
(
sb
,
cpudir
,
"sample_lost_task_exit"
,
oprofilefs_create_ro_ulong
(
sb
,
cpudir
,
"sample_lost_task_exit"
,
...
...
drivers/parport/ieee1284.c
View file @
3c0ba99c
...
@@ -170,7 +170,7 @@ int parport_wait_peripheral(struct parport *port,
...
@@ -170,7 +170,7 @@ int parport_wait_peripheral(struct parport *port,
{
{
int
ret
;
int
ret
;
int
usec
;
int
usec
;
long
deadline
;
unsigned
long
deadline
;
unsigned
char
status
;
unsigned
char
status
;
usec
=
port
->
physport
->
spintime
;
/* usecs of fast polling */
usec
=
port
->
physport
->
spintime
;
/* usecs of fast polling */
...
...
drivers/parport/ieee1284_ops.c
View file @
3c0ba99c
...
@@ -58,7 +58,7 @@ size_t parport_ieee1284_write_compat (struct parport *port,
...
@@ -58,7 +58,7 @@ size_t parport_ieee1284_write_compat (struct parport *port,
parport_write_control
(
port
,
ctl
);
parport_write_control
(
port
,
ctl
);
parport_data_forward
(
port
);
parport_data_forward
(
port
);
while
(
count
<
len
)
{
while
(
count
<
len
)
{
long
expire
=
jiffies
+
dev
->
timeout
;
unsigned
long
expire
=
jiffies
+
dev
->
timeout
;
long
wait
=
(
HZ
+
99
)
/
100
;
long
wait
=
(
HZ
+
99
)
/
100
;
unsigned
char
mask
=
(
PARPORT_STATUS_ERROR
unsigned
char
mask
=
(
PARPORT_STATUS_ERROR
|
PARPORT_STATUS_BUSY
);
|
PARPORT_STATUS_BUSY
);
...
@@ -431,7 +431,7 @@ size_t parport_ieee1284_ecp_write_data (struct parport *port,
...
@@ -431,7 +431,7 @@ size_t parport_ieee1284_ecp_write_data (struct parport *port,
|
PARPORT_CONTROL_INIT
,
|
PARPORT_CONTROL_INIT
,
PARPORT_CONTROL_INIT
);
PARPORT_CONTROL_INIT
);
for
(
written
=
0
;
written
<
len
;
written
++
,
buf
++
)
{
for
(
written
=
0
;
written
<
len
;
written
++
,
buf
++
)
{
long
expire
=
jiffies
+
port
->
cad
->
timeout
;
unsigned
long
expire
=
jiffies
+
port
->
cad
->
timeout
;
unsigned
char
byte
;
unsigned
char
byte
;
byte
=
*
buf
;
byte
=
*
buf
;
...
@@ -520,7 +520,7 @@ size_t parport_ieee1284_ecp_read_data (struct parport *port,
...
@@ -520,7 +520,7 @@ size_t parport_ieee1284_ecp_read_data (struct parport *port,
parport_write_control
(
port
,
parport_write_control
(
port
,
ctl
|
PARPORT_CONTROL_AUTOFD
);
ctl
|
PARPORT_CONTROL_AUTOFD
);
while
(
count
<
len
)
{
while
(
count
<
len
)
{
long
expire
=
jiffies
+
dev
->
timeout
;
unsigned
long
expire
=
jiffies
+
dev
->
timeout
;
unsigned
char
byte
;
unsigned
char
byte
;
int
command
;
int
command
;
...
@@ -668,7 +668,7 @@ size_t parport_ieee1284_ecp_write_addr (struct parport *port,
...
@@ -668,7 +668,7 @@ size_t parport_ieee1284_ecp_write_addr (struct parport *port,
PARPORT_CONTROL_AUTOFD
PARPORT_CONTROL_AUTOFD
|
PARPORT_CONTROL_INIT
);
|
PARPORT_CONTROL_INIT
);
for
(
written
=
0
;
written
<
len
;
written
++
,
buf
++
)
{
for
(
written
=
0
;
written
<
len
;
written
++
,
buf
++
)
{
long
expire
=
jiffies
+
port
->
cad
->
timeout
;
unsigned
long
expire
=
jiffies
+
port
->
cad
->
timeout
;
unsigned
char
byte
;
unsigned
char
byte
;
byte
=
*
buf
;
byte
=
*
buf
;
...
...
fs/filesystems.c
View file @
3c0ba99c
...
@@ -125,9 +125,7 @@ int register_filesystem(struct file_system_type * fs)
...
@@ -125,9 +125,7 @@ int register_filesystem(struct file_system_type * fs)
if
(
!
res
)
{
if
(
!
res
)
{
/* we implicitly possess reference to @fs during registration,
/* we implicitly possess reference to @fs during registration,
* so it cannot be unregister from under us. */
* so it cannot be unregister from under us. */
if
(
register_fs_subsys
(
fs
))
register_fs_subsys
(
fs
);
printk
(
KERN_WARNING
"Failed to register '%s' in sysfs
\n
"
,
fs
->
name
);
}
}
return
res
;
return
res
;
}
}
...
...
fs/sysfs/mount.c
View file @
3c0ba99c
...
@@ -33,7 +33,7 @@ static int sysfs_fill_super(struct super_block *sb, void *data, int silent)
...
@@ -33,7 +33,7 @@ static int sysfs_fill_super(struct super_block *sb, void *data, int silent)
sb
->
s_op
=
&
sysfs_ops
;
sb
->
s_op
=
&
sysfs_ops
;
sysfs_sb
=
sb
;
sysfs_sb
=
sb
;
inode
=
sysfs_new_inode
(
S_IFDIR
|
S_IR
UGO
|
S_IWUSR
);
inode
=
sysfs_new_inode
(
S_IFDIR
|
S_IR
WXU
|
S_IRUGO
|
S_IXUGO
);
if
(
inode
)
{
if
(
inode
)
{
inode
->
i_op
=
&
simple_dir_inode_operations
;
inode
->
i_op
=
&
simple_dir_inode_operations
;
inode
->
i_fop
=
&
simple_dir_operations
;
inode
->
i_fop
=
&
simple_dir_operations
;
...
...
include/linux/jiffies.h
View file @
3c0ba99c
#ifndef _LINUX_JIFFIES_H
#ifndef _LINUX_JIFFIES_H
#define _LINUX_JIFFIES_H
#define _LINUX_JIFFIES_H
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/types.h>
#include <linux/spinlock.h>
#include <linux/spinlock.h>
#include <linux/seqlock.h>
#include <linux/seqlock.h>
...
@@ -37,10 +38,16 @@ static inline u64 get_jiffies_64(void)
...
@@ -37,10 +38,16 @@ static inline u64 get_jiffies_64(void)
* good compiler would generate better code (and a really good compiler
* good compiler would generate better code (and a really good compiler
* wouldn't care). Gcc is currently neither.
* wouldn't care). Gcc is currently neither.
*/
*/
#define time_after(a,b) ((long)(b) - (long)(a) < 0)
#define time_after(a,b) \
(typecheck(unsigned long, a) && \
typecheck(unsigned long, b) && \
((long)(b) - (long)(a) < 0))
#define time_before(a,b) time_after(b,a)
#define time_before(a,b) time_after(b,a)
#define time_after_eq(a,b) ((long)(a) - (long)(b) >= 0)
#define time_after_eq(a,b) \
(typecheck(unsigned long, a) && \
typecheck(unsigned long, b) && \
((long)(a) - (long)(b) >= 0))
#define time_before_eq(a,b) time_after_eq(b,a)
#define time_before_eq(a,b) time_after_eq(b,a)
#endif
#endif
include/linux/kernel.h
View file @
3c0ba99c
...
@@ -188,6 +188,17 @@ extern void dump_stack(void);
...
@@ -188,6 +188,17 @@ extern void dump_stack(void);
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
(type *)( (char *)__mptr - offsetof(type,member) );})
(type *)( (char *)__mptr - offsetof(type,member) );})
/*
* Check at compile time that something is of a particular type.
* Always evaluates to 1 so you may use it easily in conparisons.
*/
#define typecheck(type,x) \
({ type __dummy; \
typeof(x) __dummy2; \
(void)(&__dummy == &__dummy2); \
1; \
})
#endif
/* __KERNEL__ */
#endif
/* __KERNEL__ */
#define SI_LOAD_SHIFT 16
#define SI_LOAD_SHIFT 16
...
...
include/linux/profile.h
View file @
3c0ba99c
sound/pci/ac97/ac97_codec.c
View file @
3c0ba99c
...
@@ -1808,7 +1808,7 @@ static void snd_ac97_get_name(ac97_t *ac97, unsigned int id, char *name)
...
@@ -1808,7 +1808,7 @@ static void snd_ac97_get_name(ac97_t *ac97, unsigned int id, char *name)
*/
*/
static
int
ac97_reset_wait
(
ac97_t
*
ac97
,
int
timeout
,
int
with_modem
)
static
int
ac97_reset_wait
(
ac97_t
*
ac97
,
int
timeout
,
int
with_modem
)
{
{
signed
long
end_time
;
un
signed
long
end_time
;
end_time
=
jiffies
+
timeout
;
end_time
=
jiffies
+
timeout
;
do
{
do
{
unsigned
short
ext_mid
;
unsigned
short
ext_mid
;
...
@@ -1866,7 +1866,7 @@ int snd_ac97_mixer(snd_card_t * card, ac97_t * _ac97, ac97_t ** rac97)
...
@@ -1866,7 +1866,7 @@ int snd_ac97_mixer(snd_card_t * card, ac97_t * _ac97, ac97_t ** rac97)
int
err
;
int
err
;
ac97_t
*
ac97
;
ac97_t
*
ac97
;
char
name
[
64
];
char
name
[
64
];
signed
long
end_time
;
un
signed
long
end_time
;
static
snd_device_ops_t
ops
=
{
static
snd_device_ops_t
ops
=
{
.
dev_free
=
snd_ac97_dev_free
,
.
dev_free
=
snd_ac97_dev_free
,
};
};
...
...
sound/pci/intel8x0.c
View file @
3c0ba99c
...
@@ -1741,7 +1741,7 @@ static void do_delay(intel8x0_t *chip)
...
@@ -1741,7 +1741,7 @@ static void do_delay(intel8x0_t *chip)
static
int
snd_intel8x0_ich_chip_init
(
intel8x0_t
*
chip
)
static
int
snd_intel8x0_ich_chip_init
(
intel8x0_t
*
chip
)
{
{
signed
long
end_time
;
un
signed
long
end_time
;
unsigned
int
cnt
,
status
,
nstatus
;
unsigned
int
cnt
,
status
,
nstatus
;
/* put logic to right state */
/* put logic to right state */
...
...
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