On Tue, Nov 05, 2024 at 04:20:23PM +0530, Suraj Sonawane wrote: > Thank you, Mark and Péter, for the guidance. I understand now that, while > the copier should always have at least one input format, static analysis > tools can’t detect this. Based on your suggestions, I’ve considered the > following possible solutions to address the issue: > 1. Add a WARN_ON_ONCE(!num_input_formats) check: This would issue a warning > and return an error if num_input_formats is unexpectedly zero, ensuring we > handle any edge cases explicitly. > 2. Return an error if no input formats are available: Implementing the > following check could provide immediate feedback if num_input_formats is > zero: > if (num_input_formats <= 0) { > dev_err(sdev->dev, "No input formats available\n"); > return -EINVAL; // Return an error if there are no formats > } > Would it be preferable to proceed with the WARN_ON_ONCE(!num_input_formats) > approach, or is there a preferred alternative from the options above? I don't have a super strong preference between the two options.
Attachment:
signature.asc
Description: PGP signature
- Follow-Ups:
- Re: [PATCH v2] sound: fix uninit-value in sof_ipc4_pcm_dai_link_fixup_rate
- From: Suraj Sonawane
- Re: [PATCH v2] sound: fix uninit-value in sof_ipc4_pcm_dai_link_fixup_rate
- References:
- [PATCH] sound: fix uninit-value in sof_ipc4_pcm_dai_link_fixup_rate
- From: Suraj Sonawane
- [PATCH v2] sound: fix uninit-value in sof_ipc4_pcm_dai_link_fixup_rate
- From: Suraj Sonawane
- Re: [PATCH v2] sound: fix uninit-value in sof_ipc4_pcm_dai_link_fixup_rate
- From: Péter Ujfalusi
- Re: [PATCH v2] sound: fix uninit-value in sof_ipc4_pcm_dai_link_fixup_rate
- From: Mark Brown
- Re: [PATCH v2] sound: fix uninit-value in sof_ipc4_pcm_dai_link_fixup_rate
- From: Suraj Sonawane
- [PATCH] sound: fix uninit-value in sof_ipc4_pcm_dai_link_fixup_rate
- Prev by Date: Re: [PATCH] ASoC: dt-bindings: everest,es8326: Document interrupt property
- Next by Date: Re: [PATCH 0/2] Soundwire dai link init logic refactor
- Previous by thread: Re: [PATCH v2] sound: fix uninit-value in sof_ipc4_pcm_dai_link_fixup_rate
- Next by thread: Re: [PATCH v2] sound: fix uninit-value in sof_ipc4_pcm_dai_link_fixup_rate
- Index(es):