if (result)
return result;
- result = sprintf(buf, "%s\n", (char *)path.pointer);
+ result = sysfs_emit(buf, "%s\n", (char *)path.pointer);
kfree(path.pointer);
return result;
}
if (ret)
return ret;
- return sprintf(buf, "%s\n", acpi_power_state_string(state));
+ return sysfs_emit(buf, "%s\n", acpi_power_state_string(state));
}
static DEVICE_ATTR_RO(real_power_state);
{
struct acpi_device *adev = to_acpi_device(dev);
- return sprintf(buf, "%s\n", acpi_power_state_string(adev->power.state));
+ return sysfs_emit(buf, "%s\n", acpi_power_state_string(adev->power.state));
}
static DEVICE_ATTR_RO(power_state);
{
struct acpi_device *acpi_dev = to_acpi_device(dev);
- return sprintf(buf, "%s\n", acpi_device_hid(acpi_dev));
+ return sysfs_emit(buf, "%s\n", acpi_device_hid(acpi_dev));
}
static DEVICE_ATTR_RO(hid);
{
struct acpi_device *acpi_dev = to_acpi_device(dev);
- return sprintf(buf, "%s\n", acpi_device_uid(acpi_dev));
+ return sysfs_emit(buf, "%s\n", acpi_device_uid(acpi_dev));
}
static DEVICE_ATTR_RO(uid);
struct acpi_device *acpi_dev = to_acpi_device(dev);
if (acpi_dev->pnp.bus_address > U32_MAX)
- return sprintf(buf, "0x%016llx\n", acpi_dev->pnp.bus_address);
+ return sysfs_emit(buf, "0x%016llx\n", acpi_dev->pnp.bus_address);
else
- return sprintf(buf, "0x%08llx\n", acpi_dev->pnp.bus_address);
+ return sysfs_emit(buf, "0x%08llx\n", acpi_dev->pnp.bus_address);
}
static DEVICE_ATTR_RO(adr);
if (ACPI_FAILURE(status))
return -EIO;
- return sprintf(buf, "%llu\n", sun);
+ return sysfs_emit(buf, "%llu\n", sun);
}
static DEVICE_ATTR_RO(sun);
if (ACPI_FAILURE(status))
return -EIO;
- return sprintf(buf, "%llu\n", hrv);
+ return sysfs_emit(buf, "%llu\n", hrv);
}
static DEVICE_ATTR_RO(hrv);
if (ACPI_FAILURE(status))
return -EIO;
- return sprintf(buf, "%llu\n", sta);
+ return sysfs_emit(buf, "%llu\n", sta);
}
static DEVICE_ATTR_RO(status);
acpi_irq_not_handled;
all_counters[num_gpes + ACPI_NUM_FIXED_EVENTS + COUNT_GPE].count =
acpi_gpe_count;
- size = sprintf(buf, "%8u", all_counters[index].count);
+ size = sysfs_emit(buf, "%8u", all_counters[index].count);
/* "gpe_all" or "sci" */
if (index >= num_gpes + ACPI_NUM_FIXED_EVENTS)
goto end;
if (status & ACPI_EVENT_FLAG_ENABLE_SET)
- size += sprintf(buf + size, " EN");
+ size += sysfs_emit_at(buf, size, " EN");
else
- size += sprintf(buf + size, " ");
+ size += sysfs_emit_at(buf, size, " ");
if (status & ACPI_EVENT_FLAG_STATUS_SET)
- size += sprintf(buf + size, " STS");
+ size += sysfs_emit_at(buf, size, " STS");
else
- size += sprintf(buf + size, " ");
+ size += sysfs_emit_at(buf, size, " ");
if (!(status & ACPI_EVENT_FLAG_HAS_HANDLER))
- size += sprintf(buf + size, " invalid ");
+ size += sysfs_emit_at(buf, size, " invalid ");
else if (status & ACPI_EVENT_FLAG_ENABLED)
- size += sprintf(buf + size, " enabled ");
+ size += sysfs_emit_at(buf, size, " enabled ");
else if (status & ACPI_EVENT_FLAG_WAKE_ENABLED)
- size += sprintf(buf + size, " wake_enabled");
+ size += sysfs_emit_at(buf, size, " wake_enabled");
else
- size += sprintf(buf + size, " disabled ");
+ size += sysfs_emit_at(buf, size, " disabled ");
if (status & ACPI_EVENT_FLAG_MASKED)
- size += sprintf(buf + size, " masked ");
+ size += sysfs_emit_at(buf, size, " masked ");
else
- size += sprintf(buf + size, " unmasked");
+ size += sysfs_emit_at(buf, size, " unmasked");
end:
- size += sprintf(buf + size, "\n");
+ size += sysfs_emit_at(buf, size, "\n");
return result ? result : size;
}
static ssize_t pm_profile_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf)
{
- return sprintf(buf, "%d\n", acpi_gbl_FADT.preferred_profile);
+ return sysfs_emit(buf, "%d\n", acpi_gbl_FADT.preferred_profile);
}
static const struct kobj_attribute pm_profile_attr = __ATTR_RO(pm_profile);
{
struct acpi_hotplug_profile *hotplug = to_acpi_hotplug_profile(kobj);
- return sprintf(buf, "%d\n", hotplug->enabled);
+ return sysfs_emit(buf, "%d\n", hotplug->enabled);
}
static ssize_t enabled_store(struct kobject *kobj, struct kobj_attribute *attr,
static ssize_t force_remove_show(struct kobject *kobj,
struct kobj_attribute *attr, char *buf)
{
- return sprintf(buf, "%d\n", 0);
+ return sysfs_emit(buf, "%d\n", 0);
}
static ssize_t force_remove_store(struct kobject *kobj,