From: Stefan Agner <stefan@agner.ch>
To: boris.brezillon@free-electrons.com, airlied@linux.ie
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
Stefan Agner <stefan@agner.ch>
Subject: [PATCH] drm/atmel-hlcdc: remove unnecessary if statement
Date: Sun, 6 Aug 2017 23:26:50 -0700 [thread overview]
Message-ID: <20170807062650.9863-1-stefan@agner.ch> (raw)
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]
Signed-off-by: Stefan Agner <stefan@agner.ch>
---
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 21 +++++++++------------
1 file changed, 9 insertions(+), 12 deletions(-)
diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
index 1124200bb280..9bd8c4888035 100644
--- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
+++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
@@ -854,24 +854,21 @@ static int atmel_hlcdc_plane_init_properties(struct atmel_hlcdc_plane *plane,
struct atmel_hlcdc_plane_properties *props)
{
const struct atmel_hlcdc_layer_desc *desc = plane->layer.desc;
+ int ret;
if (desc->type == ATMEL_HLCDC_OVERLAY_LAYER ||
desc->type == ATMEL_HLCDC_CURSOR_LAYER)
drm_object_attach_property(&plane->base.base,
props->alpha, 255);
- if (desc->layout.xstride && desc->layout.pstride) {
- int ret;
-
- ret = drm_plane_create_rotation_property(&plane->base,
- DRM_MODE_ROTATE_0,
- DRM_MODE_ROTATE_0 |
- DRM_MODE_ROTATE_90 |
- DRM_MODE_ROTATE_180 |
- DRM_MODE_ROTATE_270);
- if (ret)
- return ret;
- }
+ ret = drm_plane_create_rotation_property(&plane->base,
+ DRM_MODE_ROTATE_0,
+ DRM_MODE_ROTATE_0 |
+ DRM_MODE_ROTATE_90 |
+ DRM_MODE_ROTATE_180 |
+ DRM_MODE_ROTATE_270);
+ if (ret)
+ return ret;
if (desc->layout.csc) {
/*
--
2.13.3
next reply other threads:[~2017-08-07 6:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-07 6:26 Stefan Agner [this message]
2018-06-16 23:34 ` Stefan Agner
2018-06-17 7:50 ` Boris Brezillon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170807062650.9863-1-stefan@agner.ch \
--to=stefan@agner.ch \
--cc=airlied@linux.ie \
--cc=boris.brezillon@free-electrons.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®