Re: [RESEND, v9 06/10] ASoC: qcom: Add regmap config support for codec dma driver

From: Mark Brown
Date: Fri Dec 10 2021 - 14:06:38 EST


On Mon, Dec 06, 2021 at 07:52:43PM +0530, Srinivasa Rao Mandadapu wrote:

> +static bool __lpass_rxtx_regmap_accessible(struct device *dev, unsigned int reg, bool rw)
> +{
> + struct lpass_data *drvdata = dev_get_drvdata(dev);
> + struct lpass_variant *v = drvdata->variant;
> + int i;
> +
> + for (i = 0; i < v->rxtx_irq_ports; ++i) {

> + for (i = 0; i < v->rxtx_rdma_channels; ++i) {

This is looking relatively expensive to run with all these loops -
there's a reason these are normally written as switch statements, the
theory being that the compiler will generate something at least as good
as any data structure we're likely to code. It's not a *problem*
exactly, but if you're doing anything that ends up querying properties a
lot it might be an issue.

Attachment: signature.asc
Description: PGP signature