mbox series

[0/2] soundwire: bus: Prevent infinite loop in sdw_ch_mask_to_ch()

Message ID 20230202154212.1098736-1-rf@opensource.cirrus.com (mailing list archive)
Headers show
Series soundwire: bus: Prevent infinite loop in sdw_ch_mask_to_ch() | expand

Message

Richard Fitzgerald Feb. 2, 2023, 3:42 p.m. UTC
sdw_ch_mask_to_ch() would loop forever if bit 31 of the mask was set.
The entire function is unnecessary because the existing standard
function hweight32() already does the same thing, and hweight32() is
safe. But the change has been made in two steps.

Richard Fitzgerald (2):
  soundwire: bus: Prevent infinite loop in sdw_ch_mask_to_ch()
  soundwire: bandwidth allocation: Use hweight32() to calculate set bits

 drivers/soundwire/bus.h                          | 11 -----------
 drivers/soundwire/generic_bandwidth_allocation.c |  3 ++-
 2 files changed, 2 insertions(+), 12 deletions(-)