diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2018-09-11 15:42:15 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2018-09-12 08:21:33 +0200 |
commit | 33f35429fc49c09a5d4b929690d4c44694c390a7 (patch) | |
tree | 055a1fc3e67e2264881a473922afa682b8bfedc0 /drivers | |
parent | udmabuf: drop WARN_ON() check. (diff) | |
download | linux-33f35429fc49c09a5d4b929690d4c44694c390a7.tar.xz linux-33f35429fc49c09a5d4b929690d4c44694c390a7.zip |
udmabuf: use sizeof(variable) instead of sizeof(type)
Reported-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20180911134216.9760-13-kraxel@redhat.com
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/dma-buf/udmabuf.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/dma-buf/udmabuf.c b/drivers/dma-buf/udmabuf.c index 63cc77edd1f3..9edabce0b8ab 100644 --- a/drivers/dma-buf/udmabuf.c +++ b/drivers/dma-buf/udmabuf.c @@ -128,7 +128,7 @@ static long udmabuf_create(const struct udmabuf_create_list *head, int seals, ret = -EINVAL; u32 i, flags; - ubuf = kzalloc(sizeof(struct udmabuf), GFP_KERNEL); + ubuf = kzalloc(sizeof(*ubuf), GFP_KERNEL); if (!ubuf) return -ENOMEM; @@ -142,7 +142,7 @@ static long udmabuf_create(const struct udmabuf_create_list *head, if (ubuf->pagecount > pglimit) goto err; } - ubuf->pages = kmalloc_array(ubuf->pagecount, sizeof(struct page *), + ubuf->pages = kmalloc_array(ubuf->pagecount, sizeof(*ubuf->pages), GFP_KERNEL); if (!ubuf->pages) { ret = -ENOMEM; @@ -211,7 +211,7 @@ static long udmabuf_ioctl_create(struct file *filp, unsigned long arg) struct udmabuf_create_item list; if (copy_from_user(&create, (void __user *)arg, - sizeof(struct udmabuf_create))) + sizeof(create))) return -EFAULT; head.flags = create.flags; |