summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@mellanox.co.il>2005-09-01 09:19:44 -0700
committerRoland Dreier <rolandd@cisco.com>2005-09-07 09:48:52 -0700
commit1d6801f9dd3ebb054ae685153a01b1a4ec817f46 (patch)
tree2f3e72b292c9ac04cec776fbb60cdec1c4269f24 /drivers/infiniband/core
parent06c56e44f3e32a859420ecac97996cc6f12827bb (diff)
downloadblackbird-op-linux-1d6801f9dd3ebb054ae685153a01b1a4ec817f46.tar.gz
blackbird-op-linux-1d6801f9dd3ebb054ae685153a01b1a4ec817f46.zip
[PATCH] IB/sa_query: avoid unnecessary list scan
Using ib_get_client_data in SA event handler performs a list scan. It's better to use container_of to get the sa device directly. Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/core')
-rw-r--r--drivers/infiniband/core/sa_query.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/infiniband/core/sa_query.c b/drivers/infiniband/core/sa_query.c
index 126ac80db7b8..9191793c9007 100644
--- a/drivers/infiniband/core/sa_query.c
+++ b/drivers/infiniband/core/sa_query.c
@@ -431,8 +431,8 @@ static void ib_sa_event(struct ib_event_handler *handler, struct ib_event *event
event->event == IB_EVENT_LID_CHANGE ||
event->event == IB_EVENT_PKEY_CHANGE ||
event->event == IB_EVENT_SM_CHANGE) {
- struct ib_sa_device *sa_dev =
- ib_get_client_data(event->device, &sa_client);
+ struct ib_sa_device *sa_dev;
+ sa_dev = container_of(handler, typeof(*sa_dev), event_handler);
schedule_work(&sa_dev->port[event->element.port_num -
sa_dev->start_port].update_task);
OpenPOWER on IntegriCloud