From: Jani Nikula <jani.nikula@intel.com>
To: Raag Jadav <raag.jadav@intel.com>
Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915/dp: use seq buf for printing rates
Date: Wed, 27 Nov 2024 19:06:59 +0200 [thread overview]
Message-ID: <87plmgwqq4.fsf@intel.com> (raw)
In-Reply-To: <Z0c8CH-CYD7F8e9m@black.fi.intel.com>
On Wed, 27 Nov 2024, Raag Jadav <raag.jadav@intel.com> wrote:
> On Wed, Nov 27, 2024 at 03:18:38PM +0200, Jani Nikula wrote:
>> Hand rolling the buffer overflow handling with snprintf() is a bit
>> tedious. The seq_buf interface is made for this. Switch to it.
>>
>> Use struct intel_display while at it.
>>
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>> ---
>> drivers/gpu/drm/i915/display/intel_dp.c | 36 ++++++++++---------------
>> 1 file changed, 14 insertions(+), 22 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
>> index 053a9a4182e7..4471c8fcd478 100644
>> --- a/drivers/gpu/drm/i915/display/intel_dp.c
>> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
>> @@ -28,6 +28,7 @@
>> #include <linux/export.h>
>> #include <linux/i2c.h>
>> #include <linux/notifier.h>
>> +#include <linux/seq_buf.h>
>> #include <linux/slab.h>
>> #include <linux/sort.h>
>> #include <linux/string_helpers.h>
>> @@ -1506,41 +1507,32 @@ bool intel_dp_source_supports_tps4(struct drm_i915_private *i915)
>> return DISPLAY_VER(i915) >= 10;
>> }
>>
>> -static void snprintf_int_array(char *str, size_t len,
>> - const int *array, int nelem)
>> +static void seq_buf_print_array(struct seq_buf *s, const int *array, int nelem)
>
> Perhaps with more users worth introducing as part of core lib?
Maybe later; right now I have neither the time or energy, just dumped
this off my local branch.
BR,
Jani.
>
> Andy and I did something similar with kmemdup.
> https://lore.kernel.org/linux-gpio/20241126172240.6044-1-raag.jadav@intel.com/
>
> Raag
--
Jani Nikula, Intel
next prev parent reply other threads:[~2024-11-27 17:07 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-27 13:18 [PATCH] drm/i915/dp: use seq buf for printing rates Jani Nikula
2024-11-27 13:26 ` ✓ CI.Patch_applied: success for " Patchwork
2024-11-27 13:26 ` ✓ CI.checkpatch: " Patchwork
2024-11-27 13:28 ` ✓ CI.KUnit: " Patchwork
2024-11-27 13:46 ` ✓ CI.Build: " Patchwork
2024-11-27 13:48 ` ✓ CI.Hooks: " Patchwork
2024-11-27 13:49 ` ✗ CI.checksparse: warning " Patchwork
2024-11-27 14:07 ` ✓ Xe.CI.BAT: success " Patchwork
2024-11-27 15:17 ` [PATCH] " Gustavo Sousa
2024-11-27 17:24 ` Jani Nikula
2024-11-27 18:04 ` Gustavo Sousa
2024-11-27 15:34 ` Raag Jadav
2024-11-27 17:06 ` Jani Nikula [this message]
2024-11-27 17:40 ` ✗ Xe.CI.Full: failure for " Patchwork
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=87plmgwqq4.fsf@intel.com \
--to=jani.nikula@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=raag.jadav@intel.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;
as well as URLs for NNTP newsgroup(s).