[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2c3b2533-f271-4e38-6779-d82d6da40ffd@nvidia.com>
Date: Mon, 27 Jan 2020 09:45:38 +0000
From: Jon Hunter <jonathanh@...dia.com>
To: Dmitry Osipenko <digetx@...il.com>,
Sameer Pujar <spujar@...dia.com>, <perex@...ex.cz>,
<tiwai@...e.com>, <robh+dt@...nel.org>
CC: <devicetree@...r.kernel.org>, <alsa-devel@...a-project.org>,
<atalambedu@...dia.com>, <linux-kernel@...r.kernel.org>,
<lgirdwood@...il.com>, <viswanathl@...dia.com>,
<sharadg@...dia.com>, <broonie@...nel.org>,
<thierry.reding@...il.com>, <linux-tegra@...r.kernel.org>,
<rlokhande@...dia.com>, <mkumard@...dia.com>, <dramesh@...dia.com>
Subject: Re: [alsa-devel] [PATCH 5/9] ASoC: tegra: add Tegra210 based AHUB
driver
On 24/01/2020 01:18, Dmitry Osipenko wrote:
> 20.01.2020 17:23, Sameer Pujar пишет:
> [snip]
>> +static int tegra_ahub_get_value_enum(struct snd_kcontrol *kctl,
>> + struct snd_ctl_elem_value *uctl)
>> +{
>> + struct snd_soc_component *cmpnt = snd_soc_dapm_kcontrol_component(kctl);
>> + struct tegra_ahub *ahub = snd_soc_component_get_drvdata(cmpnt);
>> + struct soc_enum *e = (struct soc_enum *)kctl->private_value;
>> + unsigned int reg, i, bit_pos = 0;
>> +
>> + /*
>> + * Find the bit position of current MUX input.
>> + * If nothing is set, position would be 0 and it corresponds to 'None'.
>> + */
>> + for (i = 0; i < ahub->soc_data->reg_count; i++) {
>> + unsigned int reg_val;
>> +
>> + reg = e->reg + (TEGRA210_XBAR_PART1_RX * i);
>> + snd_soc_component_read(cmpnt, reg, ®_val);
>> + reg_val &= ahub->soc_data->mask[i];
>> +
>> + if (reg_val) {
>> + bit_pos = ffs(reg_val) +
>> + (8 * cmpnt->val_bytes * i);
>
> Multiplication takes precedence, braces are not needed. Same for all
> other occurrences in the code.
Personally, I prefer the above as it is explicit and helps readability.
Jon
--
nvpublic
Powered by blists - more mailing lists