All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Dave Airlie <airlied@redhat.com>,
	Julia Lemire <jlemire@matrox.com>,
	David Airlie <airlied@linux.ie>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	Sinclair Yeh <syeh@vmware.com>,
	Patrik Jakobsson <patrik.r.jakobsson@gmail.com>,
	Peter Rosin <peda@axentia.se>, Keith Packard <keithp@keithp.com>,
	Mathieu Larouche <mathieu.larouche@matrox.com>,
	dri-devel@lists.freedesktop.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] drm/mgag200: fix a test in mga_vga_mode_valid()
Date: Tue, 30 Jan 2018 09:57:52 +0000	[thread overview]
Message-ID: <20180130095752.GJ25930@phenom.ffwll.local> (raw)
In-Reply-To: <20180125142655.GA23885@mwanda>

On Thu, Jan 25, 2018 at 05:26:55PM +0300, Dan Carpenter wrote:
> The parentheses are in the wrong place here so we pass the bits per
> pixel as zero.
> 
> Fixes: abbee6238775 ("drm/mgag200: Added resolution and bandwidth limits for various G200e products.")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> Static analysis.  Not tested.

Looks reasonable. Thanks for the patch, applied.
-Daniel

> 
> diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c
> index 68e5d9c94475..fb50a9ddaae8 100644
> --- a/drivers/gpu/drm/mgag200/mgag200_mode.c
> +++ b/drivers/gpu/drm/mgag200/mgag200_mode.c
> @@ -1620,8 +1620,8 @@ static int mga_vga_mode_valid(struct drm_connector *connector,
>  			return MODE_VIRTUAL_X;
>  		if (mode->vdisplay > 1024)
>  			return MODE_VIRTUAL_Y;
> -		if (mga_vga_calculate_mode_bandwidth(mode,
> -			bpp > (31877 * 1024)))
> +		if (mga_vga_calculate_mode_bandwidth(mode, bpp) >
> +		    (31877 * 1024))
>  			return MODE_BANDWIDTH;
>  	} else if (mdev->type = G200_EV &&
>  		(mga_vga_calculate_mode_bandwidth(mode, bpp)

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

WARNING: multiple messages have this Message-ID (diff)
From: Daniel Vetter <daniel@ffwll.ch>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Dave Airlie <airlied@redhat.com>,
	Julia Lemire <jlemire@matrox.com>,
	David Airlie <airlied@linux.ie>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	Sinclair Yeh <syeh@vmware.com>,
	Patrik Jakobsson <patrik.r.jakobsson@gmail.com>,
	Peter Rosin <peda@axentia.se>, Keith Packard <keithp@keithp.com>,
	Mathieu Larouche <mathieu.larouche@matrox.com>,
	dri-devel@lists.freedesktop.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] drm/mgag200: fix a test in mga_vga_mode_valid()
Date: Tue, 30 Jan 2018 10:57:52 +0100	[thread overview]
Message-ID: <20180130095752.GJ25930@phenom.ffwll.local> (raw)
In-Reply-To: <20180125142655.GA23885@mwanda>

On Thu, Jan 25, 2018 at 05:26:55PM +0300, Dan Carpenter wrote:
> The parentheses are in the wrong place here so we pass the bits per
> pixel as zero.
> 
> Fixes: abbee6238775 ("drm/mgag200: Added resolution and bandwidth limits for various G200e products.")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> Static analysis.  Not tested.

Looks reasonable. Thanks for the patch, applied.
-Daniel

> 
> diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c
> index 68e5d9c94475..fb50a9ddaae8 100644
> --- a/drivers/gpu/drm/mgag200/mgag200_mode.c
> +++ b/drivers/gpu/drm/mgag200/mgag200_mode.c
> @@ -1620,8 +1620,8 @@ static int mga_vga_mode_valid(struct drm_connector *connector,
>  			return MODE_VIRTUAL_X;
>  		if (mode->vdisplay > 1024)
>  			return MODE_VIRTUAL_Y;
> -		if (mga_vga_calculate_mode_bandwidth(mode,
> -			bpp > (31877 * 1024)))
> +		if (mga_vga_calculate_mode_bandwidth(mode, bpp) >
> +		    (31877 * 1024))
>  			return MODE_BANDWIDTH;
>  	} else if (mdev->type == G200_EV &&
>  		(mga_vga_calculate_mode_bandwidth(mode, bpp)

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

  reply	other threads:[~2018-01-30  9:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-25 14:26 [PATCH] drm/mgag200: fix a test in mga_vga_mode_valid() Dan Carpenter
2018-01-25 14:26 ` Dan Carpenter
2018-01-30  9:57 ` Daniel Vetter [this message]
2018-01-30  9:57   ` Daniel Vetter

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=20180130095752.GJ25930@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=airlied@linux.ie \
    --cc=airlied@redhat.com \
    --cc=dan.carpenter@oracle.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jlemire@matrox.com \
    --cc=keithp@keithp.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=mathieu.larouche@matrox.com \
    --cc=patrik.r.jakobsson@gmail.com \
    --cc=peda@axentia.se \
    --cc=syeh@vmware.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.