From: Rolf Eike Beer <eike-hotplug@sf-tec.de>
To: linux-ia64@vger.kernel.org
Subject: Re: [Pcihpd-discuss] [PATCH 5/6]: hotplug/ia64: SN Hotplug Driver - SN Hotplug Driver code
Date: Thu, 19 May 2005 07:56:08 +0000 [thread overview]
Message-ID: <200505191000.59750@bilbo.math.uni-mannheim.de> (raw)
In-Reply-To: <200505131003.18143@bilbo.math.uni-mannheim.de>
[-- Attachment #1: Type: text/plain, Size: 1519 bytes --]
Prarit Bhargava wrote:
> Prarit Bhargava wrote:
> > Prarit Bhargava wrote:
> >>> D_B_S alone should be a unique identifier, so please don't use
> >>> anything more if you don't need it to make the slot name unique.
> >>
> >> On Altix, since the system can be cabled in a number of ways a pointer
> >> to the rack ID is definately useful and helps to uniquely identify the
> >> slot. I'm going to use a 2 digit rack id, followed by the DDDD:BB:SS
> >> value.
> >
> > Err .. uh .. unless there are any strenous objections of course ;
> New patch after comments from Eike and Greg.
Something I missed in the previous patch:
+static int sn_hp_slot_private_alloc(struct hotplug_slot *bss_hotplug_slot,
+ struct pci_bus *pci_bus, int device)
+{
+ struct pcibus_info *pcibus_info;
+ struct slot *slot;
+
+ pcibus_info = SN_PCIBUS_BUSSOFT_INFO(pci_bus);
+
+ bss_hotplug_slot->private = kcalloc(1, sizeof(struct slot),
+ GFP_KERNEL);
+ if (!bss_hotplug_slot->private)
+ return -ENOMEM;
+ slot = bss_hotplug_slot->private;
+
Better do it this way:
slot = kcalloc(1, sizeof(*slot), GFP_KERNEL);
bss_hotplug_slot->private = slot;
This way the size of the memory area is always the correct one (which is the
preferred way of operating *g*).
I think it's really time for something like kmalloc0() or whatever to stop
this type of kcalloc() abuse.
Eike
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2005-05-19 7:56 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-13 8:03 [Pcihpd-discuss] [PATCH 5/6]: hotplug/ia64: SN Hotplug Driver - SN Hotplug Driver code Rolf Eike Beer
2005-05-17 15:41 ` [Pcihpd-discuss] [PATCH 5/6]: hotplug/ia64: SN Hotplug Driver Prarit Bhargava
2005-05-17 20:17 ` [Pcihpd-discuss] [PATCH 5/6]: hotplug/ia64: SN Hotplug Driver - SN Hotplug Driver code Greg KH
2005-05-18 11:33 ` [Pcihpd-discuss] [PATCH 5/6]: hotplug/ia64: SN Hotplug Driver Prarit Bhargava
2005-05-18 11:42 ` Prarit Bhargava
2005-05-18 13:43 ` [Pcihpd-discuss] [PATCH 5/6]: hotplug/ia64: SN Hotplug Driver - SN Hotplug Driver code Rolf Eike Beer
2005-05-18 13:46 ` Rolf Eike Beer
2005-05-18 13:57 ` [Pcihpd-discuss] [PATCH 5/6]: hotplug/ia64: SN Hotplug Driver Prarit Bhargava
2005-05-18 14:06 ` Prarit Bhargava
2005-05-18 15:20 ` Prarit Bhargava
2005-05-18 16:23 ` [Pcihpd-discuss] [PATCH 5/6]: hotplug/ia64: SN Hotplug Driver - SN Hotplug Driver code Greg KH
2005-05-18 16:41 ` [Pcihpd-discuss] [PATCH 5/6]: hotplug/ia64: SN Hotplug Driver Prarit Bhargava
2005-05-18 16:52 ` Prarit Bhargava
2005-05-18 16:54 ` Prarit Bhargava
2005-05-18 17:06 ` [Pcihpd-discuss] [PATCH 5/6]: hotplug/ia64: SN Hotplug Driver - SN Hotplug Driver code Greg KH
2005-05-19 7:56 ` Rolf Eike Beer [this message]
2005-05-19 13:05 ` [Pcihpd-discuss] [PATCH 5/6]: hotplug/ia64: SN Hotplug Driver Prarit Bhargava
2005-05-19 15:13 ` [Pcihpd-discuss] [PATCH 5/6]: hotplug/ia64: SN Hotplug Driver - SN Hotplug Driver code Greg KH
2005-05-20 12:11 ` [Pcihpd-discuss] [PATCH 5/6]: hotplug/ia64: SN Hotplug Driver Prarit Bhargava
2005-05-20 18:26 ` [Pcihpd-discuss] [PATCH 5/6]: hotplug/ia64: SN Hotplug Driver - SN Hotplug Driver code Greg KH
2005-05-20 23:47 ` [Pcihpd-discuss] [PATCH 5/6]: hotplug/ia64: SN Hotplug Driver Prarit Bhargava
2005-05-21 0:24 ` Prarit Bhargava
2005-05-21 3:59 ` [Pcihpd-discuss] [PATCH 5/6]: hotplug/ia64: SN Hotplug Driver - SN Hotplug Driver code Greg KH
2005-05-22 1:13 ` [Pcihpd-discuss] [PATCH 5/6]: hotplug/ia64: SN Hotplug Driver Prarit Bhargava
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=200505191000.59750@bilbo.math.uni-mannheim.de \
--to=eike-hotplug@sf-tec.de \
--cc=linux-ia64@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