drm/msm/dpu: Drop unnecessary NULL checks after container_of in dpu_encoder
authorGuenter Roeck <linux@roeck-us.net>
Tue, 25 May 2021 11:29:04 +0000 (04:29 -0700)
committerRob Clark <robdclark@chromium.org>
Wed, 23 Jun 2021 14:33:53 +0000 (07:33 -0700)
commit9389a0e7b17c7d781ef77003138f0c82f5a0aa4c
tree4edf750316d3b3176f68fd4c4db0202548622e31
parent5ed7944dfa508cce927870fecf370bad778b7910
drm/msm/dpu: Drop unnecessary NULL checks after container_of in dpu_encoder

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

This change was made automatically 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
...+>

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20210525112904.1747066-1-linux@roeck-us.net
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
[DB: fixed patch subject]
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Rob Clark <robdclark@chromium.org>
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c