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:57 -0800 [thread overview]
Message-ID: <11053776573462@kroah.com> (raw)
In-Reply-To: <11053776574186@kroah.com>
ChangeSet 1.1938.447.5, 2004/12/16 15:59:38-08:00, eike-hotplug@sf-tec.de
[PATCH] PCI Hotplug: ibmphp_core.c: useless casts
this patch removes some useless casts to and from (void *) as well as a cast
where a (struct pci_bus *) is cast to a (struct pci_bus *).
Signed-off-by: Rolf Eike Beer <eike-hotplug@sf-tec.de>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/pci/hotplug/ibmphp_core.c | 42 ++++++++++++++++----------------------
1 files changed, 18 insertions(+), 24 deletions(-)
diff -Nru a/drivers/pci/hotplug/ibmphp_core.c b/drivers/pci/hotplug/ibmphp_core.c
--- a/drivers/pci/hotplug/ibmphp_core.c 2005-01-10 09:04:42 -08:00
+++ b/drivers/pci/hotplug/ibmphp_core.c 2005-01-10 09:04:42 -08:00
@@ -260,7 +260,7 @@
break;
}
if (rc == 0) {
- pslot = (struct slot *) hotplug_slot->private;
+ pslot = hotplug_slot->private;
if (pslot)
rc = ibmphp_hpc_writeslot(pslot, cmd);
else
@@ -286,10 +286,9 @@
ibmphp_lock_operations();
if (hotplug_slot && value) {
- pslot = (struct slot *) hotplug_slot->private;
+ pslot = hotplug_slot->private;
if (pslot) {
- memcpy((void *) &myslot, (void *) pslot,
- sizeof(struct slot));
+ memcpy(&myslot, pslot, sizeof(struct slot));
rc = ibmphp_hpc_readslot(pslot, READ_SLOTSTATUS,
&(myslot.status));
if (!rc)
@@ -317,10 +316,9 @@
(ulong) hotplug_slot, (ulong) value);
ibmphp_lock_operations();
if (hotplug_slot && value) {
- pslot = (struct slot *) hotplug_slot->private;
+ pslot = hotplug_slot->private;
if (pslot) {
- memcpy((void *) &myslot, (void *) pslot,
- sizeof(struct slot));
+ memcpy(&myslot, pslot, sizeof(struct slot));
rc = ibmphp_hpc_readslot(pslot, READ_SLOTSTATUS,
&(myslot.status));
if (!rc)
@@ -345,10 +343,9 @@
(ulong) hotplug_slot, (ulong) value);
ibmphp_lock_operations();
if (hotplug_slot && value) {
- pslot = (struct slot *) hotplug_slot->private;
+ pslot = hotplug_slot->private;
if (pslot) {
- memcpy((void *) &myslot, (void *) pslot,
- sizeof(struct slot));
+ memcpy(&myslot, pslot, sizeof(struct slot));
rc = ibmphp_hpc_readslot(pslot, READ_SLOTSTATUS,
&(myslot.status));
if (!rc)
@@ -373,10 +370,9 @@
(ulong) hotplug_slot, (ulong) value);
ibmphp_lock_operations();
if (hotplug_slot && value) {
- pslot = (struct slot *) hotplug_slot->private;
+ pslot = hotplug_slot->private;
if (pslot) {
- memcpy((void *) &myslot, (void *) pslot,
- sizeof(struct slot));
+ memcpy(&myslot, pslot, sizeof(struct slot));
rc = ibmphp_hpc_readslot(pslot, READ_SLOTSTATUS,
&(myslot.status));
if (!rc) {
@@ -406,7 +402,7 @@
ibmphp_lock_operations();
if (hotplug_slot && value) {
- pslot = (struct slot *) hotplug_slot->private;
+ pslot = hotplug_slot->private;
if (pslot) {
rc = 0;
mode = pslot->supported_bus_mode;
@@ -446,7 +442,7 @@
ibmphp_lock_operations();
if (hotplug_slot && value) {
- pslot = (struct slot *) hotplug_slot->private;
+ pslot = hotplug_slot->private;
if (pslot) {
rc = get_cur_bus_info(&pslot);
if (!rc) {
@@ -494,10 +490,9 @@
ibmphp_lock_operations();
if (hotplug_slot && value) {
- pslot = (struct slot *) hotplug_slot->private;
+ pslot = hotplug_slot->private;
if (pslot) {
- memcpy((void *) &myslot, (void *) pslot,
- sizeof(struct slot));
+ memcpy(&myslot, pslot, sizeof(struct slot));
rc = ibmphp_hpc_readslot(pslot, READ_SLOTSTATUS,
&(myslot.status));
@@ -530,7 +525,7 @@
ibmphp_lock_operations();
if (hotplug_slot) {
- pslot = (struct slot *) hotplug_slot->private;
+ pslot = hotplug_slot->private;
if (pslot) {
rc = 0;
snprintf(value, 100, "Bus %x", pslot->bus);
@@ -851,8 +846,7 @@
}
if (!(flag) && (func->dev->hdr_type == PCI_HEADER_TYPE_BRIDGE)) {
pci_read_config_byte(func->dev, PCI_SECONDARY_BUS, &bus);
- child = (struct pci_bus *) pci_add_new_bus(func->dev->bus,
- (func->dev), bus);
+ child = pci_add_new_bus(func->dev->bus, func->dev, bus);
pci_do_scan_bus(child);
}
@@ -1058,7 +1052,7 @@
ibmphp_lock_operations();
debug("ENABLING SLOT........\n");
- slot_cur = (struct slot *) hs->private;
+ slot_cur = hs->private;
if ((rc = validate(slot_cur, ENABLE))) {
err("validate function failed\n");
@@ -1147,7 +1141,7 @@
goto error_power;
}
- slot_cur->func = (struct pci_func *) kmalloc(sizeof(struct pci_func), GFP_KERNEL);
+ slot_cur->func = kmalloc(sizeof(struct pci_func), GFP_KERNEL);
if (!slot_cur->func) {
/* We cannot do update_slot_info here, since no memory for
* kmalloc n.e.ways, and update_slot_info allocates some */
@@ -1258,7 +1252,7 @@
if (slot_cur->func == NULL) {
/* We need this for fncs's that were there on bootup */
- slot_cur->func = (struct pci_func *) kmalloc(sizeof(struct pci_func), GFP_KERNEL);
+ slot_cur->func = kmalloc(sizeof(struct pci_func), GFP_KERNEL);
if (!slot_cur->func) {
err("out of system memory\n");
rc = -ENOMEM;
next prev parent reply other threads:[~2005-01-10 17:24 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
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 [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-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=11053776573462@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.