Unverified Commit fa3542e8 authored by Adrian Barnaś's avatar Adrian Barnaś Committed by Stephen Boyd
Browse files

clk: keystone: Fix discarded const qualifiers



Add const qualifiers to the pointers returned from 'container_of' macro
to prevent breaking the const promise on const struct pointers from
parameters.

Once you have a mutable container structure pointer, you can change
structure fields through it, which violates the const guarantee.

Signed-off-by: default avatarAdrian Barnaś <abarnas@google.com>
Reviewed-by: default avatarNishanth Menon <nm@ti.com>
Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent 79d022dc
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -496,8 +496,8 @@ static int ti_sci_scan_clocks_from_fw(struct sci_clk_provider *provider)
static int _cmp_sci_clk_list(void *priv, const struct list_head *a,
			     const struct list_head *b)
{
	struct sci_clk *ca = container_of(a, struct sci_clk, node);
	struct sci_clk *cb = container_of(b, struct sci_clk, node);
	const struct sci_clk *ca = container_of(a, struct sci_clk, node);
	const struct sci_clk *cb = container_of(b, struct sci_clk, node);

	return _cmp_sci_clk(ca, &cb);
}