]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: qedf: Drop unnecessary NULL checks after container_of()
authorGuenter Roeck <linux@roeck-us.net>
Mon, 10 May 2021 04:12:11 +0000 (21:12 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sat, 15 May 2021 02:40:54 +0000 (22:40 -0400)
commit2204cfd63e69fc5bcfbb018e19c4ce5fd9b21dd9
tree1c068c9931125a460bef311d190b101fc8a2cc5b
parent961533bef07fddf17fec4f9eb755fcbbb364e3d2
scsi: qedf: Drop unnecessary NULL checks after container_of()

The result of container_of() operations is never NULL unless the embedded
element is the first element of the structure, which is not the case here.
The NULL checks are therefore unnecessary and misleading. Remove them.

The changes in this patch were made automatically using 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/20210510041211.2051325-1-linux@roeck-us.net
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qedf/qedf_io.c
drivers/scsi/qedf/qedf_main.c