10 Dec
2021
10 Dec
'21
8:06 p.m.
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.