From: Greg Kroah-Hartman <gregkh@suse.de>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@suse.de>,
Kay Sievers <kay.sievers@vrfy.org>,
Roland Dreier <rolandd@cisco.com>,
Hal Rosenstock <hal.rosenstock@gmail.com>
Subject: [PATCH 40/79] infiniband: rename "device" to "ib_device" in cm_device
Date: Mon, 21 Jul 2008 22:19:04 -0700 [thread overview]
Message-ID: <1216703983-21448-40-git-send-email-gregkh@suse.de> (raw)
In-Reply-To: <20080722051805.GA17373@suse.de>
This pointer really is a struct ib_device, not a struct device, so name
it properly to help prevent confusion.
This makes the followon patch in this series much smaller and easier to
understand as well.
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Roland Dreier <rolandd@cisco.com>
Cc: Hal Rosenstock <hal.rosenstock@gmail.com>
Acked-by: Sean Hefty <sean.hefty@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/infiniband/core/cm.c | 47 +++++++++++++++++++++--------------------
1 files changed, 24 insertions(+), 23 deletions(-)
diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
index 55738ee..8dc4429 100644
--- a/drivers/infiniband/core/cm.c
+++ b/drivers/infiniband/core/cm.c
@@ -162,7 +162,7 @@ struct cm_port {
struct cm_device {
struct list_head list;
- struct ib_device *device;
+ struct ib_device *ib_device;
struct kobject dev_obj;
u8 ack_delay;
struct cm_port *port[0];
@@ -339,7 +339,7 @@ static void cm_init_av_for_response(struct cm_port *port, struct ib_wc *wc,
{
av->port = port;
av->pkey_index = wc->pkey_index;
- ib_init_ah_from_wc(port->cm_dev->device, port->port_num, wc,
+ ib_init_ah_from_wc(port->cm_dev->ib_device, port->port_num, wc,
grh, &av->ah_attr);
}
@@ -353,7 +353,7 @@ static int cm_init_av_by_path(struct ib_sa_path_rec *path, struct cm_av *av)
read_lock_irqsave(&cm.device_lock, flags);
list_for_each_entry(cm_dev, &cm.device_list, list) {
- if (!ib_find_cached_gid(cm_dev->device, &path->sgid,
+ if (!ib_find_cached_gid(cm_dev->ib_device, &path->sgid,
&p, NULL)) {
port = cm_dev->port[p-1];
break;
@@ -364,13 +364,13 @@ static int cm_init_av_by_path(struct ib_sa_path_rec *path, struct cm_av *av)
if (!port)
return -EINVAL;
- ret = ib_find_cached_pkey(cm_dev->device, port->port_num,
+ ret = ib_find_cached_pkey(cm_dev->ib_device, port->port_num,
be16_to_cpu(path->pkey), &av->pkey_index);
if (ret)
return ret;
av->port = port;
- ib_init_ah_from_path(cm_dev->device, port->port_num, path,
+ ib_init_ah_from_path(cm_dev->ib_device, port->port_num, path,
&av->ah_attr);
av->timeout = path->packet_life_time + 1;
return 0;
@@ -1515,7 +1515,7 @@ static int cm_req_handler(struct cm_work *work)
req_msg = (struct cm_req_msg *)work->mad_recv_wc->recv_buf.mad;
- cm_id = ib_create_cm_id(work->port->cm_dev->device, NULL, NULL);
+ cm_id = ib_create_cm_id(work->port->cm_dev->ib_device, NULL, NULL);
if (IS_ERR(cm_id))
return PTR_ERR(cm_id);
@@ -1550,7 +1550,7 @@ static int cm_req_handler(struct cm_work *work)
cm_format_paths_from_req(req_msg, &work->path[0], &work->path[1]);
ret = cm_init_av_by_path(&work->path[0], &cm_id_priv->av);
if (ret) {
- ib_get_cached_gid(work->port->cm_dev->device,
+ ib_get_cached_gid(work->port->cm_dev->ib_device,
work->port->port_num, 0, &work->path[0].sgid);
ib_send_cm_rej(cm_id, IB_CM_REJ_INVALID_GID,
&work->path[0].sgid, sizeof work->path[0].sgid,
@@ -2950,7 +2950,7 @@ static int cm_sidr_req_handler(struct cm_work *work)
struct cm_sidr_req_msg *sidr_req_msg;
struct ib_wc *wc;
- cm_id = ib_create_cm_id(work->port->cm_dev->device, NULL, NULL);
+ cm_id = ib_create_cm_id(work->port->cm_dev->ib_device, NULL, NULL);
if (IS_ERR(cm_id))
return PTR_ERR(cm_id);
cm_id_priv = container_of(cm_id, struct cm_id_private, id);
@@ -3578,7 +3578,7 @@ static void cm_get_ack_delay(struct cm_device *cm_dev)
{
struct ib_device_attr attr;
- if (ib_query_device(cm_dev->device, &attr))
+ if (ib_query_device(cm_dev->ib_device, &attr))
cm_dev->ack_delay = 0; /* acks will rely on packet life time */
else
cm_dev->ack_delay = attr.local_ca_ack_delay;
@@ -3676,7 +3676,7 @@ static void cm_remove_port_fs(struct cm_port *port)
kobject_put(&port->port_obj);
}
-static void cm_add_one(struct ib_device *device)
+static void cm_add_one(struct ib_device *ib_device)
{
struct cm_device *cm_dev;
struct cm_port *port;
@@ -3691,26 +3691,27 @@ static void cm_add_one(struct ib_device *device)
int ret;
u8 i;
- if (rdma_node_get_transport(device->node_type) != RDMA_TRANSPORT_IB)
+ if (rdma_node_get_transport(ib_device->node_type) != RDMA_TRANSPORT_IB)
return;
cm_dev = kzalloc(sizeof(*cm_dev) + sizeof(*port) *
- device->phys_port_cnt, GFP_KERNEL);
+ ib_device->phys_port_cnt, GFP_KERNEL);
if (!cm_dev)
return;
- cm_dev->device = device;
+ cm_dev->ib_device = ib_device;
cm_get_ack_delay(cm_dev);
ret = kobject_init_and_add(&cm_dev->dev_obj, &cm_dev_obj_type,
- &cm_class.subsys.kobj, "%s", device->name);
+ &cm_class.subsys.kobj, "%s",
+ ib_device->name);
if (ret) {
kfree(cm_dev);
return;
}
set_bit(IB_MGMT_METHOD_SEND, reg_req.method_mask);
- for (i = 1; i <= device->phys_port_cnt; i++) {
+ for (i = 1; i <= ib_device->phys_port_cnt; i++) {
port = kzalloc(sizeof *port, GFP_KERNEL);
if (!port)
goto error1;
@@ -3723,7 +3724,7 @@ static void cm_add_one(struct ib_device *device)
if (ret)
goto error1;
- port->mad_agent = ib_register_mad_agent(device, i,
+ port->mad_agent = ib_register_mad_agent(ib_device, i,
IB_QPT_GSI,
®_req,
0,
@@ -3733,11 +3734,11 @@ static void cm_add_one(struct ib_device *device)
if (IS_ERR(port->mad_agent))
goto error2;
- ret = ib_modify_port(device, i, 0, &port_modify);
+ ret = ib_modify_port(ib_device, i, 0, &port_modify);
if (ret)
goto error3;
}
- ib_set_client_data(device, &cm_client, cm_dev);
+ ib_set_client_data(ib_device, &cm_client, cm_dev);
write_lock_irqsave(&cm.device_lock, flags);
list_add_tail(&cm_dev->list, &cm.device_list);
@@ -3753,14 +3754,14 @@ error1:
port_modify.clr_port_cap_mask = IB_PORT_CM_SUP;
while (--i) {
port = cm_dev->port[i-1];
- ib_modify_port(device, port->port_num, 0, &port_modify);
+ ib_modify_port(ib_device, port->port_num, 0, &port_modify);
ib_unregister_mad_agent(port->mad_agent);
cm_remove_port_fs(port);
}
kobject_put(&cm_dev->dev_obj);
}
-static void cm_remove_one(struct ib_device *device)
+static void cm_remove_one(struct ib_device *ib_device)
{
struct cm_device *cm_dev;
struct cm_port *port;
@@ -3770,7 +3771,7 @@ static void cm_remove_one(struct ib_device *device)
unsigned long flags;
int i;
- cm_dev = ib_get_client_data(device, &cm_client);
+ cm_dev = ib_get_client_data(ib_device, &cm_client);
if (!cm_dev)
return;
@@ -3778,9 +3779,9 @@ static void cm_remove_one(struct ib_device *device)
list_del(&cm_dev->list);
write_unlock_irqrestore(&cm.device_lock, flags);
- for (i = 1; i <= device->phys_port_cnt; i++) {
+ for (i = 1; i <= ib_device->phys_port_cnt; i++) {
port = cm_dev->port[i-1];
- ib_modify_port(device, port->port_num, 0, &port_modify);
+ ib_modify_port(ib_device, port->port_num, 0, &port_modify);
ib_unregister_mad_agent(port->mad_agent);
flush_workqueue(cm.wq);
cm_remove_port_fs(port);
--
1.5.6.3
next prev parent reply other threads:[~2008-07-22 5:35 UTC|newest]
Thread overview: 97+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-22 5:18 [GIT PATCH] driver core patches against 2.6.26 Greg KH
2008-07-22 5:18 ` [PATCH 01/79] sysfs: add /sys/dev/{char,block} to lookup sysfs path by major:minor Greg Kroah-Hartman
2008-07-22 5:18 ` [PATCH 02/79] kobject: replace '/' with '!' in name Greg Kroah-Hartman
2008-07-22 7:12 ` Kari Hurtta
2008-07-22 18:12 ` Ingo Oeser
2008-07-22 20:50 ` Greg KH
2008-07-22 23:25 ` [PATCH] kobject: Replace ALL occurrences of '/' with '!' instead of only the first one Ingo Oeser
2008-07-22 5:18 ` [PATCH 03/79] debugfs: Add a reference to the debugfs API documentation Greg Kroah-Hartman
2008-07-22 5:18 ` [PATCH 04/79] Firmware: fix typo in example code Greg Kroah-Hartman
2008-07-22 5:18 ` [PATCH 05/79] device create: block: convert device_create to device_create_drvdata Greg Kroah-Hartman
2008-07-22 5:18 ` [PATCH 06/79] device create: char: " Greg Kroah-Hartman
2008-07-22 5:18 ` [PATCH 07/79] device create: coda: " Greg Kroah-Hartman
2008-07-22 5:18 ` [PATCH 08/79] device create: dca: " Greg Kroah-Hartman
2008-07-22 5:18 ` [PATCH 09/79] device create: dvb: " Greg Kroah-Hartman
2008-07-22 5:18 ` [PATCH 10/79] device create: framebuffer: " Greg Kroah-Hartman
2008-07-22 5:18 ` [PATCH 11/79] device create: hid: " Greg Kroah-Hartman
2008-07-22 5:18 ` [PATCH 12/79] device create: hwmon: " Greg Kroah-Hartman
2008-07-22 5:18 ` [PATCH 13/79] device create: i2c: " Greg Kroah-Hartman
2008-07-22 5:18 ` [PATCH 14/79] device create: ide: " Greg Kroah-Hartman
2008-07-22 5:18 ` [PATCH 15/79] device create: ieee1394: " Greg Kroah-Hartman
2008-07-22 5:18 ` [PATCH 16/79] device create: infiniband: " Greg Kroah-Hartman
2008-07-22 5:18 ` [PATCH 17/79] device create: isdn: " Greg Kroah-Hartman
2008-07-22 5:18 ` [PATCH 18/79] device create: macintosh: " Greg Kroah-Hartman
2008-07-22 22:00 ` Benjamin Herrenschmidt
2008-07-22 5:18 ` [PATCH 19/79] device create: mips: " Greg Kroah-Hartman
2008-07-22 5:18 ` [PATCH 20/79] device create: misc: " Greg Kroah-Hartman
2008-07-22 5:18 ` [PATCH 21/79] device create: mtd: " Greg Kroah-Hartman
2008-07-22 5:18 ` [PATCH 22/79] device create: net: " Greg Kroah-Hartman
2008-07-22 5:18 ` [PATCH 23/79] device create: s390: " Greg Kroah-Hartman
2008-07-22 5:18 ` [PATCH 24/79] device create: scsi: " Greg Kroah-Hartman
2008-07-22 5:18 ` [PATCH 25/79] device create: sound: " Greg Kroah-Hartman
2008-07-22 5:18 ` [PATCH 26/79] device create: spi: " Greg Kroah-Hartman
2008-07-22 5:18 ` [PATCH 27/79] device create: usb: " Greg Kroah-Hartman
2008-07-22 5:18 ` [PATCH 28/79] device create: x86: " Greg Kroah-Hartman
2008-07-22 5:18 ` [PATCH 29/79] driver core: remove device_create() Greg Kroah-Hartman
2008-07-22 5:18 ` [PATCH 30/79] device create: convert device_create_drvdata to device_create Greg Kroah-Hartman
2008-07-22 5:18 ` [PATCH 31/79] Driver Core: add ability for class_for_each_device to start in middle of list Greg Kroah-Hartman
2008-07-22 5:18 ` [PATCH 32/79] Driver Core: add ability for class_find_device " Greg Kroah-Hartman
2008-07-22 5:18 ` [PATCH 33/79] block: fix compiler warning in genhd.c Greg Kroah-Hartman
2008-07-22 5:18 ` [PATCH 34/79] block: make printk_partition use the class iterator function Greg Kroah-Hartman
2008-07-22 5:18 ` [PATCH 35/79] block: make blk_lookup_devt " Greg Kroah-Hartman
2008-07-22 5:19 ` [PATCH 36/79] block: make /proc/diskstats only build if CONFIG_PROC_FS is enabled Greg Kroah-Hartman
2008-07-22 5:19 ` [PATCH 37/79] block: make proc files seq_start use the class_find_device() Greg Kroah-Hartman
2008-07-22 5:19 ` [PATCH 38/79] block: move header for /proc/partitions to seq_start Greg Kroah-Hartman
2008-07-22 5:19 ` [PATCH 39/79] block: make /proc/partitions and /proc/diskstats use class_find_device() Greg Kroah-Hartman
2008-07-22 5:19 ` Greg Kroah-Hartman [this message]
2008-07-22 5:19 ` [PATCH 41/79] infiniband: make cm_device use a struct device and not a kobject Greg Kroah-Hartman
2008-07-22 5:19 ` [PATCH 42/79] bluetooth: remove improper bluetooth class symlinks Greg Kroah-Hartman
2008-07-22 5:19 ` [PATCH 43/79] class: move driver core specific parts to a private structure Greg Kroah-Hartman
2008-07-22 5:19 ` [PATCH 44/79] class: rename "devices" to "class_devices" in internal class structure Greg Kroah-Hartman
2008-07-22 5:19 ` [PATCH 45/79] class: rename "interfaces" to "class_interfaces" " Greg Kroah-Hartman
2008-07-22 5:19 ` [PATCH 46/79] class: rename "subsys" to "class_subsys" " Greg Kroah-Hartman
2008-07-22 5:19 ` [PATCH 47/79] class: rename "sem" to "class_sem" " Greg Kroah-Hartman
2008-07-22 5:19 ` [PATCH 48/79] class: fix docbook comments for class_private structure Greg Kroah-Hartman
2008-07-22 5:19 ` [PATCH 49/79] class: add lockdep infrastructure Greg Kroah-Hartman
2008-07-22 5:19 ` [PATCH 50/79] class: change internal semaphore to a mutex Greg Kroah-Hartman
2008-07-22 5:19 ` [PATCH 51/79] driver core: remove KOBJ_NAME_LEN define Greg Kroah-Hartman
2008-07-22 5:19 ` [PATCH 52/79] driver core: remove DEVICE_NAME_SIZE define Greg Kroah-Hartman
2008-07-22 5:19 ` [PATCH 53/79] driver core: remove DEVICE_ID_SIZE define Greg Kroah-Hartman
2008-07-22 5:19 ` [PATCH 54/79] driver core: fix a lot of printk usages of bus_id Greg Kroah-Hartman
2008-07-22 5:19 ` [PATCH 55/79] pnp: add acpi:* modalias entries Greg Kroah-Hartman
2008-07-22 5:19 ` [PATCH 56/79] UIO: fix UIO Kconfig dependencies Greg Kroah-Hartman
2008-07-22 5:19 ` [PATCH 57/79] UIO: Add write function to allow irq masking Greg Kroah-Hartman
2008-07-22 5:19 ` [PATCH 58/79] UIO: add generic UIO platform driver Greg Kroah-Hartman
2008-07-22 11:34 ` Uwe Kleine-König
2008-07-22 17:13 ` Greg KH
2008-07-22 5:19 ` [PATCH 59/79] UIO: minor style and comment fixes Greg Kroah-Hartman
2008-07-22 5:19 ` [PATCH 60/79] kobject: reorder kobject to save space on 64 bit builds Greg Kroah-Hartman
2008-07-22 5:19 ` [PATCH 61/79] kobject: should use kobject_put() in kset-example Greg Kroah-Hartman
2008-07-22 5:19 ` [PATCH 62/79] sysdev: fix debugging statements in registration code Greg Kroah-Hartman
2008-07-22 5:19 ` [PATCH 63/79] sysfs: don't call notify_change Greg Kroah-Hartman
2008-07-22 5:19 ` [PATCH 64/79] uio-howto.tmpl: use standard copyright/legal markings Greg Kroah-Hartman
2008-07-22 5:19 ` [PATCH 65/79] uio-howto.tmpl: use unique output names Greg Kroah-Hartman
2008-07-22 5:19 ` [PATCH 66/79] always enable FW_LOADER unless EMBEDDED=y Greg Kroah-Hartman
2008-07-22 5:19 ` [PATCH 67/79] HOWTO: change email addresses of James in HOWTO Greg Kroah-Hartman
2008-07-22 5:19 ` [PATCH 68/79] debugfs: Implement debugfs_remove_recursive() Greg Kroah-Hartman
2008-07-22 5:19 ` [PATCH 69/79] sysfs-rules.txt: reword API stability statement Greg Kroah-Hartman
2008-07-22 5:19 ` [PATCH 70/79] kobject: Transmit return value of call_usermodehelper() to caller Greg Kroah-Hartman
2008-07-22 5:19 ` [PATCH 71/79] driver core: Suppress sysfs warnings for device_rename() Greg Kroah-Hartman
2008-07-22 5:19 ` [PATCH 72/79] sysdev: Pass the attribute to the low level sysdev show/store function Greg Kroah-Hartman
2008-07-22 20:40 ` Andrew Morton
2008-07-22 20:49 ` Greg KH
2008-07-22 21:03 ` Andrew Morton
2008-07-22 21:19 ` Greg KH
2008-07-23 3:04 ` Stephen Rothwell
2008-07-23 4:22 ` Greg KH
2008-07-23 9:03 ` Ingo Molnar
2008-07-23 14:03 ` Greg KH
2008-07-22 5:19 ` [PATCH 73/79] sysdev: Add utility functions for simple int/ulong variable sysdev attributes Greg Kroah-Hartman
2008-07-22 5:19 ` [PATCH 74/79] sysdev: Convert the x86 mce tolerant sysdev attribute to generic attribute Greg Kroah-Hartman
2008-07-22 5:19 ` [PATCH 75/79] HP iLO driver Greg Kroah-Hartman
2008-07-22 17:11 ` Altobelli, David
2008-07-22 17:16 ` Greg KH
2008-07-22 5:19 ` [PATCH 76/79] MTD: handle pci_name() being const Greg Kroah-Hartman
2008-07-22 5:19 ` [PATCH 77/79] 3c59x: " Greg Kroah-Hartman
2008-07-22 5:19 ` [PATCH 78/79] sparc64: fix up bus_id changes in sparc core code Greg Kroah-Hartman
2008-07-22 5:19 ` [PATCH 79/79] arm: bus_id -> dev_name() and dev_set_name() conversions Greg Kroah-Hartman
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=1216703983-21448-40-git-send-email-gregkh@suse.de \
--to=gregkh@suse.de \
--cc=hal.rosenstock@gmail.com \
--cc=kay.sievers@vrfy.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rolandd@cisco.com \
/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