提交 7e7392a6 编写于 作者: V Ville Syrjälä 提交者: Daniel Vetter

drm: Drop ioctl->cmd_drv

ioctl->cmd_drv is pointless and we can just as well stick the full ioctl
definition into ioctl->cmd.

Cc: Jakob Bornecrantz <jakob@vmware.com>
Cc: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
上级 9c7d3d3e
...@@ -525,7 +525,7 @@ static int drm_ioctl_permit(u32 flags, struct drm_file *file_priv) ...@@ -525,7 +525,7 @@ static int drm_ioctl_permit(u32 flags, struct drm_file *file_priv)
} }
#define DRM_IOCTL_DEF(ioctl, _func, _flags) \ #define DRM_IOCTL_DEF(ioctl, _func, _flags) \
[DRM_IOCTL_NR(ioctl)] = {.cmd = ioctl, .func = _func, .flags = _flags, .cmd_drv = 0, .name = #ioctl} [DRM_IOCTL_NR(ioctl)] = {.cmd = ioctl, .func = _func, .flags = _flags, .name = #ioctl}
/** Ioctl table */ /** Ioctl table */
static const struct drm_ioctl_desc drm_ioctls[] = { static const struct drm_ioctl_desc drm_ioctls[] = {
...@@ -677,11 +677,11 @@ long drm_ioctl(struct file *filp, ...@@ -677,11 +677,11 @@ long drm_ioctl(struct file *filp,
(nr < DRM_COMMAND_BASE + dev->driver->num_ioctls)) { (nr < DRM_COMMAND_BASE + dev->driver->num_ioctls)) {
u32 drv_size; u32 drv_size;
ioctl = &dev->driver->ioctls[nr - DRM_COMMAND_BASE]; ioctl = &dev->driver->ioctls[nr - DRM_COMMAND_BASE];
drv_size = _IOC_SIZE(ioctl->cmd_drv); drv_size = _IOC_SIZE(ioctl->cmd);
usize = asize = _IOC_SIZE(cmd); usize = asize = _IOC_SIZE(cmd);
if (drv_size > asize) if (drv_size > asize)
asize = drv_size; asize = drv_size;
cmd = ioctl->cmd_drv; cmd = ioctl->cmd;
} }
else if ((nr >= DRM_COMMAND_END) || (nr < DRM_COMMAND_BASE)) { else if ((nr >= DRM_COMMAND_END) || (nr < DRM_COMMAND_BASE)) {
u32 drv_size; u32 drv_size;
......
...@@ -134,7 +134,7 @@ ...@@ -134,7 +134,7 @@
*/ */
#define VMW_IOCTL_DEF(ioctl, func, flags) \ #define VMW_IOCTL_DEF(ioctl, func, flags) \
[DRM_IOCTL_NR(DRM_IOCTL_##ioctl) - DRM_COMMAND_BASE] = {DRM_##ioctl, flags, func, DRM_IOCTL_##ioctl} [DRM_IOCTL_NR(DRM_IOCTL_##ioctl) - DRM_COMMAND_BASE] = {DRM_IOCTL_##ioctl, flags, func}
/** /**
* Ioctl definitions. * Ioctl definitions.
...@@ -1041,7 +1041,7 @@ static long vmw_generic_ioctl(struct file *filp, unsigned int cmd, ...@@ -1041,7 +1041,7 @@ static long vmw_generic_ioctl(struct file *filp, unsigned int cmd,
const struct drm_ioctl_desc *ioctl = const struct drm_ioctl_desc *ioctl =
&vmw_ioctls[nr - DRM_COMMAND_BASE]; &vmw_ioctls[nr - DRM_COMMAND_BASE];
if (unlikely(ioctl->cmd_drv != cmd)) { if (unlikely(ioctl->cmd != cmd)) {
DRM_ERROR("Invalid command format, ioctl %d\n", DRM_ERROR("Invalid command format, ioctl %d\n",
nr - DRM_COMMAND_BASE); nr - DRM_COMMAND_BASE);
return -EINVAL; return -EINVAL;
......
...@@ -253,7 +253,6 @@ struct drm_ioctl_desc { ...@@ -253,7 +253,6 @@ struct drm_ioctl_desc {
unsigned int cmd; unsigned int cmd;
int flags; int flags;
drm_ioctl_t *func; drm_ioctl_t *func;
unsigned int cmd_drv;
const char *name; const char *name;
}; };
...@@ -263,7 +262,7 @@ struct drm_ioctl_desc { ...@@ -263,7 +262,7 @@ struct drm_ioctl_desc {
*/ */
#define DRM_IOCTL_DEF_DRV(ioctl, _func, _flags) \ #define DRM_IOCTL_DEF_DRV(ioctl, _func, _flags) \
[DRM_IOCTL_NR(DRM_IOCTL_##ioctl) - DRM_COMMAND_BASE] = {.cmd = DRM_##ioctl, .func = _func, .flags = _flags, .cmd_drv = DRM_IOCTL_##ioctl, .name = #ioctl} [DRM_IOCTL_NR(DRM_IOCTL_##ioctl) - DRM_COMMAND_BASE] = {.cmd = DRM_IOCTL_##ioctl, .func = _func, .flags = _flags, .name = #ioctl}
/* Event queued up for userspace to read */ /* Event queued up for userspace to read */
struct drm_pending_event { struct drm_pending_event {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册