Skip to content

Commit

Permalink
Merge branches 'pnp' and 'pm-tools'
Browse files Browse the repository at this point in the history
* pnp:
  PNP / ACPI: use unsigned int in pnpacpi_encode_resources()
  PNP / ACPI: use u8 instead of int in acpi_resource_extended_irq context

* pm-tools:
  cpupower: mperf monitor: fix output in MAX_FREQ_SYSFS mode
  • Loading branch information
rafaeljw committed Jun 18, 2015
3 parents b306976 + fac69a2 + 47b98c7 commit a8269d3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
10 changes: 5 additions & 5 deletions drivers/pnp/pnpacpi/rsparser.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
#include "../base.h"
#include "pnpacpi.h"

static void decode_irq_flags(struct pnp_dev *dev, int flags, int *triggering,
int *polarity, int *shareable)
static void decode_irq_flags(struct pnp_dev *dev, int flags, u8 *triggering,
u8 *polarity, u8 *shareable)
{
switch (flags & (IORESOURCE_IRQ_LOWLEVEL | IORESOURCE_IRQ_HIGHLEVEL |
IORESOURCE_IRQ_LOWEDGE | IORESOURCE_IRQ_HIGHEDGE)) {
Expand Down Expand Up @@ -654,7 +654,7 @@ static void pnpacpi_encode_irq(struct pnp_dev *dev,
struct resource *p)
{
struct acpi_resource_irq *irq = &resource->data.irq;
int triggering, polarity, shareable;
u8 triggering, polarity, shareable;

if (!pnp_resource_enabled(p)) {
irq->interrupt_count = 0;
Expand Down Expand Up @@ -683,7 +683,7 @@ static void pnpacpi_encode_ext_irq(struct pnp_dev *dev,
struct resource *p)
{
struct acpi_resource_extended_irq *extended_irq = &resource->data.extended_irq;
int triggering, polarity, shareable;
u8 triggering, polarity, shareable;

if (!pnp_resource_enabled(p)) {
extended_irq->interrupt_count = 0;
Expand Down Expand Up @@ -873,7 +873,7 @@ int pnpacpi_encode_resources(struct pnp_dev *dev, struct acpi_buffer *buffer)
/* pnpacpi_build_resource_template allocates extra mem */
int res_cnt = (buffer->length - 1) / sizeof(struct acpi_resource) - 1;
struct acpi_resource *resource = buffer->pointer;
int port = 0, irq = 0, dma = 0, mem = 0;
unsigned int port = 0, irq = 0, dma = 0, mem = 0;

pnp_dbg(&dev->dev, "encode %d resources\n", res_cnt);
while (i < res_cnt) {
Expand Down
5 changes: 3 additions & 2 deletions tools/power/cpupower/utils/idle_monitor/mperf_monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ static int mperf_get_count_percent(unsigned int id, double *percent,
dprint("%s: TSC Ref - mperf_diff: %llu, tsc_diff: %llu\n",
mperf_cstates[id].name, mperf_diff, tsc_diff);
} else if (max_freq_mode == MAX_FREQ_SYSFS) {
timediff = timespec_diff_us(time_start, time_end);
timediff = max_frequency * timespec_diff_us(time_start, time_end);
*percent = 100.0 * mperf_diff / timediff;
dprint("%s: MAXFREQ - mperf_diff: %llu, time_diff: %llu\n",
mperf_cstates[id].name, mperf_diff, timediff);
Expand Down Expand Up @@ -176,7 +176,7 @@ static int mperf_get_count_freq(unsigned int id, unsigned long long *count,
dprint("%s: Average freq based on %s maximum frequency:\n",
mperf_cstates[id].name,
(max_freq_mode == MAX_FREQ_TSC_REF) ? "TSC calculated" : "sysfs read");
dprint("%max_frequency: %lu", max_frequency);
dprint("max_frequency: %lu\n", max_frequency);
dprint("aperf_diff: %llu\n", aperf_diff);
dprint("mperf_diff: %llu\n", mperf_diff);
dprint("avg freq: %llu\n", *count);
Expand Down Expand Up @@ -279,6 +279,7 @@ static int init_maxfreq_mode(void)
return -1;
}
max_freq_mode = MAX_FREQ_SYSFS;
max_frequency /= 1000; /* Default automatically to MHz value */
return 0;
}

Expand Down

0 comments on commit a8269d3

Please sign in to comment.