[PATCH 1/9] of: Add warpper function of_find_node_by_name_balanced()
Dan Carpenter
dan.carpenter at linaro.org
Sat Feb 8 15:18:52 AEDT 2025
On Fri, Feb 07, 2025 at 05:37:22PM +0200, Laurent Pinchart wrote:
> I'm tempted to then rename of_find_node_by_name() to
> __of_find_node_by_name() to indicate it's an internal function not meant
> to be called except in special cases. It could all be renamed to
> __of_find_next_node_by_name() to make its behaviour clearer.
>
Adding "next" to the name would help a lot.
Joe Hattori was finding some of these bugs using his static checker.
We could easily write something really specific to find this sort of
bug using Smatch. If you have ideas like this feel free to ask on
smatch at vger.kernel.org. It doesn't find anything that your grep
didn't find but any new bugs will be detected when they're introduced.
regards,
dan carpenter
-------------- next part --------------
drivers/net/ethernet/broadcom/asp2/bcmasp.c:1370 bcmasp_probe() warn: 'dev->of_node' was not incremented
drivers/net/pse-pd/tps23881.c:505 tps23881_get_of_channels() warn: 'priv->np' was not incremented
drivers/media/platform/qcom/venus/core.c:301 venus_add_video_core() warn: 'dev->of_node' was not incremented
drivers/regulator/tps6594-regulator.c:618 tps6594_regulator_probe() warn: 'tps->dev->of_node' was not incremented
-------------- next part --------------
A non-text attachment was scrubbed...
Name: check_of_find_node_by_name.c
Type: text/x-csrc
Size: 1176 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20250208/f42317ce/attachment.c>
More information about the Linuxppc-dev
mailing list