Commit 1da28f03 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

Merge branches 'acpi-ec', 'acpi-fan' and 'acpi-pci'

* acpi-ec:
  ACPI: EC: Eliminate EC_FLAGS_QUERY_HANDSHAKE
  ACPI: EC: Do not clear boot_ec_is_ecdt in acpi_ec_add()
  ACPI: EC: Simplify acpi_ec_ecdt_start() and acpi_ec_init()
  ACPI: EC: Consolidate event handler installation code
  ACPI: EC: Use fast path in acpi_ec_add() for DSDT boot EC
  ACPI: EC: Simplify acpi_ec_add()
  ACPI: EC: Drop AE_NOT_FOUND special case from ec_install_handlers()
  ACPI: EC: Avoid passing redundant argument to functions
  ACPI: EC: Avoid printing confusing messages in acpi_ec_setup()

* acpi-fan:
  ACPI: fan: Use scnprintf() for avoiding potential buffer overflow

* acpi-pci:
  ACPI: PCI: Use scnprintf() for avoiding potential buffer overflow
This diff is collapsed.
......@@ -276,29 +276,29 @@ static ssize_t show_state(struct device *dev, struct device_attribute *attr, cha
int count;
if (fps->control == 0xFFFFFFFF || fps->control > 100)
count = snprintf(buf, PAGE_SIZE, "not-defined:");
count = scnprintf(buf, PAGE_SIZE, "not-defined:");
else
count = snprintf(buf, PAGE_SIZE, "%lld:", fps->control);
count = scnprintf(buf, PAGE_SIZE, "%lld:", fps->control);
if (fps->trip_point == 0xFFFFFFFF || fps->trip_point > 9)
count += snprintf(&buf[count], PAGE_SIZE, "not-defined:");
count += scnprintf(&buf[count], PAGE_SIZE - count, "not-defined:");
else
count += snprintf(&buf[count], PAGE_SIZE, "%lld:", fps->trip_point);
count += scnprintf(&buf[count], PAGE_SIZE - count, "%lld:", fps->trip_point);
if (fps->speed == 0xFFFFFFFF)
count += snprintf(&buf[count], PAGE_SIZE, "not-defined:");
count += scnprintf(&buf[count], PAGE_SIZE - count, "not-defined:");
else
count += snprintf(&buf[count], PAGE_SIZE, "%lld:", fps->speed);
count += scnprintf(&buf[count], PAGE_SIZE - count, "%lld:", fps->speed);
if (fps->noise_level == 0xFFFFFFFF)
count += snprintf(&buf[count], PAGE_SIZE, "not-defined:");
count += scnprintf(&buf[count], PAGE_SIZE - count, "not-defined:");
else
count += snprintf(&buf[count], PAGE_SIZE, "%lld:", fps->noise_level * 100);
count += scnprintf(&buf[count], PAGE_SIZE - count, "%lld:", fps->noise_level * 100);
if (fps->power == 0xFFFFFFFF)
count += snprintf(&buf[count], PAGE_SIZE, "not-defined\n");
count += scnprintf(&buf[count], PAGE_SIZE - count, "not-defined\n");
else
count += snprintf(&buf[count], PAGE_SIZE, "%lld\n", fps->power);
count += scnprintf(&buf[count], PAGE_SIZE - count, "%lld\n", fps->power);
return count;
}
......
......@@ -190,7 +190,7 @@ extern struct acpi_ec *first_ec;
/* External interfaces use first EC only, so remember */
typedef int (*acpi_ec_query_func) (void *data);
int acpi_ec_init(void);
void acpi_ec_init(void);
void acpi_ec_ecdt_probe(void);
void acpi_ec_dsdt_probe(void);
void acpi_ec_block_transactions(void);
......
......@@ -153,7 +153,7 @@ static void decode_osc_bits(struct acpi_pci_root *root, char *msg, u32 word,
buf[0] = '\0';
for (i = 0, entry = table; i < size; i++, entry++)
if (word & entry->bit)
len += snprintf(buf + len, sizeof(buf) - len, "%s%s",
len += scnprintf(buf + len, sizeof(buf) - len, "%s%s",
len ? " " : "", entry->desc);
dev_info(&root->device->dev, "_OSC: %s [%s]\n", msg, buf);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment