alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: wm5102: Use get_unaligned_be16() for dac_comp_coeff
@ 2020-10-15 10:27 Richard Fitzgerald
  2020-10-26 23:46 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Fitzgerald @ 2020-10-15 10:27 UTC (permalink / raw)
  To: broonie; +Cc: patches, alsa-devel, Richard Fitzgerald, linux-kernel

Replace the two-step copy-and-convert in
wm5102_out_comp_coeff_put() with get_unaligned_be16(). Apart from
looking nicer, it avoids this sparse warning:

wm5102.c:687:35: sparse: sparse: cast to restricted __be16

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
---
 sound/soc/codecs/wm5102.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/sound/soc/codecs/wm5102.c b/sound/soc/codecs/wm5102.c
index 2ed3fa67027d..70d353b63fe0 100644
--- a/sound/soc/codecs/wm5102.c
+++ b/sound/soc/codecs/wm5102.c
@@ -682,9 +682,7 @@ static int wm5102_out_comp_coeff_put(struct snd_kcontrol *kcontrol,
 	struct arizona *arizona = dev_get_drvdata(component->dev->parent);
 
 	mutex_lock(&arizona->dac_comp_lock);
-	memcpy(&arizona->dac_comp_coeff, ucontrol->value.bytes.data,
-	       sizeof(arizona->dac_comp_coeff));
-	arizona->dac_comp_coeff = be16_to_cpu(arizona->dac_comp_coeff);
+	arizona->dac_comp_coeff = get_unaligned_be16(ucontrol->value.bytes.data);
 	mutex_unlock(&arizona->dac_comp_lock);
 
 	return 0;

base-commit: 2ebefde9de62a0828936e47b62975501993b5ee9
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ASoC: wm5102: Use get_unaligned_be16() for dac_comp_coeff
  2020-10-15 10:27 [PATCH] ASoC: wm5102: Use get_unaligned_be16() for dac_comp_coeff Richard Fitzgerald
@ 2020-10-26 23:46 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2020-10-26 23:46 UTC (permalink / raw)
  To: Richard Fitzgerald; +Cc: patches, alsa-devel, linux-kernel

On Thu, 15 Oct 2020 11:27:03 +0100, Richard Fitzgerald wrote:
> Replace the two-step copy-and-convert in
> wm5102_out_comp_coeff_put() with get_unaligned_be16(). Apart from
> looking nicer, it avoids this sparse warning:
> 
> wm5102.c:687:35: sparse: sparse: cast to restricted __be16

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: wm5102: Use get_unaligned_be16() for dac_comp_coeff
      commit: 79405e3e5375875f8edc7dd6c1cf5376b1ded6e7

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-10-26 23:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-15 10:27 [PATCH] ASoC: wm5102: Use get_unaligned_be16() for dac_comp_coeff Richard Fitzgerald
2020-10-26 23:46 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).