From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: wangweidong.a@awinic.com
Cc: alsa-devel@alsa-project.org, broonie@kernel.org,
lgirdwood@gmail.com, linux-kernel@vger.kernel.org,
perex@perex.cz, tiwai@suse.com, yijiangtao@awinic.com
Subject: Re: [PATCH 3/3] ASoC: aw88395: drop undocumented and unused sound-channel property
Date: Tue, 5 Sep 2023 09:28:08 +0200 [thread overview]
Message-ID: <537821c6-df3f-6946-b7dc-07ba9db9d416@linaro.org> (raw)
In-Reply-To: <20230905071356.18301-1-wangweidong.a@awinic.com>
On 05/09/2023 09:13, wangweidong.a@awinic.com wrote:
> Thank you very much for your reply.
>
> On 05/09/2023 15:05, krzysztof.kozlowski@linaro.org wrote:
>> On 05/09/2023 04:46, wangweidong.a@awinic.com wrote:
>
>>>> Even though it does not look like from the diff, the property is not
>>>> actually used by the driver, because once set, it is read only in loops
>>>> depending on ddt_num (prof_hdr->ddt_num, cfg_hdr->ddt_num). The
>>>> variable ddt_num is never set and is always 0, so the loops do not have
>>>> any iteration. Dropping sound-channel and ddt_num-related loops allows
>>>> to drop empty functions which in turn drop quite a lot of code. This
>>>> entire code was not possible to execute.
>>>
>>> The ddt_num variable is not always 0, this variable is defined
>>> in the configuration file. The "prof_hdr" variable is assigned by
>>> the "cfg_hdr" variable. The "cfg_hdr" variable is assigned by "aw_cfg"
>>> aw_cfg is the data obtained through request_firmware.The specific
>>> process is as follows:
>>>
>>> request_firmware ---> cont->data ---> aw_cfg->data --> cfg_hdr --> prof_hdr
>
>> Hm. So you load user-space provided file and assign it directly, without
>> any validation (aw88395_dev_load_acf_check() checks only for magic), to
>> a kernel structure. Sounds bullet-proof. Why using known kernel
>> interfaces, better to implement some conf-file-parsing.
>
> Could you please tell me what known kernel interfaces
> can be used to parse files?
With exception of Audio topology and FDT, I do not think we parse
user-provided files in Linux kernel.
Best regards,
Krzysztof
next prev parent reply other threads:[~2023-09-05 16:41 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-04 12:53 [PATCH 1/3] ASoC: aw88261: drop undocumented, fake sync-flag property Krzysztof Kozlowski
2023-09-04 12:53 ` [PATCH 2/3] ASoC: aw88395: drop undocumented, fake fade-enable property Krzysztof Kozlowski
2023-09-04 18:02 ` Mark Brown
2023-09-04 12:53 ` [PATCH 3/3] ASoC: aw88395: drop undocumented and unused sound-channel property Krzysztof Kozlowski
2023-09-05 2:46 ` wangweidong.a
2023-09-05 6:32 ` Krzysztof Kozlowski
2023-09-05 7:13 ` wangweidong.a
2023-09-05 7:28 ` Krzysztof Kozlowski [this message]
2023-09-05 12:10 ` Mark Brown
2023-09-04 17:14 ` [PATCH 1/3] ASoC: aw88261: drop undocumented, fake sync-flag property Mark Brown
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=537821c6-df3f-6946-b7dc-07ba9db9d416@linaro.org \
--to=krzysztof.kozlowski@linaro.org \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.com \
--cc=wangweidong.a@awinic.com \
--cc=yijiangtao@awinic.com \
/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
all inboxes | Powered by JetHome®