All of lore.kernel.org
 help / color / mirror / Atom feed
From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	Russell King <linux@armlinux.org.uk>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 2/2] video: ARM CLCD: Improve a size determination in clcdfb_probe()
Date: Tue, 5 Dec 2017 18:13:33 +0100	[thread overview]
Message-ID: <3656de6d-53cc-f6a4-1950-71fc989c79a4@users.sourceforge.net> (raw)
In-Reply-To: <107ed35f-1775-14e0-a7b5-20e7ee02ac16@users.sourceforge.net>

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 5 Dec 2017 17:53:19 +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.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/video/fbdev/amba-clcd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/amba-clcd.c b/drivers/video/fbdev/amba-clcd.c
index 79f5ebf23fcd..38c1f324ce15 100644
--- a/drivers/video/fbdev/amba-clcd.c
+++ b/drivers/video/fbdev/amba-clcd.c
@@ -967,7 +967,7 @@ static int clcdfb_probe(struct amba_device *dev, const struct amba_id *id)
 		goto out;
 	}
 
-	fb = kzalloc(sizeof(struct clcd_fb), GFP_KERNEL);
+	fb = kzalloc(sizeof(*fb), GFP_KERNEL);
 	if (!fb) {
 		ret = -ENOMEM;
 		goto free_region;
-- 
2.15.1

WARNING: multiple messages have this Message-ID (diff)
From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	Russell King <linux@armlinux.org.uk>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 2/2] video: ARM CLCD: Improve a size determination in clcdfb_probe()
Date: Tue, 05 Dec 2017 17:13:33 +0000	[thread overview]
Message-ID: <3656de6d-53cc-f6a4-1950-71fc989c79a4@users.sourceforge.net> (raw)
In-Reply-To: <107ed35f-1775-14e0-a7b5-20e7ee02ac16@users.sourceforge.net>

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 5 Dec 2017 17:53:19 +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.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/video/fbdev/amba-clcd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/amba-clcd.c b/drivers/video/fbdev/amba-clcd.c
index 79f5ebf23fcd..38c1f324ce15 100644
--- a/drivers/video/fbdev/amba-clcd.c
+++ b/drivers/video/fbdev/amba-clcd.c
@@ -967,7 +967,7 @@ static int clcdfb_probe(struct amba_device *dev, const struct amba_id *id)
 		goto out;
 	}
 
-	fb = kzalloc(sizeof(struct clcd_fb), GFP_KERNEL);
+	fb = kzalloc(sizeof(*fb), GFP_KERNEL);
 	if (!fb) {
 		ret = -ENOMEM;
 		goto free_region;
-- 
2.15.1


  parent reply	other threads:[~2017-12-05 17:14 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-05 17:10 [PATCH 0/2] video/fbdev/amba-clcd: Adjustments for clcdfb_probe() SF Markus Elfring
2017-12-05 17:10 ` SF Markus Elfring
2017-12-05 17:10 ` SF Markus Elfring
2017-12-05 17:12 ` [PATCH 1/2] video: ARM CLCD: Delete an error message for a failed memory allocation in clcdfb_probe() SF Markus Elfring
2017-12-05 17:12   ` SF Markus Elfring
2017-12-05 17:12   ` [PATCH 1/2] video: ARM CLCD: Delete an error message for a failed memory allocation in clcdfb_probe( SF Markus Elfring
2018-03-28 14:13   ` [PATCH 1/2] video: ARM CLCD: Delete an error message for a failed memory allocation in clcdfb_probe() Bartlomiej Zolnierkiewicz
2018-03-28 14:13     ` [PATCH 1/2] video: ARM CLCD: Delete an error message for a failed memory allocation in clcdfb_pr Bartlomiej Zolnierkiewicz
2017-12-05 17:13 ` SF Markus Elfring [this message]
2017-12-05 17:13   ` [PATCH 2/2] video: ARM CLCD: Improve a size determination in clcdfb_probe() SF Markus Elfring
2018-03-28 14:16   ` Bartlomiej Zolnierkiewicz
2018-03-28 14:16     ` Bartlomiej Zolnierkiewicz
2018-03-28 14:16     ` Bartlomiej Zolnierkiewicz

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=3656de6d-53cc-f6a4-1950-71fc989c79a4@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --cc=b.zolnierkie@samsung.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    /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.