Skip to content

Commit

Permalink
drm: reorder struct drm_ioctl_desc to save space on 64 bit builds
Browse files Browse the repository at this point in the history
shrinks drm_ioctl_desc from 24 bytes to 16 bytes by reordering members
to remove padding.

updates DRM_IOCTL_DEF macro to initialise structure members by name to
handle the structure reorder.

The applied patch reduces data used in drm.ko from 10440 to 9032

Signed-off-by: Richard Kennedy <richard@rsk.demon.co.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
Richard Kennedy authored and Dave Airlie committed Mar 29, 2009
1 parent 40fc6ea commit c972d75
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/drm/drmP.h
Original file line number Diff line number Diff line change
Expand Up @@ -281,16 +281,16 @@ typedef int drm_ioctl_compat_t(struct file *filp, unsigned int cmd,

struct drm_ioctl_desc {
unsigned int cmd;
drm_ioctl_t *func;
int flags;
drm_ioctl_t *func;
};

/**
* Creates a driver or general drm_ioctl_desc array entry for the given
* ioctl, for use by drm_ioctl().
*/
#define DRM_IOCTL_DEF(ioctl, func, flags) \
[DRM_IOCTL_NR(ioctl)] = {ioctl, func, flags}
#define DRM_IOCTL_DEF(ioctl, _func, _flags) \
[DRM_IOCTL_NR(ioctl)] = {.cmd = ioctl, .func = _func, .flags = _flags}

struct drm_magic_entry {
struct list_head head;
Expand Down

0 comments on commit c972d75

Please sign in to comment.