From: Gregor Jasny <gjasny@web.de>
To: Jesper Juhl <jesper.juhl@gmail.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Reduce nr of ptr derefs in drivers/pci/hotplug/pciehp_core.c
Date: Sun, 11 Dec 2005 14:08:43 +0100 [thread overview]
Message-ID: <439C24DB.3050307@web.de> (raw)
In-Reply-To: <200512110641.42992.jesper.juhl@gmail.com>
Jesper Juhl schrieb:
> --- linux-2.6.15-rc5-git1-orig/drivers/pci/hotplug/pciehp_core.c 2005-12-04 18:48:04.000000000 +0100
> +++ linux-2.6.15-rc5-git1/drivers/pci/hotplug/pciehp_core.c 2005-12-11 05:46:58.000000000 +0100
@@ -114,59 +117,66 @@ static int init_slots(struct controller
slot_number = ctrl->first_slot;
while (number_of_slots) {
- new_slot = kmalloc(sizeof(*new_slot), GFP_KERNEL);
- if (!new_slot)
+ slot = kmalloc(sizeof(*slot), GFP_KERNEL);
+ if (!slot)
goto error;
- memset(new_slot, 0, sizeof(struct slot));
- new_slot->hotplug_slot =
- kmalloc(sizeof(*(new_slot->hotplug_slot)),
+ memset(slot, 0, sizeof(struct slot));
+ slot->hotplug_slot =
+ kmalloc(sizeof(*(slot->hotplug_slot)),
Just one suggestion:
In your patches I've seen a lot of kmalloc + memset calls. Perhaps you
can convert them to kzalloc? This would improve readability even more.
Thanks,
Gregor
next prev parent reply other threads:[~2005-12-11 13:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-11 5:41 Jesper Juhl
2005-12-11 13:08 ` Gregor Jasny [this message]
2005-12-11 13:19 ` Jesper Juhl
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=439C24DB.3050307@web.de \
--to=gjasny@web.de \
--cc=jesper.juhl@gmail.com \
--cc=linux-kernel@vger.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
Powered by JetHome