All of lore.kernel.org
 help / color / mirror / Atom feed
From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-arm-kernel@lists.infradead.org,
	Santosh Shilimkar <ssantosh@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 2/3] soc-knav_dma: Improve a size determination in knav_dma_probe()
Date: Mon, 1 May 2017 21:28:52 +0200	[thread overview]
Message-ID: <0cdbac2f-115c-a2f2-e44f-ab160fb76d29@users.sourceforge.net> (raw)
In-Reply-To: <eddc35f7-a04b-42f5-ad8b-d345ca0b57b4@users.sourceforge.net>

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 1 May 2017 21:06:46 +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/soc/ti/knav_dma.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/soc/ti/knav_dma.c b/drivers/soc/ti/knav_dma.c
index a66671a93199..410018d9054e 100644
--- a/drivers/soc/ti/knav_dma.c
+++ b/drivers/soc/ti/knav_dma.c
@@ -739,8 +739,7 @@ static int knav_dma_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
-	kdev = devm_kzalloc(dev,
-			sizeof(struct knav_dma_pool_device), GFP_KERNEL);
+	kdev = devm_kzalloc(dev, sizeof(*kdev), GFP_KERNEL);
 	if (!kdev) {
 		dev_err(dev, "could not allocate driver mem\n");
 		return -ENOMEM;
-- 
2.12.2

WARNING: multiple messages have this Message-ID (diff)
From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/3] soc-knav_dma: Improve a size determination in knav_dma_probe()
Date: Mon, 01 May 2017 19:28:52 +0000	[thread overview]
Message-ID: <0cdbac2f-115c-a2f2-e44f-ab160fb76d29@users.sourceforge.net> (raw)
In-Reply-To: <eddc35f7-a04b-42f5-ad8b-d345ca0b57b4@users.sourceforge.net>

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 1 May 2017 21:06:46 +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/soc/ti/knav_dma.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/soc/ti/knav_dma.c b/drivers/soc/ti/knav_dma.c
index a66671a93199..410018d9054e 100644
--- a/drivers/soc/ti/knav_dma.c
+++ b/drivers/soc/ti/knav_dma.c
@@ -739,8 +739,7 @@ static int knav_dma_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
-	kdev = devm_kzalloc(dev,
-			sizeof(struct knav_dma_pool_device), GFP_KERNEL);
+	kdev = devm_kzalloc(dev, sizeof(*kdev), GFP_KERNEL);
 	if (!kdev) {
 		dev_err(dev, "could not allocate driver mem\n");
 		return -ENOMEM;
-- 
2.12.2


WARNING: multiple messages have this Message-ID (diff)
From: elfring@users.sourceforge.net (SF Markus Elfring)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/3] soc-knav_dma: Improve a size determination in knav_dma_probe()
Date: Mon, 1 May 2017 21:28:52 +0200	[thread overview]
Message-ID: <0cdbac2f-115c-a2f2-e44f-ab160fb76d29@users.sourceforge.net> (raw)
In-Reply-To: <eddc35f7-a04b-42f5-ad8b-d345ca0b57b4@users.sourceforge.net>

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 1 May 2017 21:06:46 +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/soc/ti/knav_dma.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/soc/ti/knav_dma.c b/drivers/soc/ti/knav_dma.c
index a66671a93199..410018d9054e 100644
--- a/drivers/soc/ti/knav_dma.c
+++ b/drivers/soc/ti/knav_dma.c
@@ -739,8 +739,7 @@ static int knav_dma_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
-	kdev = devm_kzalloc(dev,
-			sizeof(struct knav_dma_pool_device), GFP_KERNEL);
+	kdev = devm_kzalloc(dev, sizeof(*kdev), GFP_KERNEL);
 	if (!kdev) {
 		dev_err(dev, "could not allocate driver mem\n");
 		return -ENOMEM;
-- 
2.12.2

  parent reply	other threads:[~2017-05-01 19:31 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-01 19:26 [PATCH 0/3] SoC-TI-knav_dma: Fine-tuning for three function implementations SF Markus Elfring
2017-05-01 19:26 ` SF Markus Elfring
2017-05-01 19:26 ` SF Markus Elfring
2017-05-01 19:27 ` [PATCH 1/3] soc-knav_dma: Use seq_putc() in dma_debug_show_channels() SF Markus Elfring
2017-05-01 19:27   ` SF Markus Elfring
2017-05-01 19:27   ` SF Markus Elfring
2018-01-19 16:59   ` Santosh Shilimkar
2018-01-19 16:59     ` Santosh Shilimkar
2018-01-19 16:59     ` Santosh Shilimkar
2017-05-01 19:28 ` SF Markus Elfring [this message]
2017-05-01 19:28   ` [PATCH 2/3] soc-knav_dma: Improve a size determination in knav_dma_probe() SF Markus Elfring
2017-05-01 19:28   ` SF Markus Elfring
2017-05-01 19:30 ` [PATCH 3/3] soc-knav_dma: Delete error messages for a failed memory allocation in two functions SF Markus Elfring
2017-05-01 19:30   ` SF Markus Elfring
2017-05-01 19:30   ` SF 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=0cdbac2f-115c-a2f2-e44f-ab160fb76d29@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ssantosh@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.