lkml.org 
[lkml]   [2023]   [Jun]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v4 1/3] ASoC: Add support for Loongson I2S controller
From

On 2023/6/19 15:00, Krzysztof Kozlowski wrote:
> 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.

Thanks, got it.

Thanks,
Yingkun

>
> Best regards,
> Krzysztof

\
 
 \ /
  Last update: 2023-06-19 09:51    [W:0.061 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site