Commit 9fcf2b3c authored by Stefan Agner's avatar Stefan Agner Committed by Boris Brezillon

drm/atmel-hlcdc: check stride values in the first plane

The statement always evaluates to true since the struct fields
are arrays. This has shown up as a warning when compiling with
clang:
  warning: address of array 'desc->layout.xstride' will always
      evaluate to 'true' [-Wpointer-bool-conversion]

Check for values in the first plane instead.

Fixes: 1a396789 ("drm: add Atmel HLCDC Display Controller support")
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarStefan Agner <stefan@agner.ch>
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180617084826.31885-1-stefan@agner.ch
parent c7d6d511
...@@ -875,7 +875,7 @@ static int atmel_hlcdc_plane_init_properties(struct atmel_hlcdc_plane *plane, ...@@ -875,7 +875,7 @@ static int atmel_hlcdc_plane_init_properties(struct atmel_hlcdc_plane *plane,
drm_object_attach_property(&plane->base.base, drm_object_attach_property(&plane->base.base,
props->alpha, 255); props->alpha, 255);
if (desc->layout.xstride && desc->layout.pstride) { if (desc->layout.xstride[0] && desc->layout.pstride[0]) {
int ret; int ret;
ret = drm_plane_create_rotation_property(&plane->base, ret = drm_plane_create_rotation_property(&plane->base,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment