From: Dmitry Osipenko <digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Sameer Pujar <spujar-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
perex-/Fr2/VpizcU@public.gmane.org,
tiwai-IBi9RG/b67k@public.gmane.org,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org,
atalambedu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org,
viswanathl-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org,
sharadg-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org,
broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
rlokhande-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org,
mkumard-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org,
dramesh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org
Subject: Re: [alsa-devel] [PATCH 4/9] ASoC: tegra: add Tegra210 based I2S driver
Date: Tue, 21 Jan 2020 19:03:15 +0300 [thread overview]
Message-ID: <444731da-c4cd-8578-a732-c803eef31ef0@gmail.com> (raw)
In-Reply-To: <0c571858-d72c-97c2-2d6a-ead6fdde06eb-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
21.01.2020 17:21, Sameer Pujar пишет:
[snip]
>>> +static int tegra210_i2s_put_control(struct snd_kcontrol *kcontrol,
>>> + struct snd_ctl_elem_value *ucontrol)
>> Checkpatch should complain about the wrong indentation here.
>
> I had run checkpatch before sending the patch, below is the result.
> -----
> WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
> #70:
> new file mode 100644
>
> total: 0 errors, 1 warnings, 1103 lines checked
>
> NOTE: For some of the reported defects, checkpatch may be able to
> mechanically convert to the typical style using --fix or
> --fix-inplace.
> -----
Using 'checkpatch --strict':
CHECK: Alignment should match open parenthesis
#2693: FILE: sound/soc/tegra/tegra210_i2s.c:362:
+static int tegra210_i2s_put_control(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol
[snip]
>>> +
>>> + } else if (strstr(kcontrol->id.name, "Playback Audio Bit Format"))
>>> + i2s->audio_fmt_override[I2S_RX_PATH] = value;
>>> + else if (strstr(kcontrol->id.name, "Capture Audio Bit Format"))
>>> + i2s->audio_fmt_override[I2S_TX_PATH] = value;
>>> + else if (strstr(kcontrol->id.name, "Client Bit Format"))
>>> + i2s->client_fmt_override = value;
>>> + else if (strstr(kcontrol->id.name, "Playback Audio Channels"))
>>> + i2s->audio_ch_override[I2S_RX_PATH] = value;
>>> + else if (strstr(kcontrol->id.name, "Capture Audio Channels"))
>>> + i2s->audio_ch_override[I2S_TX_PATH] = value;
>>> + else if (strstr(kcontrol->id.name, "Client Channels"))
>>> + i2s->client_ch_override = value;
>>> + else if (strstr(kcontrol->id.name, "Capture Stereo To Mono"))
>>> + i2s->stereo_to_mono[I2S_TX_PATH] = value;
>>> + else if (strstr(kcontrol->id.name, "Capture Mono To Stereo"))
>>> + i2s->mono_to_stereo[I2S_TX_PATH] = value;
>>> + else if (strstr(kcontrol->id.name, "Playback Stereo To Mono"))
>>> + i2s->stereo_to_mono[I2S_RX_PATH] = value;
>>> + else if (strstr(kcontrol->id.name, "Playback Mono To Stereo"))
>>> + i2s->mono_to_stereo[I2S_RX_PATH] = value;
>>> + else if (strstr(kcontrol->id.name, "Playback FIFO Threshold"))
>>> + i2s->rx_fifo_th = value;
>>> + else if (strstr(kcontrol->id.name, "BCLK Ratio"))
>>> + i2s->bclk_ratio = value;
>> I'm pretty sure that checkpatch should complain about the missing
>> brackets, they should make code's indentation uniform and thus easier to
>> read. Same for all other occurrences in the code.
>
> same as above
CHECK: braces {} should be used on all arms of this statement
#2699: FILE: sound/soc/tegra/tegra210_i2s.c:368:
+ if (strstr(kcontrol->id.name, "Loopback")) {
[...]
+ } else if (strstr(kcontrol->id.name, "Sample Rate"))
[...]
+ else if (strstr(kcontrol->id.name, "FSYNC Width")) {
[...]
+ } else if (strstr(kcontrol->id.name, "Playback Audio Bit Format"))
[...]
+ else if (strstr(kcontrol->id.name, "Capture Audio Bit Format"))
[...]
+ else if (strstr(kcontrol->id.name, "Client Bit Format"))
[...]
+ else if (strstr(kcontrol->id.name, "Playback Audio Channels"))
[...]
+ else if (strstr(kcontrol->id.name, "Capture Audio Channels"))
[...]
+ else if (strstr(kcontrol->id.name, "Client Channels"))
[...]
+ else if (strstr(kcontrol->id.name, "Capture Stereo To Mono"))
[...]
+ else if (strstr(kcontrol->id.name, "Capture Mono To Stereo"))
[...]
+ else if (strstr(kcontrol->id.name, "Playback Stereo To Mono"))
[...]
+ else if (strstr(kcontrol->id.name, "Playback Mono To Stereo"))
[...]
+ else if (strstr(kcontrol->id.name, "Playback FIFO Threshold"))
[...]
+ else if (strstr(kcontrol->id.name, "BCLK Ratio"))
[...]
[snip]
>>> + pm_runtime_enable(dev);
>> Error checking?
>
> return type for above is void()
Ok
>>> + return 0;
>>> +}
>>> +
>>> +static int tegra210_i2s_remove(struct platform_device *pdev)
>>> +{
>>> + pm_runtime_disable(&pdev->dev);
>>> + if (!pm_runtime_status_suspended(&pdev->dev))
>>> + tegra210_i2s_runtime_suspend(&pdev->dev);
>> This breaks device's RPM refcounting if it was disabled in the active
>> state. This code should be removed. At most you could warn about the
>> unxpected RPM state here, but it shouldn't be necessary.
>
> I guess this was added for safety and explicit suspend keeps clock
> disabled.
> Not sure if ref-counting of the device matters when runtime PM is
> disabled and device is removed.
> I see few drivers using this way.
It should matter (if I'm not missing something) because RPM should be in
a wrecked state once you'll try to re-load the driver's module. Likely
that those few other drivers are wrong.
[snip]
>
>>> + int rx_fifo_th;
>> Could rx_fifo_th be negative?
>
> rx_fifo_th itself does not take negative values, explicit typecasting> is avoided in "if" condition by declaring this as "int"
Explicit typecasting isn't needed for integers.
next prev parent reply other threads:[~2020-01-21 16:03 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-20 14:23 [PATCH 0/9] add ASoC components for AHUB Sameer Pujar
2020-01-20 14:23 ` [PATCH 5/9] ASoC: tegra: add Tegra210 based AHUB driver Sameer Pujar
[not found] ` <1579530198-13431-6-git-send-email-spujar-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2020-01-24 1:18 ` [alsa-devel] " Dmitry Osipenko
[not found] ` <5ed7482e-e874-9e11-c84e-7418e4b5162e-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2020-01-24 3:39 ` Sameer Pujar
[not found] ` <d160fa01-27d0-6290-cb16-07d159d6fbb2-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2020-01-24 4:28 ` Dmitry Osipenko
2020-01-27 9:45 ` Jon Hunter
2020-01-20 14:23 ` [PATCH 8/9] arm64: tegra: add AHUB components for few Tegra chips Sameer Pujar
[not found] ` <1579530198-13431-1-git-send-email-spujar-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2020-01-20 14:23 ` [PATCH 1/9] dt-bindings: sound: tegra: add DT binding for AHUB Sameer Pujar
2020-01-20 14:23 ` [PATCH 2/9] ASoC: tegra: add support for CIF programming Sameer Pujar
[not found] ` <1579530198-13431-3-git-send-email-spujar-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2020-01-20 15:58 ` [alsa-devel] " Dmitry Osipenko
[not found] ` <d01ed171-d949-19b2-3390-ee30eada2779-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2020-01-21 4:41 ` Sameer Pujar
[not found] ` <a8409b81-7c6b-37a9-81fd-772eb2eca185-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2020-01-21 16:04 ` Dmitry Osipenko
[not found] ` <229def08-6bd4-30d7-056b-92329e48c699-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2020-01-27 5:11 ` Sameer Pujar
[not found] ` <34917b2d-064f-44a9-4548-ae857e8ea29b-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2020-01-28 22:40 ` Dmitry Osipenko
2020-01-20 14:23 ` [PATCH 3/9] ASoC: tegra: add Tegra210 based DMIC driver Sameer Pujar
2020-01-20 14:23 ` [PATCH 4/9] ASoC: tegra: add Tegra210 based I2S driver Sameer Pujar
2020-01-21 5:15 ` [alsa-devel] " Dmitry Osipenko
[not found] ` <a440d105-8db9-ecf1-3718-e58804ce14b8-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2020-01-21 14:21 ` Sameer Pujar
[not found] ` <0c571858-d72c-97c2-2d6a-ead6fdde06eb-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2020-01-21 16:03 ` Dmitry Osipenko [this message]
[not found] ` <444731da-c4cd-8578-a732-c803eef31ef0-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2020-01-22 4:32 ` Sameer Pujar
[not found] ` <bdc749bc-b62c-a041-c17c-33fd49fe8e2e-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2020-01-22 6:23 ` Dmitry Osipenko
[not found] ` <598fe377-5b95-d30a-eb64-89a645166d42-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2020-01-22 7:16 ` Sameer Pujar
[not found] ` <3f51939d-cf4b-f69b-728a-7eb99bbae458-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2020-01-22 11:52 ` Jon Hunter
[not found] ` <34ac1fd3-ae0f-07f2-555f-a55087a2c9dc-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2020-01-22 16:27 ` Dmitry Osipenko
2020-01-23 9:22 ` Sameer Pujar
2020-01-23 15:16 ` Dmitry Osipenko
[not found] ` <b5c581b9-17af-d004-33fb-2cc782ab820a-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2020-01-24 9:07 ` Jon Hunter
2020-01-24 9:51 ` Jon Hunter
[not found] ` <264d3354-8a2e-ee12-44ae-aff69213d551-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2020-01-24 14:04 ` Dmitry Osipenko
[not found] ` <075e476a-36bb-5fee-15bc-76af4474a797-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2020-01-27 5:22 ` Sameer Pujar
[not found] ` <c6022a93-b79a-c691-1d75-d007d0b64ead-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2020-01-29 3:41 ` Dmitry Osipenko
[not found] ` <3b42c858-733b-0d17-f457-8043d97f5058-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2020-02-14 14:05 ` Jon Hunter
[not found] ` <62b8ffbc-aa32-ae44-6cb4-b176b8ba9b0e-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2020-02-18 1:00 ` Dmitry Osipenko
[not found] ` <847739f8-6f54-cf64-54b8-94707944850b-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2020-02-19 16:10 ` Sameer Pujar
2020-01-22 16:26 ` Dmitry Osipenko
2020-01-20 14:23 ` [PATCH 6/9] ASoC: tegra: add Tegra186 based DSPK driver Sameer Pujar
2020-01-20 14:23 ` [PATCH 7/9] ASoC: tegra: add Tegra210 based ADMAIF driver Sameer Pujar
[not found] ` <1579530198-13431-8-git-send-email-spujar-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2020-01-24 1:28 ` [alsa-devel] " Dmitry Osipenko
[not found] ` <743d6d7d-f29c-191a-853b-414250ca38df-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2020-01-24 3:27 ` Sameer Pujar
2020-01-24 4:25 ` Dmitry Osipenko
[not found] ` <8a3259b7-6875-236a-b16c-cd8e023cc8b2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2020-01-27 5:08 ` Sameer Pujar
2020-01-20 14:23 ` [PATCH 9/9] arm64: tegra: enable AHUB modules for few Tegra chips Sameer Pujar
2020-01-28 10:49 ` [PATCH 0/9] add ASoC components for AHUB Sameer Pujar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=444731da-c4cd-8578-a732-c803eef31ef0@gmail.com \
--to=digetx-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org \
--cc=atalambedu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
--cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=dramesh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
--cc=jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
--cc=lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mkumard-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
--cc=perex-/Fr2/VpizcU@public.gmane.org \
--cc=rlokhande-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=sharadg-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
--cc=spujar-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
--cc=thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=tiwai-IBi9RG/b67k@public.gmane.org \
--cc=viswanathl-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox