Re: [RFC v2 1/3] PM: Add a sysfs files to represent sleep duration

From: Greg KH
Date: Mon Nov 14 2022 - 02:12:53 EST


On Thu, Nov 10, 2022 at 12:47:21AM -0600, Mario Limonciello wrote:
> +static ssize_t last_hw_state_residency_show(struct kobject *kobj,
> + struct kobj_attribute *attr, char *buf)
> +{
> + return sprintf(buf, "%llu\n", suspend_stats.last_hw_state_residency);

sysfs_emit() please for sysfs files, not a "raw" sprintf().
checkpatch.pl should have caught that for you, but sometimes it doesn't.

thanks,

greg k-h