* [PATCH] drm/i915/pxp: Fix size_t format specifier in gsccs_send_message()
@ 2023-05-30 18:37 Nathan Chancellor
2023-05-30 19:39 ` [Intel-gfx] " Andi Shyti
0 siblings, 1 reply; 3+ messages in thread
From: Nathan Chancellor @ 2023-05-30 18:37 UTC (permalink / raw)
To: jani.nikula, joonas.lahtinen, rodrigo.vivi, tvrtko.ursulin
Cc: daniele.ceraolospurio, alan.previn.teres.alexis,
radhakrishna.sripada, intel-gfx, dri-devel, patches,
Nathan Chancellor
When building ARCH=i386 allmodconfig, the following warning occurs:
In file included from include/linux/device.h:15,
from include/linux/node.h:18,
from include/linux/cpu.h:17,
from include/linux/static_call.h:135,
from arch/x86/include/asm/perf_event.h:5,
from include/linux/perf_event.h:25,
from drivers/gpu/drm/i915/i915_pmu.h:11,
from drivers/gpu/drm/i915/gt/intel_engine_types.h:21,
from drivers/gpu/drm/i915/gt/intel_context_types.h:18,
from drivers/gpu/drm/i915/gem/i915_gem_context_types.h:20,
from drivers/gpu/drm/i915/i915_request.h:34,
from drivers/gpu/drm/i915/i915_active.h:13,
from drivers/gpu/drm/i915/gt/intel_context.h:13,
from drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.c:8:
drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.c: In function 'gsccs_send_message':
include/drm/drm_print.h:456:39: error: format '%ld' expects argument of type 'long int', but argument 4 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]
456 | dev_##level##type((drm)->dev, "[drm] " fmt, ##__VA_ARGS__)
| ^~~~~~~~
include/linux/dev_printk.h:110:30: note: in definition of macro 'dev_printk_index_wrap'
110 | _p_func(dev, fmt, ##__VA_ARGS__); \
| ^~~
include/linux/dev_printk.h:146:61: note: in expansion of macro 'dev_fmt'
146 | dev_printk_index_wrap(_dev_warn, KERN_WARNING, dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~
include/drm/drm_print.h:456:9: note: in expansion of macro 'dev_warn'
456 | dev_##level##type((drm)->dev, "[drm] " fmt, ##__VA_ARGS__)
| ^~~~
include/drm/drm_print.h:466:9: note: in expansion of macro '__drm_printk'
466 | __drm_printk((drm), warn,, fmt, ##__VA_ARGS__)
| ^~~~~~~~~~~~
drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.c:146:17: note: in expansion of macro 'drm_warn'
146 | drm_warn(&i915->drm, "caller with insufficient PXP reply size %u (%ld)\n",
| ^~~~~~~~
cc1: all warnings being treated as errors
Use the '%zu' format specifier, as the variable is a 'size_t'.
Fixes: dc9ac125d81f ("drm/i915/pxp: Add GSC-CS backend to send GSC fw messages")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.c b/drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.c
index 8dc41de3f6f7..a217821eb0fb 100644
--- a/drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.c
+++ b/drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.c
@@ -143,7 +143,7 @@ gsccs_send_message(struct intel_pxp *pxp,
reply_size = header->message_size - sizeof(*header);
if (reply_size > msg_out_size_max) {
- drm_warn(&i915->drm, "caller with insufficient PXP reply size %u (%ld)\n",
+ drm_warn(&i915->drm, "caller with insufficient PXP reply size %u (%zu)\n",
reply_size, msg_out_size_max);
reply_size = msg_out_size_max;
}
---
base-commit: 08264f85c5c05ecc38d409c84d48cfb00ccd3bc4
change-id: 20230530-i915-pxp-size_t-wformat-1d73ed1f8d23
Best regards,
--
Nathan Chancellor <nathan@kernel.org>
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Intel-gfx] [PATCH] drm/i915/pxp: Fix size_t format specifier in gsccs_send_message()
2023-05-30 18:37 [PATCH] drm/i915/pxp: Fix size_t format specifier in gsccs_send_message() Nathan Chancellor
@ 2023-05-30 19:39 ` Andi Shyti
2023-06-02 15:17 ` Jani Nikula
0 siblings, 1 reply; 3+ messages in thread
From: Andi Shyti @ 2023-05-30 19:39 UTC (permalink / raw)
To: Nathan Chancellor
Cc: jani.nikula, joonas.lahtinen, rodrigo.vivi, tvrtko.ursulin,
alan.previn.teres.alexis, intel-gfx, patches, dri-devel
Hi Nathan,
On Tue, May 30, 2023 at 11:37:56AM -0700, Nathan Chancellor wrote:
> When building ARCH=i386 allmodconfig, the following warning occurs:
>
> In file included from include/linux/device.h:15,
> from include/linux/node.h:18,
> from include/linux/cpu.h:17,
> from include/linux/static_call.h:135,
> from arch/x86/include/asm/perf_event.h:5,
> from include/linux/perf_event.h:25,
> from drivers/gpu/drm/i915/i915_pmu.h:11,
> from drivers/gpu/drm/i915/gt/intel_engine_types.h:21,
> from drivers/gpu/drm/i915/gt/intel_context_types.h:18,
> from drivers/gpu/drm/i915/gem/i915_gem_context_types.h:20,
> from drivers/gpu/drm/i915/i915_request.h:34,
> from drivers/gpu/drm/i915/i915_active.h:13,
> from drivers/gpu/drm/i915/gt/intel_context.h:13,
> from drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.c:8:
> drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.c: In function 'gsccs_send_message':
> include/drm/drm_print.h:456:39: error: format '%ld' expects argument of type 'long int', but argument 4 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]
> 456 | dev_##level##type((drm)->dev, "[drm] " fmt, ##__VA_ARGS__)
> | ^~~~~~~~
> include/linux/dev_printk.h:110:30: note: in definition of macro 'dev_printk_index_wrap'
> 110 | _p_func(dev, fmt, ##__VA_ARGS__); \
> | ^~~
> include/linux/dev_printk.h:146:61: note: in expansion of macro 'dev_fmt'
> 146 | dev_printk_index_wrap(_dev_warn, KERN_WARNING, dev, dev_fmt(fmt), ##__VA_ARGS__)
> | ^~~~~~~
> include/drm/drm_print.h:456:9: note: in expansion of macro 'dev_warn'
> 456 | dev_##level##type((drm)->dev, "[drm] " fmt, ##__VA_ARGS__)
> | ^~~~
> include/drm/drm_print.h:466:9: note: in expansion of macro '__drm_printk'
> 466 | __drm_printk((drm), warn,, fmt, ##__VA_ARGS__)
> | ^~~~~~~~~~~~
> drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.c:146:17: note: in expansion of macro 'drm_warn'
> 146 | drm_warn(&i915->drm, "caller with insufficient PXP reply size %u (%ld)\n",
> | ^~~~~~~~
> cc1: all warnings being treated as errors
>
> Use the '%zu' format specifier, as the variable is a 'size_t'.
>
> Fixes: dc9ac125d81f ("drm/i915/pxp: Add GSC-CS backend to send GSC fw messages")
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
yes, as specified in Documentation/core-api/printk-formats.rst.
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Thanks,
Andi
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Intel-gfx] [PATCH] drm/i915/pxp: Fix size_t format specifier in gsccs_send_message()
2023-05-30 19:39 ` [Intel-gfx] " Andi Shyti
@ 2023-06-02 15:17 ` Jani Nikula
0 siblings, 0 replies; 3+ messages in thread
From: Jani Nikula @ 2023-06-02 15:17 UTC (permalink / raw)
To: Andi Shyti, Nathan Chancellor
Cc: joonas.lahtinen, rodrigo.vivi, tvrtko.ursulin,
alan.previn.teres.alexis, intel-gfx, patches, dri-devel
On Tue, 30 May 2023, Andi Shyti <andi.shyti@linux.intel.com> wrote:
> Hi Nathan,
>
> On Tue, May 30, 2023 at 11:37:56AM -0700, Nathan Chancellor wrote:
>> When building ARCH=i386 allmodconfig, the following warning occurs:
>>
>> In file included from include/linux/device.h:15,
>> from include/linux/node.h:18,
>> from include/linux/cpu.h:17,
>> from include/linux/static_call.h:135,
>> from arch/x86/include/asm/perf_event.h:5,
>> from include/linux/perf_event.h:25,
>> from drivers/gpu/drm/i915/i915_pmu.h:11,
>> from drivers/gpu/drm/i915/gt/intel_engine_types.h:21,
>> from drivers/gpu/drm/i915/gt/intel_context_types.h:18,
>> from drivers/gpu/drm/i915/gem/i915_gem_context_types.h:20,
>> from drivers/gpu/drm/i915/i915_request.h:34,
>> from drivers/gpu/drm/i915/i915_active.h:13,
>> from drivers/gpu/drm/i915/gt/intel_context.h:13,
>> from drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.c:8:
>> drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.c: In function 'gsccs_send_message':
>> include/drm/drm_print.h:456:39: error: format '%ld' expects argument of type 'long int', but argument 4 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]
>> 456 | dev_##level##type((drm)->dev, "[drm] " fmt, ##__VA_ARGS__)
>> | ^~~~~~~~
>> include/linux/dev_printk.h:110:30: note: in definition of macro 'dev_printk_index_wrap'
>> 110 | _p_func(dev, fmt, ##__VA_ARGS__); \
>> | ^~~
>> include/linux/dev_printk.h:146:61: note: in expansion of macro 'dev_fmt'
>> 146 | dev_printk_index_wrap(_dev_warn, KERN_WARNING, dev, dev_fmt(fmt), ##__VA_ARGS__)
>> | ^~~~~~~
>> include/drm/drm_print.h:456:9: note: in expansion of macro 'dev_warn'
>> 456 | dev_##level##type((drm)->dev, "[drm] " fmt, ##__VA_ARGS__)
>> | ^~~~
>> include/drm/drm_print.h:466:9: note: in expansion of macro '__drm_printk'
>> 466 | __drm_printk((drm), warn,, fmt, ##__VA_ARGS__)
>> | ^~~~~~~~~~~~
>> drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.c:146:17: note: in expansion of macro 'drm_warn'
>> 146 | drm_warn(&i915->drm, "caller with insufficient PXP reply size %u (%ld)\n",
>> | ^~~~~~~~
>> cc1: all warnings being treated as errors
>>
>> Use the '%zu' format specifier, as the variable is a 'size_t'.
>>
>> Fixes: dc9ac125d81f ("drm/i915/pxp: Add GSC-CS backend to send GSC fw messages")
>> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
>
> yes, as specified in Documentation/core-api/printk-formats.rst.
>
> Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Thanks for the patch and review, pushed to drm-intel-gt-next. The CI
failure was about hdac, hardly anything to do with this one.
BR,
Jani.
>
> Thanks,
> Andi
--
Jani Nikula, Intel Open Source Graphics Center
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-06-02 15:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-30 18:37 [PATCH] drm/i915/pxp: Fix size_t format specifier in gsccs_send_message() Nathan Chancellor
2023-05-30 19:39 ` [Intel-gfx] " Andi Shyti
2023-06-02 15:17 ` Jani Nikula
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).