From 34a092a99729dd4de014aa1f76c48660f28a9c97 Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Sat, 3 Dec 2022 15:24:41 +0000 Subject: rbcodec dsp: Replace enum dsp_ids arguments with unsigned int Because casting to and from "enum dsp_id" just adds noise, change everything to unsigned int. Change-Id: I52a7ae55f406e673d5b811b29657fcdc4b62ab10 --- lib/rbcodec/dsp/dsp_core.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'lib/rbcodec/dsp/dsp_core.c') diff --git a/lib/rbcodec/dsp/dsp_core.c b/lib/rbcodec/dsp/dsp_core.c index 3e72322ea6..14bf228bd6 100644 --- a/lib/rbcodec/dsp/dsp_core.c +++ b/lib/rbcodec/dsp/dsp_core.c @@ -483,24 +483,19 @@ intptr_t dsp_configure(struct dsp_config *dsp, unsigned int setting, return proc_broadcast(dsp, setting, value); } -struct dsp_config * dsp_get_config(enum dsp_ids id) +struct dsp_config *dsp_get_config(unsigned int dsp_id) { - if (id >= DSP_COUNT) + if (dsp_id >= DSP_COUNT) return NULL; - return &dsp_conf[id]; + return &dsp_conf[dsp_id]; } /* Return the id given a dsp pointer (or even via something within the struct itself) */ -enum dsp_ids dsp_get_id(const struct dsp_config *dsp) +unsigned int dsp_get_id(const struct dsp_config *dsp) { - ptrdiff_t id = dsp - dsp_conf; - - if (id < 0 || id >= DSP_COUNT) - return DSP_COUNT; /* obviously invalid */ - - return (enum dsp_ids)id; + return dsp - dsp_conf; } /* Do what needs initializing before enable/disable calls can be made. -- cgit v1.2.3