Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

RDMA/core: Remove unused ib_find_exact_cached_pkey

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>

authored by

Dr. David Alan Gilbert and committed by
Leon Romanovsky
ddc8fab4 30dd62fa

-51
-35
drivers/infiniband/core/cache.c
··· 1127 1127 } 1128 1128 EXPORT_SYMBOL(ib_find_cached_pkey); 1129 1129 1130 - int ib_find_exact_cached_pkey(struct ib_device *device, u32 port_num, 1131 - u16 pkey, u16 *index) 1132 - { 1133 - struct ib_pkey_cache *cache; 1134 - unsigned long flags; 1135 - int i; 1136 - int ret = -ENOENT; 1137 - 1138 - if (!rdma_is_port_valid(device, port_num)) 1139 - return -EINVAL; 1140 - 1141 - read_lock_irqsave(&device->cache_lock, flags); 1142 - 1143 - cache = device->port_data[port_num].cache.pkey; 1144 - if (!cache) { 1145 - ret = -EINVAL; 1146 - goto err; 1147 - } 1148 - 1149 - *index = -1; 1150 - 1151 - for (i = 0; i < cache->table_len; ++i) 1152 - if (cache->table[i] == pkey) { 1153 - *index = i; 1154 - ret = 0; 1155 - break; 1156 - } 1157 - 1158 - err: 1159 - read_unlock_irqrestore(&device->cache_lock, flags); 1160 - 1161 - return ret; 1162 - } 1163 - EXPORT_SYMBOL(ib_find_exact_cached_pkey); 1164 - 1165 1130 int ib_get_cached_lmc(struct ib_device *device, u32 port_num, u8 *lmc) 1166 1131 { 1167 1132 unsigned long flags;
-16
include/rdma/ib_cache.h
··· 64 64 u16 *index); 65 65 66 66 /** 67 - * ib_find_exact_cached_pkey - Returns the PKey table index where a specified 68 - * PKey value occurs. Comparison uses the FULL 16 bits (incl membership bit) 69 - * @device: The device to query. 70 - * @port_num: The port number of the device to search for the PKey. 71 - * @pkey: The PKey value to search for. 72 - * @index: The index into the cached PKey table where the PKey was found. 73 - * 74 - * ib_find_exact_cached_pkey() searches the specified PKey table in 75 - * the local software cache. 76 - */ 77 - int ib_find_exact_cached_pkey(struct ib_device *device, 78 - u32 port_num, 79 - u16 pkey, 80 - u16 *index); 81 - 82 - /** 83 67 * ib_get_cached_lmc - Returns a cached lmc table entry 84 68 * @device: The device to query. 85 69 * @port_num: The port number of the device to query.