On 19/06/2023 03:45, Yingkun Meng wrote:
Run smatch and sparse on your code before posting. It would find suchYes, you are right. I will add a patch to fix the type of 'irq' to int.Should 'irq' be of type int instead?+ 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");^^^ Same problem here.
+ return tx_data->irq;
+ }
+
+ rx_data->irq = fwnode_irq_get_byname(fwnode, "rx");
+ if (rx_data->irq < 0) {
Should irq
As fwnode_irq_get_byname() returns a integer.
trivial mistakes.
Best regards,
Krzysztof