drm: Prefer sizeof(type) over sizeof type
authorThierry Reding <treding@nvidia.com>
Wed, 10 Dec 2014 12:03:40 +0000 (13:03 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 10 Dec 2014 13:15:13 +0000 (14:15 +0100)
sizeof(type) is the variant used most commonly and required by
checkpatch.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/drm_crtc.c
drivers/gpu/drm/drm_irq.c

index 4f4fcd37f1107aea94aac03d7799b9fd176c7bc4..6700ebafef1677ab15d3db66d6c42b5b8ee25e71 100644 (file)
@@ -4684,23 +4684,23 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev,
        if (page_flip->flags & DRM_MODE_PAGE_FLIP_EVENT) {
                ret = -ENOMEM;
                spin_lock_irqsave(&dev->event_lock, flags);
-               if (file_priv->event_space < sizeof e->event) {
+               if (file_priv->event_space < sizeof(e->event)) {
                        spin_unlock_irqrestore(&dev->event_lock, flags);
                        goto out;
                }
-               file_priv->event_space -= sizeof e->event;
+               file_priv->event_space -= sizeof(e->event);
                spin_unlock_irqrestore(&dev->event_lock, flags);
 
-               e = kzalloc(sizeof *e, GFP_KERNEL);
+               e = kzalloc(sizeof(*e), GFP_KERNEL);
                if (e == NULL) {
                        spin_lock_irqsave(&dev->event_lock, flags);
-                       file_priv->event_space += sizeof e->event;
+                       file_priv->event_space += sizeof(e->event);
                        spin_unlock_irqrestore(&dev->event_lock, flags);
                        goto out;
                }
 
                e->event.base.type = DRM_EVENT_FLIP_COMPLETE;
-               e->event.base.length = sizeof e->event;
+               e->event.base.length = sizeof(e->event);
                e->event.user_data = page_flip->user_data;
                e->base.event = &e->event.base;
                e->base.file_priv = file_priv;
@@ -4713,7 +4713,7 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev,
        if (ret) {
                if (page_flip->flags & DRM_MODE_PAGE_FLIP_EVENT) {
                        spin_lock_irqsave(&dev->event_lock, flags);
-                       file_priv->event_space += sizeof e->event;
+                       file_priv->event_space += sizeof(e->event);
                        spin_unlock_irqrestore(&dev->event_lock, flags);
                        kfree(e);
                }
index fadcd16d2300d10e8f304f1d417d09c5620eebee..920cdb91e9d0eb204e87546cf15253344d0fc7f3 100644 (file)
@@ -1383,7 +1383,7 @@ static int drm_queue_vblank_event(struct drm_device *dev, int pipe,
        unsigned int seq;
        int ret;
 
-       e = kzalloc(sizeof *e, GFP_KERNEL);
+       e = kzalloc(sizeof(*e), GFP_KERNEL);
        if (e == NULL) {
                ret = -ENOMEM;
                goto err_put;
@@ -1392,7 +1392,7 @@ static int drm_queue_vblank_event(struct drm_device *dev, int pipe,
        e->pipe = pipe;
        e->base.pid = current->pid;
        e->event.base.type = DRM_EVENT_VBLANK;
-       e->event.base.length = sizeof e->event;
+       e->event.base.length = sizeof(e->event);
        e->event.user_data = vblwait->request.signal;
        e->base.event = &e->event.base;
        e->base.file_priv = file_priv;
@@ -1412,12 +1412,12 @@ static int drm_queue_vblank_event(struct drm_device *dev, int pipe,
                goto err_unlock;
        }
 
-       if (file_priv->event_space < sizeof e->event) {
+       if (file_priv->event_space < sizeof(e->event)) {
                ret = -EBUSY;
                goto err_unlock;
        }
 
-       file_priv->event_space -= sizeof e->event;
+       file_priv->event_space -= sizeof(e->event);
        seq = drm_vblank_count_and_time(dev, pipe, &now);
 
        if ((vblwait->request.type & _DRM_VBLANK_NEXTONMISS) &&