All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PCI patches for 2.6.10
Date: Mon, 10 Jan 2005 09:20:56 -0800	[thread overview]
Message-ID: <11053776561347@kroah.com> (raw)
In-Reply-To: <11053776551683@kroah.com>

ChangeSet 1.1938.439.45, 2005/01/07 10:33:06-08:00, eike-hotplug@sf-tec.de

[PATCH] PCI Hotplug: Remove unneeded kmalloc casts from ibmphp_pci.c

this patch removes some unneeded casts from ibmphp_pci.c that cast the result
of kmalloc to some pointer type. It also uses "sizeof(*result)" instead of
"sizeof(type_of_result)".

Signed-off-by: Rolf Eike Beer <eike-hotplug@sf-tec.de>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>


 drivers/pci/hotplug/ibmphp_pci.c |   30 +++++++++++++++---------------
 1 files changed, 15 insertions(+), 15 deletions(-)


diff -Nru a/drivers/pci/hotplug/ibmphp_pci.c b/drivers/pci/hotplug/ibmphp_pci.c
--- a/drivers/pci/hotplug/ibmphp_pci.c	2005-01-10 08:59:03 -08:00
+++ b/drivers/pci/hotplug/ibmphp_pci.c	2005-01-10 08:59:03 -08:00
@@ -164,7 +164,7 @@
 						cleanup_count = 6;
 						goto error;
 					}
-					newfunc = (struct pci_func *) kmalloc (sizeof (struct pci_func), GFP_KERNEL);
+					newfunc = kmalloc(sizeof(*newfunc), GFP_KERNEL);
 					if (!newfunc) {
 						err ("out of system memory\n");
 						return -ENOMEM;
@@ -203,7 +203,7 @@
 					flag = FALSE;
 					for (i = 0; i < 32; i++) {
 						if (func->devices[i]) {
-							newfunc = (struct pci_func *) kmalloc (sizeof (struct pci_func), GFP_KERNEL);
+							newfunc = kmalloc(sizeof(*newfunc), GFP_KERNEL);
 							if (!newfunc) {
 								err ("out of system memory\n");
 								return -ENOMEM;
@@ -232,7 +232,7 @@
 						}
 					}
 
-					newfunc = (struct pci_func *) kmalloc (sizeof (struct pci_func), GFP_KERNEL);
+					newfunc = kmalloc(sizeof(*newfunc), GFP_KERNEL);
 					if (!newfunc) {
 						err ("out of system memory\n");
 						return -ENOMEM;
@@ -279,7 +279,7 @@
 					for (i = 0; i < 32; i++) {
 						if (func->devices[i]) {
 							debug ("inside for loop, device is %x\n", i);
-							newfunc = (struct pci_func *) kmalloc (sizeof (struct pci_func), GFP_KERNEL);
+							newfunc = kmalloc(sizeof(*newfunc), GFP_KERNEL);
 							if (!newfunc) {
 								err (" out of system memory\n");
 								return -ENOMEM;
@@ -459,7 +459,7 @@
 					ibmphp_add_resource (pfmem[count]);
 					func->pfmem[count] = pfmem[count];
 				} else {
-					mem_tmp = kmalloc (sizeof (struct resource_node), GFP_KERNEL);
+					mem_tmp = kmalloc(sizeof(*mem_tmp), GFP_KERNEL);
 					if (!mem_tmp) {
 						err ("out of system memory\n");
 						kfree (pfmem[count]);
@@ -724,7 +724,7 @@
 					ibmphp_add_resource (bus_pfmem[count]);
 					func->pfmem[count] = bus_pfmem[count];
 				} else {
-					mem_tmp = kmalloc (sizeof (struct resource_node), GFP_KERNEL);
+					mem_tmp = kmalloc(sizeof(*mem_tmp), GFP_KERNEL);
 					if (!mem_tmp) {
 						err ("out of system memory\n");
 						retval = -ENOMEM;
@@ -836,7 +836,7 @@
 		flag_io = TRUE;
 	} else {
 		debug ("it wants %x IO behind the bridge\n", amount_needed->io);
-		io = kmalloc (sizeof (struct resource_node), GFP_KERNEL);
+		io = kmalloc(sizeof(*io), GFP_KERNEL);
 		
 		if (!io) {
 			err ("out of system memory\n");
@@ -860,7 +860,7 @@
 		flag_mem = TRUE;
 	} else {
 		debug ("it wants %x memory behind the bridge\n", amount_needed->mem);
-		mem = kmalloc (sizeof (struct resource_node), GFP_KERNEL);
+		mem = kmalloc(sizeof(*mem), GFP_KERNEL);
 		if (!mem) {
 			err ("out of system memory\n");
 			retval = -ENOMEM;
@@ -883,7 +883,7 @@
 		flag_pfmem = TRUE;
 	} else {
 		debug ("it wants %x pfmemory behind the bridge\n", amount_needed->pfmem);
-		pfmem = kmalloc (sizeof (struct resource_node), GFP_KERNEL);
+		pfmem = kmalloc(sizeof(*pfmem), GFP_KERNEL);
 		if (!pfmem) {
 			err ("out of system memory\n");
 			retval = -ENOMEM;
@@ -899,7 +899,7 @@
 			ibmphp_add_resource (pfmem);
 			flag_pfmem = TRUE;
 		} else {
-			mem_tmp = kmalloc (sizeof (struct resource_node), GFP_KERNEL);
+			mem_tmp = kmalloc(sizeof(*mem_tmp), GFP_KERNEL);
 			if (!mem_tmp) {
 				err ("out of system memory\n");
 				retval = -ENOMEM;
@@ -931,7 +931,7 @@
 		 */
 		bus = ibmphp_find_res_bus (sec_number);
 		if (!bus) {
-			bus = kmalloc (sizeof (struct bus_node), GFP_KERNEL);
+			bus = kmalloc(sizeof(*bus), GFP_KERNEL);
 			if (!bus) {
 				err ("out of system memory\n");
 				retval = -ENOMEM;
@@ -1107,7 +1107,7 @@
 	};
 	struct res_needed *amount;
 
-	amount = kmalloc (sizeof (struct res_needed), GFP_KERNEL);
+	amount = kmalloc(sizeof(*amount), GFP_KERNEL);
 	if (amount == NULL)
 		return NULL;
 	memset (amount, 0, sizeof (struct res_needed));
@@ -1680,7 +1680,7 @@
 		list_add (&bus->bus_list, &cur_bus->bus_list);
 	}
 	if (io) {
-		io_range = kmalloc (sizeof (struct range_node), GFP_KERNEL);
+		io_range = kmalloc(sizeof(*io_range), GFP_KERNEL);
 		if (!io_range) {
 			err ("out of system memory\n");
 			return -ENOMEM;
@@ -1693,7 +1693,7 @@
 		bus->rangeIO = io_range;
 	}
 	if (mem) {
-		mem_range = kmalloc (sizeof (struct range_node), GFP_KERNEL);
+		mem_range = kmalloc(sizeof(*mem_range), GFP_KERNEL);
 		if (!mem_range) {
 			err ("out of system memory\n");
 			return -ENOMEM;
@@ -1706,7 +1706,7 @@
 		bus->rangeMem = mem_range;
 	}
 	if (pfmem) {
-		pfmem_range = kmalloc (sizeof (struct range_node), GFP_KERNEL);
+		pfmem_range = kmalloc(sizeof(*pfmem_range), GFP_KERNEL);
 		if (!pfmem_range) {	
 			err ("out of system memory\n");
 			return -ENOMEM;


  reply	other threads:[~2005-01-10 17:35 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-10 17:18 [BK PATCH] PCI patches for 2.6.10-rc2 Greg KH
2005-01-10 17:19 ` Greg KH
2005-01-10 17:20 ` [PATCH] PCI patches for 2.6.10 Greg KH
2005-01-10 17:20   ` Greg KH [this message]
2005-01-10 17:20     ` Greg KH
2005-01-10 17:20       ` Greg KH
2005-01-10 17:20         ` Greg KH
2005-01-10 17:20           ` Greg KH
2005-01-10 17:20             ` Greg KH
2005-01-10 17:20               ` Greg KH
2005-01-10 17:20                 ` Greg KH
2005-01-10 17:20                   ` Greg KH
2005-01-10 17:20                     ` Greg KH
2005-01-10 17:20                       ` Greg KH
2005-01-10 17:20                         ` Greg KH
2005-01-10 17:20                           ` Greg KH
2005-01-10 17:20                             ` Greg KH
2005-01-10 17:20                               ` Greg KH
2005-01-10 17:20                                 ` Greg KH
2005-01-10 17:20                                   ` Greg KH
2005-01-10 17:20                                     ` Greg KH
2005-01-10 17:20                                       ` Greg KH
2005-01-10 17:20                                         ` Greg KH
2005-01-10 17:20                                           ` Greg KH
2005-01-10 17:20                                             ` Greg KH
2005-01-10 17:20                                               ` Greg KH
2005-01-11 22:39   ` Matt Mackall
2005-01-11 22:44     ` Greg KH
2005-01-12 13:09       ` Domen Puncer

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=11053776561347@kroah.com \
    --to=greg@kroah.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 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.