Re: [PATCH] usb: dwc3: qcom: simplify error check in dwc3_qcom_find_num_ports()

From: Zeeshan Ahmad

Date: Sat Feb 21 2026 - 05:41:54 EST


Hi Dan,

You are correct. I ran Smatch on dwc3-qcom-legacy.c and it did not produce
a warning for these lines. I identified this issue through a manual grep
search for the pattern 'platform_get_irq.* <= 0' across the drivers
directory.

It appears there are several dozen instances of this pattern that Smatch
currently misses because the '<= 0' check includes a valid negative
error check alongside the redundant zero check.

Thank you for the technical background on why Smatch handles it this way.

Regards,
Zeeshan