aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorGuenter Roeck <[email protected]>2021-05-09 21:08:17 -0700
committerMartin K. Petersen <[email protected]>2021-05-14 22:40:45 -0400
commit998da772fd86bd4ba2ba8c0ac2c9bba4815a952d (patch)
tree2411f4458f79069b53090f65e30a95f087e92806 /tools/perf/scripts/python
parent8fb82abccc8a4fc25c75bf209da9b2023d064e05 (diff)
scsi: target: iscsi: Drop unnecessary container_of()
The structure pointer passed to container_of() is never NULL; that was already checked. That means that the result of container_of() operations on it is also never NULL, even though se_node_acl is the first element of the structure embedding it. On top of that, it is misleading to perform a NULL check on the result of container_of() because the position of the contained element could change, which would make the test invalid. Remove the unnecessary NULL check. As it turns out, the container_of operation was only made for the purpose of the NULL check. If the container_of is actually needed, it is repeated later. Remove the container_of operation as well. The NULL check was identified and removed with the following Coccinelle script. @@ type t; identifier v; statement s; @@ <+... ( t v = container_of(...); | v = container_of(...); ) ... when != v - if (\( !v \| v == NULL \) ) s ...+> Link: https://lore.kernel.org/r/[email protected] Cc: "Martin K. Petersen" <[email protected]> Cc: Hou Pu <[email protected]> Cc: Mike Christie <[email protected]> Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions