diff mbox

[libdrm,1/3] exynos: fix type-punned pointer build warning

Message ID 1490931057-30853-2-git-send-email-sw0312.kim@samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

Seung-Woo Kim March 31, 2017, 3:30 a.m. UTC
As like the commit ecc2a097294d ("xf86drm: Fix type-punned pointer
build warning"), this fixes following build warning.

   exynos_drm.c: In function 'exynos_handle_event':
   exynos_drm.c:420:15: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
      e = (struct drm_event *) &buffer[i];
                  ^

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
---
 exynos/exynos_drm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Tobias Jakobi March 31, 2017, 9:58 a.m. UTC | #1
Hello Seung-Woo,

Reviewed-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>

With best wishes,
Tobias


Seung-Woo Kim wrote:
> As like the commit ecc2a097294d ("xf86drm: Fix type-punned pointer
> build warning"), this fixes following build warning.
> 
>    exynos_drm.c: In function 'exynos_handle_event':
>    exynos_drm.c:420:15: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
>       e = (struct drm_event *) &buffer[i];
>                   ^
> 
> Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
> ---
>  exynos/exynos_drm.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/exynos/exynos_drm.c b/exynos/exynos_drm.c
> index b961e52..f6204f1 100644
> --- a/exynos/exynos_drm.c
> +++ b/exynos/exynos_drm.c
> @@ -417,7 +417,7 @@ exynos_handle_event(struct exynos_device *dev, struct exynos_event_context *ctx)
>  
>  	i = 0;
>  	while (i < len) {
> -		e = (struct drm_event *) &buffer[i];
> +		e = (struct drm_event *)(buffer + i);
>  		switch (e->type) {
>  		case DRM_EVENT_VBLANK:
>  			if (evctx->version < 1 ||
>
diff mbox

Patch

diff --git a/exynos/exynos_drm.c b/exynos/exynos_drm.c
index b961e52..f6204f1 100644
--- a/exynos/exynos_drm.c
+++ b/exynos/exynos_drm.c
@@ -417,7 +417,7 @@  exynos_handle_event(struct exynos_device *dev, struct exynos_event_context *ctx)
 
 	i = 0;
 	while (i < len) {
-		e = (struct drm_event *) &buffer[i];
+		e = (struct drm_event *)(buffer + i);
 		switch (e->type) {
 		case DRM_EVENT_VBLANK:
 			if (evctx->version < 1 ||