On Wed, Aug 07, 2024 at 10:02:27AM +0200, Arnd Bergmann wrote: > From what I can tell, this was unintentional, as both > sof_ipc4_prepare_dai_copier() and sof_ipc4_prepare_copier_module() make a > copy for the same purpose, but copying it once has the exact same effect. > Remove the extra copy and change the direct struct assignment to > an explicit memcpy() call to make it clearer to the reader that this > is what happens. Note that gcc treats struct assignment as a memcpy() > that may be inlined anyway, so the resulting object code is the same. The effect of the copy is to ensure that if the function fails the argument is unmodified - did you do the analysis to check that it's OK to modify on error? Your commit log says "the same purpose" but never specifies what that purpose is.
Attachment:
signature.asc
Description: PGP signature
- Follow-Ups:
- Re: [PATCH] sound: sof: ioc4-topology: avoid extra dai_params copy
- From: Arnd Bergmann
- Re: [PATCH] sound: sof: ioc4-topology: avoid extra dai_params copy
- References:
- [PATCH] sound: sof: ioc4-topology: avoid extra dai_params copy
- From: Arnd Bergmann
- [PATCH] sound: sof: ioc4-topology: avoid extra dai_params copy
- Prev by Date: [PATCH v2 3/3] ASoC: tas*: Drop unused GPIO includes
- Next by Date: Re: [PATCH] sound: sof: ioc4-topology: avoid extra dai_params copy
- Previous by thread: Re: [PATCH] sound: sof: ioc4-topology: avoid extra dai_params copy
- Next by thread: Re: [PATCH] sound: sof: ioc4-topology: avoid extra dai_params copy
- Index(es):