diff options
| author | Nathan Chancellor <nathan@kernel.org> | 2026-09-08 15:10:06 -0700 |
|---|---|---|
| committer | Mathieu Poirier <mathieu.poirier@linaro.org> | 2026-09-09 09:28:17 -0600 |
| commit | c39c2cdbde1f2ad9e2886167e55ad6b4c4907d7f (patch) | |
| tree | bff42435f7531a3cc0d3ae41e4f6779ce842390b /scripts/basic/split-include.c | |
| parent | 1029c89bafc714c1b987f29e3bc124a7b63d28d5 (diff) | |
| download | linux-next-c39c2cdbde1f2ad9e2886167e55ad6b4c4907d7f.tar.gz linux-next-c39c2cdbde1f2ad9e2886167e55ad6b4c4907d7f.zip | |
samples: rpmsg: Fix mtu printk specifiers
When building rpmsg_client_sample.c for a 32-bit platform, such as
during arm allmodconfig, there are a few warnings due to using an
incorrect specifier for mtu:
samples/rpmsg/rpmsg_client_sample.c:68:59: error: format specifies type 'long' but the argument has type 'ssize_t' (aka 'int') [-Werror,-Wformat]
68 | dev_warn(&rpdev->dev, "invalid rpmsg MTU size = %ld\n", mtu);
| ~~~ ^~~
| %zd
...
samples/rpmsg/rpmsg_client_sample.c:72:50: error: format specifies type 'long' but the argument has type 'ssize_t' (aka 'int') [-Werror,-Wformat]
72 | dev_info(&rpdev->dev, "rpmsg MTU size = %ld\n", mtu);
| ~~~ ^~~
| %zd
...
samples/rpmsg/rpmsg_client_sample.c:79:17: error: format specifies type 'long' but the argument has type 'ssize_t' (aka 'int') [-Werror,-Wformat]
78 | "message size %zu exceeds rpmsg MTU size %ld\n",
| ~~~
| %zd
79 | strlen(MSG), mtu);
| ^~~
Use '%zd', the proper specifier for a 'ssize_t' variable, to clear up
the warning. Additionally, modify the last dev_err() call in
rpmsg_sample_probe() to reuse msg_len instead of calling strlen(MSG)
again and use '%zd' throughout the string consistently.
Fixes: 1029c89bafc7 ("samples: rpmsg: Add MTU size info")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/r/20260908-samples-rpmsg-fix-mtu-print-v1-1-f995518f0a46@kernel.org
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Diffstat (limited to 'scripts/basic/split-include.c')
0 files changed, 0 insertions, 0 deletions
