From: Jani Nikula <jani.nikula@intel.com>
To: Alex Deucher <alexdeucher@gmail.com>
Cc: Pan@freedesktop.org, intel-gfx@lists.freedesktop.org,
Xinhui <Xinhui.Pan@amd.com>,
amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
"Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>
Subject: Re: [PATCH 3/6] drm/amdgpu: prefer snprintf over sprintf
Date: Wed, 31 Jan 2024 14:48:26 +0200 [thread overview]
Message-ID: <87eddxis85.fsf@intel.com> (raw)
In-Reply-To: <CADnq5_MZuVDx2VeErcOXSqkgRrnFsrn1=N8Y-K47Woar-aeAyw@mail.gmail.com>
On Fri, 12 Jan 2024, Alex Deucher <alexdeucher@gmail.com> wrote:
> On Wed, Jan 10, 2024 at 12:39 PM Jani Nikula <jani.nikula@intel.com> wrote:
>>
>> This will trade the W=1 warning -Wformat-overflow to
>> -Wformat-truncation. This lets us enable -Wformat-overflow subsystem
>> wide.
>>
>> Cc: Alex Deucher <alexander.deucher@amd.com>
>> Cc: Christian König <christian.koenig@amd.com>
>> Cc: Pan, Xinhui <Xinhui.Pan@amd.com>
>> Cc: amd-gfx@lists.freedesktop.org
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>
> Acked-by: Alex Deucher <alexander.deucher@amd.com>
>
> Feel free to take this via whichever tree makes sense.
Thanks, pushed this one patch to drm-misc-next as prep work.
BR,
Jani.
>
> Alex
>
>> ---
>> drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
>> index b9674c57c436..82b4b2019fca 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
>> @@ -329,7 +329,8 @@ int amdgpu_gfx_kiq_init_ring(struct amdgpu_device *adev,
>>
>> ring->eop_gpu_addr = kiq->eop_gpu_addr;
>> ring->no_scheduler = true;
>> - sprintf(ring->name, "kiq_%d.%d.%d.%d", xcc_id, ring->me, ring->pipe, ring->queue);
>> + snprintf(ring->name, sizeof(ring->name), "kiq_%d.%d.%d.%d",
>> + xcc_id, ring->me, ring->pipe, ring->queue);
>> r = amdgpu_ring_init(adev, ring, 1024, irq, AMDGPU_CP_KIQ_IRQ_DRIVER0,
>> AMDGPU_RING_PRIO_DEFAULT, NULL);
>> if (r)
>> --
>> 2.39.2
>>
--
Jani Nikula, Intel
next prev parent reply other threads:[~2024-01-31 12:48 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-10 17:39 [PATCH 0/6] drm: enable W=1 warnings by default across the subsystem Jani Nikula
2024-01-10 17:39 ` [PATCH 1/6] drm/nouveau/acr/ga102: remove unused but set variable Jani Nikula
2024-01-31 12:50 ` Jani Nikula
2024-01-31 19:01 ` Danilo Krummrich
2024-02-01 9:41 ` Jani Nikula
2024-01-10 17:39 ` [PATCH 2/6] drm/nouveau/svm: remove unused but set variables Jani Nikula
2024-01-31 12:51 ` Jani Nikula
2024-01-31 19:10 ` Danilo Krummrich
2024-02-01 9:42 ` Jani Nikula
2024-01-10 17:39 ` [PATCH 3/6] drm/amdgpu: prefer snprintf over sprintf Jani Nikula
2024-01-12 4:09 ` kernel test robot
2024-01-12 9:07 ` Jani Nikula
2024-01-12 14:57 ` Alex Deucher
2024-01-31 12:48 ` Jani Nikula [this message]
2024-01-10 17:39 ` [PATCH 4/6] drm/imx: " Jani Nikula
2024-01-12 10:49 ` kernel test robot
2024-01-12 14:20 ` Philipp Zabel
2024-01-31 12:49 ` Jani Nikula
2024-01-10 17:39 ` [PATCH 5/6] drm: enable (most) W=1 warnings by default across the subsystem Jani Nikula
2024-01-10 20:15 ` Hamza Mahfooz
2024-01-11 9:43 ` Jani Nikula
2024-01-10 17:39 ` [PATCH 6/6] drm: Add CONFIG_DRM_WERROR Jani Nikula
2024-01-10 20:17 ` Hamza Mahfooz
2024-04-04 15:16 ` [PATCH 0/6] drm: enable W=1 warnings by default across the subsystem Aishwarya TCV
2024-04-05 9:57 ` Jani Nikula
2024-04-05 10:28 ` Aishwarya TCV
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=87eddxis85.fsf@intel.com \
--to=jani.nikula@intel.com \
--cc=Pan@freedesktop.org \
--cc=Xinhui.Pan@amd.com \
--cc=alexander.deucher@amd.com \
--cc=alexdeucher@gmail.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
/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).