diff mbox

[3/6] tests/modetest: silence compiler warning about uninitialised variables

Message ID 1377808314-30699-4-git-send-email-emil.l.velikov@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Emil Velikov Aug. 29, 2013, 8:31 p.m. UTC
The compiler is unaware of that we have at least one crts/connector/plane
thus it complains that some of our variables will be used uninitialised.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
---

This patch looks like a rather silly thing to do, although it seems like
the only was to silence the gcc compiler
---
 tests/modetest/modetest.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Rob Clark Aug. 30, 2013, 3:21 p.m. UTC | #1
On Thu, Aug 29, 2013 at 4:31 PM, Emil Velikov <emil.l.velikov@gmail.com> wrote:
> The compiler is unaware of that we have at least one crts/connector/plane
> thus it complains that some of our variables will be used uninitialised.
>
> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>

Reviewed-by: Rob Clark <robdclark@gmail.com>

> ---
>
> This patch looks like a rather silly thing to do, although it seems like
> the only was to silence the gcc compiler
> ---
>  tests/modetest/modetest.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c
> index f96b930..ed604b4 100644
> --- a/tests/modetest/modetest.c
> +++ b/tests/modetest/modetest.c
> @@ -781,7 +781,7 @@ static struct crtc *pipe_find_crtc(struct device *dev, struct pipe_arg *pipe)
>
>  static int pipe_find_crtc_and_mode(struct device *dev, struct pipe_arg *pipe)
>  {
> -       drmModeModeInfo *mode;
> +       drmModeModeInfo *mode = NULL;
>         int i;
>
>         pipe->mode = NULL;
> @@ -838,8 +838,8 @@ struct property_arg {
>
>  static void set_property(struct device *dev, struct property_arg *p)
>  {
> -       drmModeObjectProperties *props;
> -       drmModePropertyRes **props_info;
> +       drmModeObjectProperties *props = NULL;
> +       drmModePropertyRes **props_info = NULL;
>         const char *obj_type;
>         int ret;
>         int i;
> --
> 1.8.4
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
diff mbox

Patch

diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c
index f96b930..ed604b4 100644
--- a/tests/modetest/modetest.c
+++ b/tests/modetest/modetest.c
@@ -781,7 +781,7 @@  static struct crtc *pipe_find_crtc(struct device *dev, struct pipe_arg *pipe)
 
 static int pipe_find_crtc_and_mode(struct device *dev, struct pipe_arg *pipe)
 {
-	drmModeModeInfo *mode;
+	drmModeModeInfo *mode = NULL;
 	int i;
 
 	pipe->mode = NULL;
@@ -838,8 +838,8 @@  struct property_arg {
 
 static void set_property(struct device *dev, struct property_arg *p)
 {
-	drmModeObjectProperties *props;
-	drmModePropertyRes **props_info;
+	drmModeObjectProperties *props = NULL;
+	drmModePropertyRes **props_info = NULL;
 	const char *obj_type;
 	int ret;
 	int i;