1 // SPDX-License-Identifier: GPL-2.0-only
3 /// Use kobj_to_dev() instead of container_of()
6 // Copyright: (C) 2020 Denis Efremov ISPRAS
7 // Options: --no-includes --include-headers
9 // Keywords: kobj_to_dev, container_of
24 * container_of(ptr, struct device, kobj)@p
31 - container_of(ptr, struct device, kobj)
35 @script:python depends on report@
39 coccilib.report.print_report(p[0], "WARNING opportunity for kobj_to_dev()")
41 @script:python depends on org@
45 coccilib.org.print_todo(p[0], "WARNING opportunity for kobj_to_dev()")