From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Alex Deucher <alexander.deucher@amd.com>,
Daniel Vetter <daniel.vetter@intel.com>,
dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm: Silence the compiler for drm_mode_get_hv_timings()
Date: Thu, 26 Jan 2017 14:46:55 +0200 [thread overview]
Message-ID: <20170126124655.GB31595@intel.com> (raw)
In-Reply-To: <20170126114409.9115-1-chris@chris-wilson.co.uk>
On Thu, Jan 26, 2017 at 11:44:09AM +0000, Chris Wilson wrote:
> Since moving drm_crtc_get_hv_timings() into drm_modes.c, the compiler
> has been able to get smarter and spots that drm_mode_copy() is trying to
> preserve garbage from the stack.
>
> Fixes: 196cd5d3758c ("drm: s/drm_crtc_get_hv_timings/drm_mode_get_hv_timings/")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Daniel Vetter <daniel.vetter@intel.com>
> Cc: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> drivers/gpu/drm/drm_modes.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
> index 73ed6399c3fb..a8616b1a8d22 100644
> --- a/drivers/gpu/drm/drm_modes.c
> +++ b/drivers/gpu/drm/drm_modes.c
> @@ -808,9 +808,8 @@ EXPORT_SYMBOL(drm_mode_vrefresh);
> void drm_mode_get_hv_timing(const struct drm_display_mode *mode,
> int *hdisplay, int *vdisplay)
> {
> - struct drm_display_mode adjusted;
> + struct drm_display_mode adjusted = *mode;
>
> - drm_mode_copy(&adjusted, mode);
> drm_mode_set_crtcinfo(&adjusted, CRTC_STEREO_DOUBLE_ONLY);
> *hdisplay = adjusted.crtc_hdisplay;
> *vdisplay = adjusted.crtc_vdisplay;
> --
> 2.11.0
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2017-01-26 12:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-26 11:44 [PATCH] drm: Silence the compiler for drm_mode_get_hv_timings() Chris Wilson
2017-01-26 12:46 ` Ville Syrjälä [this message]
2017-01-26 15:54 ` Daniel Vetter
2017-01-26 19:13 ` Ville Syrjälä
2017-01-26 14:28 ` Deucher, Alexander
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=20170126124655.GB31595@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=alexander.deucher@amd.com \
--cc=chris@chris-wilson.co.uk \
--cc=daniel.vetter@intel.com \
--cc=dri-devel@lists.freedesktop.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