lkml.org 
[lkml]   [2020]   [Jan]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [alsa-devel] [PATCH 5/9] ASoC: tegra: add Tegra210 based AHUB driver
From
Date

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, &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

\
 
 \ /
  Last update: 2020-01-27 10:46    [W:0.092 / U:0.844 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site