Linux Framebuffer Layer development
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Dan Carpenter <error27@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
	Andy Shevchenko <andy@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Helge Deller <deller@gmx.de>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Chintan Patel <chintanlike@gmail.com>,
	dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] staging: fbtft: Use sysfs_emit_at() to print to sysfs file
Date: Wed, 3 Jun 2026 10:49:11 +0300	[thread overview]
Message-ID: <ah_cd9Ax4fzOhBp7@ashevche-desk.local> (raw)
In-Reply-To: <ah_Y_Y2RtqeGxchF@stanley.mountain>

On Wed, Jun 03, 2026 at 10:34:21AM +0300, Dan Carpenter wrote:
> This scnprintf() uses the wrong limit.  It should be "PAGE_SIZE - len"
> instead of just PAGE_SIZE.  We're not going to hit the limit in real
> life since we are printing at most FBTFT_GAMMA_MAX_VALUES_TOTAL (128)
> u32 values, however, it's still worth fixing.
> 
> Use sysfs_emit_at() to fix this since this is a sysfs file.

OK,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>

...

>  	for (i = 0; i < par->gamma.num_curves; i++) {
>  		for (j = 0; j < par->gamma.num_values; j++)
> -			len += scnprintf(&buf[len], PAGE_SIZE,
> +			len += sysfs_emit_at(buf, len,
>  			     "%04x ", curves[i * par->gamma.num_values + j]);

Can we switch to use hex_dump_to_buffer() at some point?

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2026-06-03  7:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-03  7:34 [PATCH] staging: fbtft: Use sysfs_emit_at() to print to sysfs file Dan Carpenter
2026-06-03  7:49 ` Andy Shevchenko [this message]
2026-06-03 12:48   ` David Laight

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=ah_cd9Ax4fzOhBp7@ashevche-desk.local \
    --to=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=chintanlike@gmail.com \
    --cc=deller@gmx.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=error27@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=thomas.petazzoni@free-electrons.com \
    --cc=tzimmermann@suse.de \
    /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