RDMA/core: Remove unused ib_find_exact_cached_pkey
authorDr. David Alan Gilbert <linux@treblig.org>
Sat, 21 Dec 2024 01:40:19 +0000 (01:40 +0000)
committerLeon Romanovsky <leon@kernel.org>
Tue, 24 Dec 2024 10:00:42 +0000 (05:00 -0500)
The last use of ib_find_exact_cached_pkey() was removed in 2012
by commit 2c75d2ccb6e5 ("IB/mlx4: Fix QP1 P_Key processing in the Primary
Physical Function (PPF)")

Remove it.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Link: https://patch.msgid.link/20241221014021.343979-3-linux@treblig.org
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/core/cache.c
include/rdma/ib_cache.h

index b7c078b7f7cfd4881731613c7bdf215e82242a9d..f8413f8a9f26fcb00b07b387f0dbea658b00b80b 100644 (file)
@@ -1127,41 +1127,6 @@ err:
 }
 EXPORT_SYMBOL(ib_find_cached_pkey);
 
-int ib_find_exact_cached_pkey(struct ib_device *device, u32 port_num,
-                             u16 pkey, u16 *index)
-{
-       struct ib_pkey_cache *cache;
-       unsigned long flags;
-       int i;
-       int ret = -ENOENT;
-
-       if (!rdma_is_port_valid(device, port_num))
-               return -EINVAL;
-
-       read_lock_irqsave(&device->cache_lock, flags);
-
-       cache = device->port_data[port_num].cache.pkey;
-       if (!cache) {
-               ret = -EINVAL;
-               goto err;
-       }
-
-       *index = -1;
-
-       for (i = 0; i < cache->table_len; ++i)
-               if (cache->table[i] == pkey) {
-                       *index = i;
-                       ret = 0;
-                       break;
-               }
-
-err:
-       read_unlock_irqrestore(&device->cache_lock, flags);
-
-       return ret;
-}
-EXPORT_SYMBOL(ib_find_exact_cached_pkey);
-
 int ib_get_cached_lmc(struct ib_device *device, u32 port_num, u8 *lmc)
 {
        unsigned long flags;
index 226ae3702d8a8e8ebd05e5cab9ceece3209a82b8..2bf09b594d10f85bccf26303af0a2ce096390c3c 100644 (file)
@@ -63,22 +63,6 @@ int ib_find_cached_pkey(struct ib_device    *device,
                        u16                  pkey,
                        u16                 *index);
 
-/**
- * ib_find_exact_cached_pkey - Returns the PKey table index where a specified
- *   PKey value occurs. Comparison uses the FULL 16 bits (incl membership bit)
- * @device: The device to query.
- * @port_num: The port number of the device to search for the PKey.
- * @pkey: The PKey value to search for.
- * @index: The index into the cached PKey table where the PKey was found.
- *
- * ib_find_exact_cached_pkey() searches the specified PKey table in
- * the local software cache.
- */
-int ib_find_exact_cached_pkey(struct ib_device    *device,
-                             u32                  port_num,
-                             u16                  pkey,
-                             u16                 *index);
-
 /**
  * ib_get_cached_lmc - Returns a cached lmc table entry
  * @device: The device to query.