Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 157116
b: refs/heads/master
c: dac9ff7
h: refs/heads/master
v: v3
  • Loading branch information
Roel Kluin authored and Geert Uytterhoeven committed Aug 26, 2009
1 parent 4d19cdf commit da5d0f0
Show file tree
Hide file tree
Showing 15 changed files with 76 additions and 101 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cc674c81f01a6151ca00c617e5efa0812ee5fdbe
refs/heads/master: dac9ff79a8122b30176e23359bb879b3144d7f1f
6 changes: 0 additions & 6 deletions trunk/drivers/acpi/processor_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1151,9 +1151,6 @@ static int __init acpi_processor_init(void)
{
int result = 0;

if (acpi_disabled)
return 0;

memset(&errata, 0, sizeof(errata));

#ifdef CONFIG_SMP
Expand Down Expand Up @@ -1200,9 +1197,6 @@ static int __init acpi_processor_init(void)

static void __exit acpi_processor_exit(void)
{
if (acpi_disabled)
return;

acpi_processor_ppc_exit();

acpi_thermal_cpufreq_exit();
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/acpi/processor_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ static int acpi_processor_apply_limit(struct acpi_processor *pr)
if (pr->limit.thermal.tx > tx)
tx = pr->limit.thermal.tx;

result = acpi_processor_set_throttling(pr, tx, false);
result = acpi_processor_set_throttling(pr, tx);
if (result)
goto end;
}
Expand Down Expand Up @@ -421,12 +421,12 @@ processor_set_cur_state(struct thermal_cooling_device *cdev,

if (state <= max_pstate) {
if (pr->flags.throttling && pr->throttling.state)
result = acpi_processor_set_throttling(pr, 0, false);
result = acpi_processor_set_throttling(pr, 0);
cpufreq_set_cur_state(pr->id, state);
} else {
cpufreq_set_cur_state(pr->id, max_pstate);
result = acpi_processor_set_throttling(pr,
state - max_pstate, false);
state - max_pstate);
}
return result;
}
Expand Down
30 changes: 14 additions & 16 deletions trunk/drivers/acpi/processor_throttling.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ struct throttling_tstate {
#define THROTTLING_POSTCHANGE (2)

static int acpi_processor_get_throttling(struct acpi_processor *pr);
int acpi_processor_set_throttling(struct acpi_processor *pr,
int state, bool force);
int acpi_processor_set_throttling(struct acpi_processor *pr, int state);

static int acpi_processor_update_tsd_coord(void)
{
Expand Down Expand Up @@ -362,7 +361,7 @@ int acpi_processor_tstate_has_changed(struct acpi_processor *pr)
*/
target_state = throttling_limit;
}
return acpi_processor_set_throttling(pr, target_state, false);
return acpi_processor_set_throttling(pr, target_state);
}

/*
Expand Down Expand Up @@ -840,10 +839,10 @@ static int acpi_processor_get_throttling_ptc(struct acpi_processor *pr)
if (ret >= 0) {
state = acpi_get_throttling_state(pr, value);
if (state == -1) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Invalid throttling state, reset\n"));
ACPI_WARNING((AE_INFO,
"Invalid throttling state, reset"));
state = 0;
ret = acpi_processor_set_throttling(pr, state, true);
ret = acpi_processor_set_throttling(pr, state);
if (ret)
return ret;
}
Expand Down Expand Up @@ -916,7 +915,7 @@ static int acpi_processor_get_fadt_info(struct acpi_processor *pr)
}

static int acpi_processor_set_throttling_fadt(struct acpi_processor *pr,
int state, bool force)
int state)
{
u32 value = 0;
u32 duty_mask = 0;
Expand All @@ -931,7 +930,7 @@ static int acpi_processor_set_throttling_fadt(struct acpi_processor *pr,
if (!pr->flags.throttling)
return -ENODEV;

if (!force && (state == pr->throttling.state))
if (state == pr->throttling.state)
return 0;

if (state < pr->throttling_platform_limit)
Expand Down Expand Up @@ -989,7 +988,7 @@ static int acpi_processor_set_throttling_fadt(struct acpi_processor *pr,
}

static int acpi_processor_set_throttling_ptc(struct acpi_processor *pr,
int state, bool force)
int state)
{
int ret;
acpi_integer value;
Expand All @@ -1003,7 +1002,7 @@ static int acpi_processor_set_throttling_ptc(struct acpi_processor *pr,
if (!pr->flags.throttling)
return -ENODEV;

if (!force && (state == pr->throttling.state))
if (state == pr->throttling.state)
return 0;

if (state < pr->throttling_platform_limit)
Expand All @@ -1019,8 +1018,7 @@ static int acpi_processor_set_throttling_ptc(struct acpi_processor *pr,
return 0;
}

int acpi_processor_set_throttling(struct acpi_processor *pr,
int state, bool force)
int acpi_processor_set_throttling(struct acpi_processor *pr, int state)
{
cpumask_var_t saved_mask;
int ret = 0;
Expand Down Expand Up @@ -1072,7 +1070,7 @@ int acpi_processor_set_throttling(struct acpi_processor *pr,
/* FIXME: use work_on_cpu() */
set_cpus_allowed_ptr(current, cpumask_of(pr->id));
ret = p_throttling->acpi_processor_set_throttling(pr,
t_state.target_state, force);
t_state.target_state);
} else {
/*
* When the T-state coordination is SW_ALL or HW_ALL,
Expand Down Expand Up @@ -1105,7 +1103,7 @@ int acpi_processor_set_throttling(struct acpi_processor *pr,
set_cpus_allowed_ptr(current, cpumask_of(i));
ret = match_pr->throttling.
acpi_processor_set_throttling(
match_pr, t_state.target_state, force);
match_pr, t_state.target_state);
}
}
/*
Expand Down Expand Up @@ -1203,7 +1201,7 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr)
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Disabling throttling (was T%d)\n",
pr->throttling.state));
result = acpi_processor_set_throttling(pr, 0, false);
result = acpi_processor_set_throttling(pr, 0);
if (result)
goto end;
}
Expand Down Expand Up @@ -1309,7 +1307,7 @@ static ssize_t acpi_processor_write_throttling(struct file *file,
if (strcmp(tmpbuf, charp) != 0)
return -EINVAL;

result = acpi_processor_set_throttling(pr, state_val, false);
result = acpi_processor_set_throttling(pr, state_val);
if (result)
return result;

Expand Down
24 changes: 7 additions & 17 deletions trunk/drivers/leds/ledtrig-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,6 @@ static ssize_t gpio_trig_inverted_store(struct device *dev,

gpio_data->inverted = !!inverted;

/* After inverting, we need to update the LED. */
schedule_work(&gpio_data->work);

return n;
}
static DEVICE_ATTR(inverted, 0644, gpio_trig_inverted_show,
Expand Down Expand Up @@ -149,26 +146,20 @@ static ssize_t gpio_trig_gpio_store(struct device *dev,
return -EINVAL;
}

if (gpio_data->gpio == gpio)
return n;

if (!gpio) {
if (gpio_data->gpio != 0)
free_irq(gpio_to_irq(gpio_data->gpio), led);
gpio_data->gpio = 0;
free_irq(gpio_to_irq(gpio_data->gpio), led);
return n;
}

if (gpio_data->gpio > 0 && gpio_data->gpio != gpio)
free_irq(gpio_to_irq(gpio_data->gpio), led);

gpio_data->gpio = gpio;
ret = request_irq(gpio_to_irq(gpio), gpio_trig_irq,
IRQF_SHARED | IRQF_TRIGGER_RISING
| IRQF_TRIGGER_FALLING, "ledtrig-gpio", led);
if (ret) {
if (ret)
dev_err(dev, "request_irq failed with error %d\n", ret);
} else {
if (gpio_data->gpio != 0)
free_irq(gpio_to_irq(gpio_data->gpio), led);
gpio_data->gpio = gpio;
}

return ret ? ret : n;
}
Expand Down Expand Up @@ -220,8 +211,7 @@ static void gpio_trig_deactivate(struct led_classdev *led)
device_remove_file(led->dev, &dev_attr_inverted);
device_remove_file(led->dev, &dev_attr_desired_brightness);
flush_work(&gpio_data->work);
if (gpio_data->gpio != 0)
free_irq(gpio_to_irq(gpio_data->gpio), led);
free_irq(gpio_to_irq(gpio_data->gpio),led);
kfree(gpio_data);
}
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/macintosh/via-maciisi.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ static void maciisi_sync(struct adb_request *req)
}
/* This could be BAD... when the ADB controller doesn't respond
* for this long, it's probably not coming back :-( */
if(count >= 50) /* Hopefully shouldn't happen */
if (count > 50) /* Hopefully shouldn't happen */
printk(KERN_ERR "maciisi_send_request: poll timed out!\n");
}

Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/platform/x86/wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ u32 method_id, const struct acpi_buffer *in, struct acpi_buffer *out)
acpi_status status;
struct acpi_object_list input;
union acpi_object params[3];
char method[5] = "WM";
char method[4] = "WM";

if (!find_guid(guid_string, &wblock))
return AE_ERROR;
Expand Down Expand Up @@ -328,8 +328,8 @@ struct acpi_buffer *out)
acpi_status status, wc_status = AE_ERROR;
struct acpi_object_list input, wc_input;
union acpi_object wc_params[1], wq_params[1];
char method[5];
char wc_method[5] = "WC";
char method[4];
char wc_method[4] = "WC";

if (!guid_string || !out)
return AE_BAD_PARAMETER;
Expand Down Expand Up @@ -410,7 +410,7 @@ const struct acpi_buffer *in)
acpi_handle handle;
struct acpi_object_list input;
union acpi_object params[2];
char method[5] = "WS";
char method[4] = "WS";

if (!guid_string || !in)
return AE_BAD_DATA;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/pps/pps.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ int pps_register_cdev(struct pps_device *pps)
}
pps->dev = device_create(pps_class, pps->info.dev, pps->devno, NULL,
"pps%d", pps->id);
if (IS_ERR(pps->dev))
if (err)
goto del_cdev;
dev_set_drvdata(pps->dev, pps);

Expand Down
9 changes: 1 addition & 8 deletions trunk/drivers/thermal/thermal_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -953,12 +953,7 @@ void thermal_zone_device_update(struct thermal_zone_device *tz)

mutex_lock(&tz->lock);

if (tz->ops->get_temp(tz, &temp)) {
/* get_temp failed - retry it later */
printk(KERN_WARNING PREFIX "failed to read out thermal zone "
"%d\n", tz->id);
goto leave;
}
tz->ops->get_temp(tz, &temp);

for (count = 0; count < tz->trips; count++) {
tz->ops->get_trip_type(tz, count, &trip_type);
Expand Down Expand Up @@ -1010,8 +1005,6 @@ void thermal_zone_device_update(struct thermal_zone_device *tz)
THERMAL_TRIPS_NONE);

tz->last_temperature = temp;

leave:
if (tz->passive)
thermal_zone_device_set_polling(tz, tz->passive_delay);
else if (tz->polling_delay)
Expand Down
5 changes: 2 additions & 3 deletions trunk/include/acpi/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ struct acpi_processor_throttling {
cpumask_var_t shared_cpu_map;
int (*acpi_processor_get_throttling) (struct acpi_processor * pr);
int (*acpi_processor_set_throttling) (struct acpi_processor * pr,
int state, bool force);
int state);

u32 address;
u8 duty_offset;
Expand Down Expand Up @@ -321,8 +321,7 @@ static inline int acpi_processor_ppc_has_changed(struct acpi_processor *pr)
/* in processor_throttling.c */
int acpi_processor_tstate_has_changed(struct acpi_processor *pr);
int acpi_processor_get_throttling_info(struct acpi_processor *pr);
extern int acpi_processor_set_throttling(struct acpi_processor *pr,
int state, bool force);
extern int acpi_processor_set_throttling(struct acpi_processor *pr, int state);
extern const struct file_operations acpi_processor_throttling_fops;
extern void acpi_processor_throttling_init(void);
/* in processor_idle.c */
Expand Down
12 changes: 5 additions & 7 deletions trunk/include/linux/flex_array.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct flex_array {
struct {
int element_size;
int total_nr_elements;
struct flex_array_part *parts[];
struct flex_array_part *parts[0];
};
/*
* This little trick makes sure that
Expand All @@ -36,14 +36,12 @@ struct flex_array {
.total_nr_elements = (total), \
} } }

struct flex_array *flex_array_alloc(int element_size, unsigned int total,
gfp_t flags);
int flex_array_prealloc(struct flex_array *fa, unsigned int start,
unsigned int end, gfp_t flags);
struct flex_array *flex_array_alloc(int element_size, int total, gfp_t flags);
int flex_array_prealloc(struct flex_array *fa, int start, int end, gfp_t flags);
void flex_array_free(struct flex_array *fa);
void flex_array_free_parts(struct flex_array *fa);
int flex_array_put(struct flex_array *fa, unsigned int element_nr, void *src,
int flex_array_put(struct flex_array *fa, int element_nr, void *src,
gfp_t flags);
void *flex_array_get(struct flex_array *fa, unsigned int element_nr);
void *flex_array_get(struct flex_array *fa, int element_nr);

#endif /* _FLEX_ARRAY_H */
20 changes: 15 additions & 5 deletions trunk/kernel/fork.c
Original file line number Diff line number Diff line change
Expand Up @@ -815,8 +815,11 @@ static int copy_signal(unsigned long clone_flags, struct task_struct *tsk)
{
struct signal_struct *sig;

if (clone_flags & CLONE_THREAD)
if (clone_flags & CLONE_THREAD) {
atomic_inc(&current->signal->count);
atomic_inc(&current->signal->live);
return 0;
}

sig = kmem_cache_alloc(signal_cachep, GFP_KERNEL);
tsk->signal = sig;
Expand Down Expand Up @@ -874,6 +877,16 @@ void __cleanup_signal(struct signal_struct *sig)
kmem_cache_free(signal_cachep, sig);
}

static void cleanup_signal(struct task_struct *tsk)
{
struct signal_struct *sig = tsk->signal;

atomic_dec(&sig->live);

if (atomic_dec_and_test(&sig->count))
__cleanup_signal(sig);
}

static void copy_flags(unsigned long clone_flags, struct task_struct *p)
{
unsigned long new_flags = p->flags;
Expand Down Expand Up @@ -1226,8 +1239,6 @@ static struct task_struct *copy_process(unsigned long clone_flags,
}

if (clone_flags & CLONE_THREAD) {
atomic_inc(&current->signal->count);
atomic_inc(&current->signal->live);
p->group_leader = current->group_leader;
list_add_tail_rcu(&p->thread_group, &p->group_leader->thread_group);
}
Expand Down Expand Up @@ -1271,8 +1282,7 @@ static struct task_struct *copy_process(unsigned long clone_flags,
if (p->mm)
mmput(p->mm);
bad_fork_cleanup_signal:
if (!(clone_flags & CLONE_THREAD))
__cleanup_signal(p->signal);
cleanup_signal(p);
bad_fork_cleanup_sighand:
__cleanup_sighand(p->sighand);
bad_fork_cleanup_fs:
Expand Down
Loading

0 comments on commit da5d0f0

Please sign in to comment.