From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linuxppc-dev@lists.ozlabs.org,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Jan Kara <jack@suse.cz>, Jens Axboe <axboe@fb.com>,
Dan Williams <dan.j.williams@intel.com>,
Michael Ellerman <mpe@ellerman.id.au>,
Paul Mackerras <paulus@samba.org>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 2/4] axonram: Improve a size determination in axon_ram_probe()
Date: Thu, 3 Aug 2017 21:14:21 +0200 [thread overview]
Message-ID: <5dff1619-f3df-a6ef-7a75-11bae170e0d1@users.sourceforge.net> (raw)
In-Reply-To: <009fdef0-b2c9-5e98-d32d-14149aec92c5@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Thu, 3 Aug 2017 20:00:16 +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>
---
arch/powerpc/sysdev/axonram.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/sysdev/axonram.c b/arch/powerpc/sysdev/axonram.c
index b82d1b023a15..bf1506ec2ca4 100644
--- a/arch/powerpc/sysdev/axonram.c
+++ b/arch/powerpc/sysdev/axonram.c
@@ -191,7 +191,7 @@ static int axon_ram_probe(struct platform_device *device)
dev_info(&device->dev, "Found memory controller on %s\n",
device->dev.of_node->full_name);
- bank = kzalloc(sizeof(struct axon_ram_bank), GFP_KERNEL);
+ bank = kzalloc(sizeof(*bank), GFP_KERNEL);
if (bank == NULL) {
rc = -ENOMEM;
goto failed;
--
2.13.4
next prev parent reply other threads:[~2017-08-03 19:27 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-03 19:11 [PATCH 0/4] axonram: Adjustments for axon_ram_probe() SF Markus Elfring
2017-08-03 19:12 ` [PATCH 1/4] axonram: Delete an error message for a failed memory allocation in axon_ram_probe() SF Markus Elfring
2017-09-01 13:29 ` [1/4] " Michael Ellerman
2017-09-01 15:13 ` SF Markus Elfring
2017-08-03 19:14 ` SF Markus Elfring [this message]
2017-08-03 19:15 ` [PATCH 3/4] axonram: Return directly after a failed kzalloc() " SF Markus Elfring
2017-08-03 19:17 ` [PATCH 4/4] axonram: Delete an unnecessary variable initialisation " SF Markus Elfring
2017-08-04 13:12 ` kbuild test robot
2017-09-05 17:11 ` [PATCH v2] " SF Markus Elfring
2017-10-24 8:07 ` [v2] " Michael Ellerman
2017-08-04 16:51 ` [PATCH 4/4] " Tyrel Datwyler
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=5dff1619-f3df-a6ef-7a75-11bae170e0d1@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=axboe@fb.com \
--cc=benh@kernel.crashing.org \
--cc=dan.j.williams@intel.com \
--cc=jack@suse.cz \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=paulus@samba.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).