Skip to content
Unverified Commit cb9d8a2c authored by Richard Fitzgerald's avatar Richard Fitzgerald Committed by Mark Brown
Browse files

ASoC: cs35l56: Prevent bad sign extension in cs35l56_read_silicon_uid()



Cast u8 values to u32 when using them to build a 32-bit unsigned value
that is then stored in a u64. This avoids the possibility of a bad sign
extension where the u8 is implicitly extended to an int, thus changing it
from an unsigned to a signed value.

Whether this is a real problem is debatable, but it does no harm to
ensure that the u8 are cast to a suitable type for shifting.

Signed-off-by: default avatarRichard Fitzgerald <rf@opensource.cirrus.com>
Fixes: e1830f66

 ("ASoC: cs35l56: Add helper functions for amp calibration")
Link: https://msgid.link/r/20240227100042.99-1-rf@opensource.cirrus.com
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent b8614377
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment