[PATCH 34/40] drm/amd/display/amdgpu_dm/amdgpu_dm_helpers: Use 'gnu_printf' format notation

Alex Deucher alexdeucher at gmail.com
Tue Dec 1 19:41:14 UTC 2020


On Tue, Dec 1, 2020 at 1:59 PM Christian König <christian.koenig at amd.com> wrote:
>
> Am 01.12.20 um 19:42 schrieb Alex Deucher:
> > On Thu, Nov 26, 2020 at 8:44 AM Lee Jones <lee.jones at linaro.org> wrote:
> >> Fixes the following W=1 kernel build warning(s):
> >>
> >>   drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_helpers.c: In function ‘dm_dtn_log_append_v’:
> >>   drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_helpers.c:345:2: warning: function ‘dm_dtn_log_append_v’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]
> >>   drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_helpers.c:375:3: warning: function ‘dm_dtn_log_append_v’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]
> >>
> >> Cc: Harry Wentland <harry.wentland at amd.com>
> >> Cc: Leo Li <sunpeng.li at amd.com>
> >> Cc: Alex Deucher <alexander.deucher at amd.com>
> >> Cc: "Christian König" <christian.koenig at amd.com>
> >> Cc: David Airlie <airlied at linux.ie>
> >> Cc: Daniel Vetter <daniel at ffwll.ch>
> >> Cc: amd-gfx at lists.freedesktop.org
> >> Cc: dri-devel at lists.freedesktop.org
> >> Signed-off-by: Lee Jones <lee.jones at linaro.org>
> >> ---
> >>   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 1 +
> >>   1 file changed, 1 insertion(+)
> >>
> >> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
> >> index b7d7ec3ba00d7..24a81642baa26 100644
> >> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
> >> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
> >> @@ -318,6 +318,7 @@ void dm_dtn_log_begin(struct dc_context *ctx,
> >>          dm_dtn_log_append_v(ctx, log_ctx, "%s", msg);
> >>   }
> >>
> >> +__printf(3, 4)
> > Can you expand a bit on what this does?
>
> Been a while since I looked into something like this, but IIRC this
> means that parameter 3 (msg) is considered a printf format string and
> the types of parameter 4 and following checked against that.
>
> Looks correct to me.

Thanks.  Applied.

Alex


>
> Christian.
>
> >
> > Alex
> >
> >>   void dm_dtn_log_append_v(struct dc_context *ctx,
> >>          struct dc_log_buffer_ctx *log_ctx,
> >>          const char *msg, ...)
> >> --
> >> 2.25.1
> >>
> >> _______________________________________________
> >> dri-devel mailing list
> >> dri-devel at lists.freedesktop.org
> >> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Fdri-devel&data=04%7C01%7Cchristian.koenig%40amd.com%7C50bdbd2fb7a5400e91c008d89628d11c%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C1%7C637424450053181783%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=afzSSu%2Fba0%2FQiwOameJRO5Sgs5joRPondWQx%2ByQZZlU%3D&reserved=0
>


More information about the amd-gfx mailing list