mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: dmaengine@vger.kernel.org, kernel-janitors@vger.kernel.org,
	Vinod Koul <vkoul@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>, cocci@inria.fr
Subject: [PATCH 2/3] dmaengine: timb_dma: Improve a size determination in td_alloc_init_desc()
Date: Mon, 25 Dec 2023 11:20:18 +0100	[thread overview]
Message-ID: <04ced4fa-90b5-4dd7-8f50-2f898b2c0855@web.de> (raw)
In-Reply-To: <ebd531dd-60e3-4ac3-821e-aa9890960283@web.de>

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 25 Dec 2023 10:50:10 +0100

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/timb_dma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/timb_dma.c b/drivers/dma/timb_dma.c
index abcab0b1ad3b..fc1f67bf9c06 100644
--- a/drivers/dma/timb_dma.c
+++ b/drivers/dma/timb_dma.c
@@ -325,7 +325,7 @@ static struct timb_dma_desc *td_alloc_init_desc(struct timb_dma_chan *td_chan)
 	struct timb_dma_desc *td_desc;
 	int err;

-	td_desc = kzalloc(sizeof(struct timb_dma_desc), GFP_KERNEL);
+	td_desc = kzalloc(sizeof(*td_desc), GFP_KERNEL);
 	if (!td_desc)
 		return NULL;

--
2.43.0


  parent reply	other threads:[~2023-12-25 10:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-25 10:15 [PATCH 0/3] dmaengine: timb_dma: Adjustments for td_alloc_init_desc() Markus Elfring
2023-12-25 10:18 ` [PATCH 1/3] dmaengine: timb_dma: Return directly after a failed kzalloc() in td_alloc_init_desc() Markus Elfring
2023-12-25 10:20 ` Markus Elfring [this message]
2023-12-25 10:22 ` [PATCH 3/3] dmaengine: timb_dma: One function call less in td_alloc_init_desc() after error detection Markus Elfring
2024-01-22 11:32 ` [PATCH 0/3] dmaengine: timb_dma: Adjustments for td_alloc_init_desc() Vinod Koul
2024-01-22 12:15   ` [0/3] " Markus Elfring

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=04ced4fa-90b5-4dd7-8f50-2f898b2c0855@web.de \
    --to=markus.elfring@web.de \
    --cc=cocci@inria.fr \
    --cc=dmaengine@vger.kernel.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vkoul@kernel.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

all inboxes | Powered by JetHome®