linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: elfring@users.sourceforge.net (SF Markus Elfring)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/6] ARM: s3c24xx: Improve a size determination in s3c2412_iotiming_get()
Date: Mon, 2 Oct 2017 20:03:25 +0200	[thread overview]
Message-ID: <28b8f35c-bed7-564f-9519-6d08e9c4edf9@users.sourceforge.net> (raw)
In-Reply-To: <d2ae00c8-da57-9ffc-3692-67ed6daa95e0@users.sourceforge.net>

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 2 Oct 2017 19:38:42 +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.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 arch/arm/mach-s3c24xx/iotiming-s3c2412.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-s3c24xx/iotiming-s3c2412.c b/arch/arm/mach-s3c24xx/iotiming-s3c2412.c
index f09d5d5ea7ed..01bcd7d5dac7 100644
--- a/arch/arm/mach-s3c24xx/iotiming-s3c2412.c
+++ b/arch/arm/mach-s3c24xx/iotiming-s3c2412.c
@@ -242,7 +242,7 @@ int s3c2412_iotiming_get(struct s3c_cpufreq_config *cfg,
 		if (!bank_is_io(bank, bankcfg))
 			continue;
 
-		bt = kzalloc(sizeof(struct s3c2412_iobank_timing), GFP_KERNEL);
+		bt = kzalloc(sizeof(*bt), GFP_KERNEL);
 		if (!bt)
 			return -ENOMEM;
 
-- 
2.14.2

  parent reply	other threads:[~2017-10-02 18:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-02 17:56 [PATCH 0/6] ARM-S3C24xx: Adjustments for four function implementations SF Markus Elfring
2017-10-02 17:58 ` [PATCH 1/6] ARM: s3c24xx: Delete an error message for a failed memory allocation in s3c2410_iotiming_get() SF Markus Elfring
2017-10-04 17:59   ` Krzysztof Kozlowski
2017-10-02 17:59 ` [PATCH 2/6] ARM: s3c24xx: Improve a size determination " SF Markus Elfring
2017-10-04 18:12   ` Krzysztof Kozlowski
2017-10-02 18:00 ` [PATCH 3/6] ARM: s3c2410: Fix a typo in a comment line SF Markus Elfring
2017-10-04 18:14   ` Krzysztof Kozlowski
2017-10-10  8:29     ` SF Markus Elfring
2017-10-10  8:35       ` Krzysztof Kozlowski
2017-10-10  8:48         ` SF Markus Elfring
2017-10-02 18:01 ` [PATCH 4/6] ARM: s3c24xx: Delete an error message for a failed memory allocation in s3c2412_iotiming_get() SF Markus Elfring
2017-10-04 18:03   ` Krzysztof Kozlowski
2017-10-02 18:03 ` SF Markus Elfring [this message]
2017-10-02 18:04 ` [PATCH 6/6] ARM: s3c2412: Fix a typo in a comment line 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=28b8f35c-bed7-564f-9519-6d08e9c4edf9@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --cc=linux-arm-kernel@lists.infradead.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).