public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Shuah Khan <skhan@linuxfoundation.org>
To: Kaushlendra Kumar <kaushlendra.kumar@intel.com>,
	shuah@kernel.org, trenn@suse.com, jwyatt@redhat.com
Cc: linux-pm@vger.kernel.org, Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH v2] tools/cpupower: Fix incorrect size in cpuidle_state_disable()
Date: Thu, 25 Sep 2025 14:22:10 -0600	[thread overview]
Message-ID: <a866de67-8ab2-4913-b601-7e2049ce258f@linuxfoundation.org> (raw)
In-Reply-To: <20250917050820.1785377-1-kaushlendra.kumar@intel.com>

On 9/16/25 23:08, Kaushlendra Kumar wrote:
> Fix incorrect size parameter passed to cpuidle_state_write_file() in
> cpuidle_state_disable().
> 
> The function was incorrectly using sizeof(disable) which returns the
> size of the unsigned int variable (4 bytes) instead of the actual
> length of the string stored in the 'value' buffer.
> 
> Since 'value' is populated with snprintf() to contain the string
> representation of the disable value, we should use the length
> returned by snprintf() to get the correct string length for
> writing to the sysfs file.
> 
> This ensures the correct number of bytes is written to the cpuidle
> state disable file in sysfs.
> 
> Signed-off-by: Kaushlendra Kumar <kaushlendra.kumar@intel.com>
> ---
> Changes in v2:
> - Use snprintf() return value instead of strlen() for better efficiency
> 

Thank you. Applied to git.kernel.org/pub/scm/linux/kernel/git/shuah/linux.git/log/?h=cpupower
for next PR to PM maintainer.

thanks,
-- Shuah

      reply	other threads:[~2025-09-25 20:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-17  5:08 [PATCH v2] tools/cpupower: Fix incorrect size in cpuidle_state_disable() Kaushlendra Kumar
2025-09-25 20:22 ` Shuah Khan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a866de67-8ab2-4913-b601-7e2049ce258f@linuxfoundation.org \
    --to=skhan@linuxfoundation.org \
    --cc=jwyatt@redhat.com \
    --cc=kaushlendra.kumar@intel.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=shuah@kernel.org \
    --cc=trenn@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox