From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Yingkun Meng <mengyingkun@loongson.cn>,
Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>,
broonie@kernel.org, lgirdwood@gmail.com
Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org,
loongarch@lists.linux.dev, loongson-kernel@lists.loongnix.cn,
Dan Carpenter <dan.carpenter@linaro.org>,
Dan Carpenter <error27@gmail.com>,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH v4 1/3] ASoC: Add support for Loongson I2S controller
Date: Mon, 19 Jun 2023 09:00:34 +0200 [thread overview]
Message-ID: <bd4da934-72b7-67f3-0c9c-c18d3af16e7d@linaro.org> (raw)
In-Reply-To: <325dd825-6fa5-0ebc-4b7e-7acf2d2840e4@loongson.cn>
On 19/06/2023 03:45, Yingkun Meng wrote:
>>>> + tx_data->irq = fwnode_irq_get_byname(fwnode, "tx");
>>>
>>> Smatch detects that tx_data->irq and rx_data->irq are of type
>>> u32(unsigned) so they can never be negative.
>>>
>>>> + if (tx_data->irq < 0) {
>>> ^^^^^^^^ This can never be true.
>>>
>>> Should irq be of type 'int' instead?
>>>
>>>> + dev_err(&pdev->dev, "dma tx irq invalid\n");
>>>> + return tx_data->irq;
>>>> + }
>>>> +
>>>> + rx_data->irq = fwnode_irq_get_byname(fwnode, "rx");
>>>> + if (rx_data->irq < 0) {
>>> ^^^ Same problem here.
>>>
>>> Should irq
>>
>> Should 'irq' be of type int instead?
>>
>> As fwnode_irq_get_byname() returns a integer.
>>
> Yes, you are right. I will add a patch to fix the type of 'irq' to int.
Run smatch and sparse on your code before posting. It would find such
trivial mistakes.
Best regards,
Krzysztof
next prev parent reply other threads:[~2023-06-19 7:00 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-15 12:27 YingKun Meng
2023-06-15 13:58 ` Mark Brown
2023-06-16 1:12 ` Yingkun Meng
2023-06-18 20:11 ` Harshit Mogalapalli
2023-06-18 20:14 ` Harshit Mogalapalli
2023-06-19 1:45 ` Yingkun Meng
2023-06-19 7:00 ` Krzysztof Kozlowski [this message]
2023-06-19 7:49 ` Yingkun Meng
2023-06-19 11:20 ` Mark Brown
2023-06-19 11:27 ` Harshit Mogalapalli
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=bd4da934-72b7-67f3-0c9c-c18d3af16e7d@linaro.org \
--to=krzysztof.kozlowski@linaro.org \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=dan.carpenter@linaro.org \
--cc=error27@gmail.com \
--cc=harshit.m.mogalapalli@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=loongarch@lists.linux.dev \
--cc=loongson-kernel@lists.loongnix.cn \
--cc=mengyingkun@loongson.cn \
/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®