From: SF Markus Elfring <elfring@users.sourceforge.net>
To: dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org,
linux-media@vger.kernel.org,
Gustavo Padovan <gustavo@padovan.org>,
Sumit Semwal <sumit.semwal@linaro.org>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 2/4] dma-buf: Improve a size determination in dma_buf_attach()
Date: Mon, 8 May 2017 11:12:31 +0200 [thread overview]
Message-ID: <cff83dc6-4391-d9b1-6ac2-791d5a3e2eb4@users.sourceforge.net> (raw)
In-Reply-To: <3d972fa2-787a-d1f2-ff86-5c05494e00d3@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 8 May 2017 10:50:09 +0200
Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/dma-buf/dma-buf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c
index 53257c166f4d..9887d72cf804 100644
--- a/drivers/dma-buf/dma-buf.c
+++ b/drivers/dma-buf/dma-buf.c
@@ -558,7 +558,7 @@ struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf,
if (WARN_ON(!dmabuf || !dev))
return ERR_PTR(-EINVAL);
- attach = kzalloc(sizeof(struct dma_buf_attachment), GFP_KERNEL);
+ attach = kzalloc(sizeof(*attach), GFP_KERNEL);
if (attach == NULL)
return ERR_PTR(-ENOMEM);
--
2.12.2
next prev parent reply other threads:[~2017-05-08 9:12 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-08 9:10 [PATCH 0/4] DMA-buf: Fine-tuning for four function implementations SF Markus Elfring
2017-05-08 9:11 ` [PATCH 1/4] dma-buf: Combine two function calls into one in dma_buf_debug_show() SF Markus Elfring
2017-05-08 14:31 ` Gustavo Padovan
2017-05-08 9:12 ` SF Markus Elfring [this message]
2017-05-08 14:31 ` [PATCH 2/4] dma-buf: Improve a size determination in dma_buf_attach() Gustavo Padovan
2017-05-08 9:13 ` [PATCH 3/4] dma-buf: Adjust a null pointer check " SF Markus Elfring
2017-05-08 14:32 ` Gustavo Padovan
2017-05-08 9:14 ` [PATCH 4/4] dma-buf: Use seq_putc() in two functions SF Markus Elfring
2017-05-08 14:33 ` Gustavo Padovan
2017-05-09 4:18 ` [PATCH 0/4] DMA-buf: Fine-tuning for four function implementations Sumit Semwal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cff83dc6-4391-d9b1-6ac2-791d5a3e2eb4@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=dri-devel@lists.freedesktop.org \
--cc=gustavo@padovan.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=sumit.semwal@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).