mbox series

[v6,00/10] media: Fix the last set of coccinelle warnings

Message ID 20240813-cocci-flexarray-v6-0-de903fd8d988@chromium.org
Headers show
Series media: Fix the last set of coccinelle warnings | expand

Message

Ricardo Ribalda Aug. 13, 2024, 12:31 p.m. UTC
With this patchset we are done with all the cocci warning/errors.

To: Stanimir Varbanov <stanimir.k.varbanov@gmail.com>
To: Vikash Garodia <quic_vgarodia@quicinc.com>
To: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
To: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: linux-media@vger.kernel.org
Cc: linux-arm-msm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>

Changes in v6: Thanks Bryan
- Rebase
- Instead of removing the unsused structures convert them to flex arrays
- Link to v5: https://lore.kernel.org/r/20240618-cocci-flexarray-v5-0-6a8294942f48@chromium.org

Changes in v5: Thanks Vikash
- Remove patches already merged
- Fix typos and remove hfi_resource_ocmem_requirement
- Link to v4: https://lore.kernel.org/r/20240606-cocci-flexarray-v4-0-3379ee5eed28@chromium.org

Changes in v4:
- Remove patches already merged
- Combine dvb-frontend/mxl5xx patches and use flex on both (Thanks Hans)
- Link to v3: https://lore.kernel.org/r/20240527-cocci-flexarray-v3-0-cda09c535816@chromium.org

Changes in v3:
- Do not rename structure fields. (Thanks Bryan)
- Link to v2: https://lore.kernel.org/r/20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org

Changes in v2:
- allegro: Replace hard coded 1 with a define. (Thanks Michael)
- Link to v1: https://lore.kernel.org/r/20240507-cocci-flexarray-v1-0-4a421c21fd06@chromium.org

---
Ricardo Ribalda (10):
      media: venus: Use flex array for hfi_session_release_buffer_pkt
      media: venus: Refactor struct hfi_uncompressed_plane_info
      media: venus: Refactor struct hfi_session_get_property_pkt
      media: venus: Refactor struct hfi_uncompressed_format_supported
      media: venus: Refactor hfi_session_empty_buffer_uncompressed_plane0_pkt
      media: venus: Refactor hfi_session_empty_buffer_compressed_pkt
      media: venus: Refactor hfi_sys_get_property_pkt
      media: venus: Refactor hfi_session_fill_buffer_pkt
      media: venus: Refactor hfi_buffer_alloc_mode_supported
      media: venus: Convert one-element-arrays to flex-arrays

 drivers/media/platform/qcom/venus/hfi_cmds.c   |  8 ++++----
 drivers/media/platform/qcom/venus/hfi_cmds.h   | 18 +++++++++---------
 drivers/media/platform/qcom/venus/hfi_helper.h | 20 ++++++++++----------
 drivers/media/platform/qcom/venus/hfi_parser.c |  2 +-
 4 files changed, 24 insertions(+), 24 deletions(-)
---
base-commit: c80bfa4f9e0ebfce6ac909488d412347acbcb4f9
change-id: 20240507-cocci-flexarray-9a807a8e108e

Best regards,

Comments

Sergey Senozhatsky Aug. 14, 2024, 4:41 a.m. UTC | #1
On (24/08/13 12:31), Ricardo Ribalda wrote:
> 
> This structures are not used
> 

Why not just delete them?
Ricardo Ribalda Aug. 14, 2024, 8:06 a.m. UTC | #2
On Wed, 14 Aug 2024 at 06:41, Sergey Senozhatsky
<senozhatsky@chromium.org> wrote:
>
> On (24/08/13 12:31), Ricardo Ribalda wrote:
> >
> > This structures are not used
> >
>
> Why not just delete them?

Byran preferred to keep them for documentation purposes
https://lore.kernel.org/linux-media/0640d530-404d-40cf-9737-0d7468dd0177@linaro.org/T/#u

I am fine with both options.
Ricardo Ribalda Aug. 14, 2024, 11:40 a.m. UTC | #3
Hi Stan

On Tue, 13 Aug 2024 at 23:38, Stanimir Varbanov <svarbanov@suse.de> wrote:
>
> Hi Ricardo,
>
> On 8/13/24 15:31, Ricardo Ribalda wrote:
> > Replace the old style single element array with a flex array. We do not
> > allocate this structure, so the size change should not be an issue.
> >
> > This fixes the following cocci warning:
> > drivers/media/platform/qcom/venus/hfi_cmds.h:204:5-16: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays)
> >
> > Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> > Acked-by: Vikash Garodia <quic_vgarodia@quicinc.com>
> > Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
>
> Could you inverse the order of the tags, please. "Signed-off-by" must be
> first and then the others.

Just sent a v7 taking care of this.

I am almost sure that I used b4 to import the tags.... Are we sure
that this is a policy that we should follow?

Regards!

>
> All patches in the series has this issue.
>
> ~Stan
>