]> git.baikalelectronics.ru Git - kernel.git/commit
firmware: arm_scmi: Fix sorting of retrieved clock rates
authorCristian Marussi <cristian.marussi@arm.com>
Fri, 18 Mar 2022 09:28:13 +0000 (09:28 +0000)
committerSudeep Holla <sudeep.holla@arm.com>
Mon, 4 Apr 2022 22:06:09 +0000 (23:06 +0100)
commitdd3472862fa713849b86a8407b11488d6f471b50
treea02dd88ab33cba5844247fb4bd6681191d11bc44
parent3693f101ed7902264f4d11ab1533030aed9ff2b0
firmware: arm_scmi: Fix sorting of retrieved clock rates

During SCMI Clock protocol initialization, after having retrieved from the
SCMI platform all the available discrete rates for a specific clock, the
clock rates array is sorted, unfortunately using a pointer to its end as
a base instead of its start, so that sorting does not work.

Fix invocation of sort() passing as base a pointer to the start of the
retrieved clock rates array.

Link: https://lore.kernel.org/r/20220318092813.49283-1-cristian.marussi@arm.com
Fixes: 7c0c91fa349d ("firmware: arm_scmi: Keep the discrete clock rates sorted")
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
drivers/firmware/arm_scmi/clock.c