Skip to content

Commit

Permalink
drm/exynos: fix types for compilation on 64bit architectures
Browse files Browse the repository at this point in the history
This patch fixes compilation warnings (on 64bit architectures) and bugs
related to casting pointers through 32bit integers.

Signed-off-by: Marek Szyprowski <[email protected]>
Signed-off-by: Inki Dae <[email protected]>
  • Loading branch information
mszyprow authored and daeinki committed Mar 1, 2016
1 parent 3b35678 commit c5f2f0c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
5 changes: 3 additions & 2 deletions drivers/gpu/drm/exynos/exynos_drm_g2d.c
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,7 @@ int exynos_g2d_set_cmdlist_ioctl(struct drm_device *drm_dev, void *data,
goto err_free_event;
}

cmd = (struct drm_exynos_g2d_cmd *)(uint32_t)req->cmd;
cmd = (struct drm_exynos_g2d_cmd *)(unsigned long)req->cmd;

if (copy_from_user(cmdlist->data + cmdlist->last,
(void __user *)cmd,
Expand All @@ -1169,7 +1169,8 @@ int exynos_g2d_set_cmdlist_ioctl(struct drm_device *drm_dev, void *data,
if (req->cmd_buf_nr) {
struct drm_exynos_g2d_cmd *cmd_buf;

cmd_buf = (struct drm_exynos_g2d_cmd *)(uint32_t)req->cmd_buf;
cmd_buf = (struct drm_exynos_g2d_cmd *)
(unsigned long)req->cmd_buf;

if (copy_from_user(cmdlist->data + cmdlist->last,
(void __user *)cmd_buf,
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/exynos/exynos_drm_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ static struct exynos_drm_gem *exynos_drm_gem_init(struct drm_device *dev,
return ERR_PTR(ret);
}

DRM_DEBUG_KMS("created file object = 0x%x\n", (unsigned int)obj->filp);
DRM_DEBUG_KMS("created file object = %p\n", obj->filp);

return exynos_gem;
}
Expand Down
8 changes: 5 additions & 3 deletions drivers/gpu/drm/exynos/exynos_drm_vidi.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ static void vidi_fake_vblank_handler(struct work_struct *work)
}
}

static int vidi_show_connection(struct device *dev,
static ssize_t vidi_show_connection(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct vidi_context *ctx = dev_get_drvdata(dev);
Expand All @@ -238,7 +238,7 @@ static int vidi_show_connection(struct device *dev,
return rc;
}

static int vidi_store_connection(struct device *dev,
static ssize_t vidi_store_connection(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t len)
{
Expand Down Expand Up @@ -294,7 +294,9 @@ int vidi_connection_ioctl(struct drm_device *drm_dev, void *data,
}

if (vidi->connection) {
struct edid *raw_edid = (struct edid *)(uint32_t)vidi->edid;
struct edid *raw_edid;

raw_edid = (struct edid *)(unsigned long)vidi->edid;
if (!drm_edid_is_valid(raw_edid)) {
DRM_DEBUG_KMS("edid data is invalid.\n");
return -EINVAL;
Expand Down

0 comments on commit c5f2f0c

Please sign in to comment.