25ed1950a453a94960a15a0c3564a357073beb3d
[openwrt/staging/rmilecki.git] /
1 From e575bca2b5e1e44a23b435711219e3941878dcb4 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Thu, 7 Jan 2021 11:41:26 +0000
4 Subject: [PATCH] staging/bcm2835-codec: Log the number of excess
5 supported formats
6
7 When logging that the firmware has provided more supported formats
8 than we had allocated storage for, log the number allocated and
9 returned.
10
11 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
12 ---
13 .../vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c | 12 ++++++++----
14 1 file changed, 8 insertions(+), 4 deletions(-)
15
16 --- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
17 +++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
18 @@ -2836,8 +2836,10 @@ static int bcm2835_codec_get_supported_f
19
20 if (ret) {
21 if (ret == MMAL_MSG_STATUS_ENOSPC) {
22 - v4l2_err(&dev->v4l2_dev, "%s: port has more encoding than we provided space for. Some are dropped.\n",
23 - __func__);
24 + v4l2_err(&dev->v4l2_dev,
25 + "%s: port has more encodings than we provided space for. Some are dropped (%u vs %u).\n",
26 + __func__, param_size / sizeof(u32),
27 + MAX_SUPPORTED_ENCODINGS);
28 num_encodings = MAX_SUPPORTED_ENCODINGS;
29 } else {
30 v4l2_err(&dev->v4l2_dev, "%s: get_param ret %u.\n",
31 @@ -2880,8 +2882,10 @@ static int bcm2835_codec_get_supported_f
32
33 if (ret) {
34 if (ret == MMAL_MSG_STATUS_ENOSPC) {
35 - v4l2_err(&dev->v4l2_dev, "%s: port has more encoding than we provided space for. Some are dropped.\n",
36 - __func__);
37 + v4l2_err(&dev->v4l2_dev,
38 + "%s: port has more encodings than we provided space for. Some are dropped (%u vs %u).\n",
39 + __func__, param_size / sizeof(u32),
40 + MAX_SUPPORTED_ENCODINGS);
41 num_encodings = MAX_SUPPORTED_ENCODINGS;
42 } else {
43 ret = -EINVAL;