[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <731fa66a-bed7-45fb-9187-a9263612eac4@sirena.org.uk>
Date: Wed, 7 Aug 2024 16:09:18 +0100
From: Mark Brown <broonie@...nel.org>
To: Arnd Bergmann <arnd@...nel.org>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>,
Liam Girdwood <lgirdwood@...il.com>,
Peter Ujfalusi <peter.ujfalusi@...ux.intel.com>,
Bard Liao <yung-chuan.liao@...ux.intel.com>,
Ranjani Sridharan <ranjani.sridharan@...ux.intel.com>,
Daniel Baluta <daniel.baluta@....com>,
Seppo Ingalsuo <seppo.ingalsuo@...ux.intel.com>,
Arnd Bergmann <arnd@...db.de>,
Kai Vehmanen <kai.vehmanen@...ux.intel.com>,
Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.com>,
Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Bill Wendling <morbo@...gle.com>,
Justin Stitt <justinstitt@...gle.com>,
Brent Lu <brent.lu@...el.com>, sound-open-firmware@...a-project.org,
linux-sound@...r.kernel.org, linux-kernel@...r.kernel.org,
llvm@...ts.linux.dev
Subject: Re: [PATCH] sound: sof: ioc4-topology: avoid extra dai_params copy
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.
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists