drivers/crypto/chelsio/chcr_ktls.c:391:15: warning: variable 'sk' set but not used

From: kernel test robot
Date: Thu Aug 13 2020 - 18:19:27 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: dddcbc139e96bd18d8c65ef7b7e440f0d32457c2
commit: 76d7728db724466490c2c3dd4f84c3357f550615 crypto/chcr: IPV6 code needs to be in CONFIG_IPV6
date: 2 months ago
config: ia64-randconfig-r033-20200814 (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 76d7728db724466490c2c3dd4f84c3357f550615
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

In file included from arch/ia64/include/asm/pgtable.h:154,
from arch/ia64/include/asm/uaccess.h:40,
from include/linux/uaccess.h:11,
from include/linux/sched/task.h:11,
from include/linux/sched/signal.h:9,
from include/linux/rcuwait.h:6,
from include/linux/percpu-rwsem.h:7,
from include/linux/fs.h:34,
from include/linux/highmem.h:5,
from drivers/crypto/chelsio/chcr_ktls.c:5:
arch/ia64/include/asm/mmu_context.h: In function 'reload_context':
arch/ia64/include/asm/mmu_context.h:137:41: warning: variable 'old_rr4' set but not used [-Wunused-but-set-variable]
137 | unsigned long rr0, rr1, rr2, rr3, rr4, old_rr4;
| ^~~~~~~
drivers/crypto/chelsio/chcr_ktls.c: In function 'chcr_ktls_dev_del':
>> drivers/crypto/chelsio/chcr_ktls.c:391:15: warning: variable 'sk' set but not used [-Wunused-but-set-variable]
391 | struct sock *sk;
| ^~

vim +/sk +391 drivers/crypto/chelsio/chcr_ktls.c

34aba2c45024a08 Rohit Maheshwari 2020-03-07 375
34aba2c45024a08 Rohit Maheshwari 2020-03-07 376 /*
34aba2c45024a08 Rohit Maheshwari 2020-03-07 377 * chcr_ktls_dev_del: call back for tls_dev_del.
34aba2c45024a08 Rohit Maheshwari 2020-03-07 378 * Remove the tid and l2t entry and close the connection.
34aba2c45024a08 Rohit Maheshwari 2020-03-07 379 * it per connection basis.
34aba2c45024a08 Rohit Maheshwari 2020-03-07 380 * @netdev - net device.
34aba2c45024a08 Rohit Maheshwari 2020-03-07 381 * @tls_cts - tls context.
34aba2c45024a08 Rohit Maheshwari 2020-03-07 382 * @direction - TX/RX crypto direction
34aba2c45024a08 Rohit Maheshwari 2020-03-07 383 */
a3ac249a1ab5755 Rohit Maheshwari 2020-06-01 384 void chcr_ktls_dev_del(struct net_device *netdev,
34aba2c45024a08 Rohit Maheshwari 2020-03-07 385 struct tls_context *tls_ctx,
34aba2c45024a08 Rohit Maheshwari 2020-03-07 386 enum tls_offload_ctx_dir direction)
34aba2c45024a08 Rohit Maheshwari 2020-03-07 387 {
34aba2c45024a08 Rohit Maheshwari 2020-03-07 388 struct chcr_ktls_ofld_ctx_tx *tx_ctx =
34aba2c45024a08 Rohit Maheshwari 2020-03-07 389 chcr_get_ktls_tx_context(tls_ctx);
34aba2c45024a08 Rohit Maheshwari 2020-03-07 390 struct chcr_ktls_info *tx_info = tx_ctx->chcr_info;
62370a4f346dda9 Rohit Maheshwari 2020-03-07 @391 struct sock *sk;
34aba2c45024a08 Rohit Maheshwari 2020-03-07 392
34aba2c45024a08 Rohit Maheshwari 2020-03-07 393 if (!tx_info)
34aba2c45024a08 Rohit Maheshwari 2020-03-07 394 return;
62370a4f346dda9 Rohit Maheshwari 2020-03-07 395 sk = tx_info->sk;
34aba2c45024a08 Rohit Maheshwari 2020-03-07 396
34aba2c45024a08 Rohit Maheshwari 2020-03-07 397 spin_lock(&tx_info->lock);
34aba2c45024a08 Rohit Maheshwari 2020-03-07 398 tx_info->connection_state = KTLS_CONN_CLOSED;
34aba2c45024a08 Rohit Maheshwari 2020-03-07 399 spin_unlock(&tx_info->lock);
34aba2c45024a08 Rohit Maheshwari 2020-03-07 400
62370a4f346dda9 Rohit Maheshwari 2020-03-07 401 /* clear l2t entry */
34aba2c45024a08 Rohit Maheshwari 2020-03-07 402 if (tx_info->l2te)
34aba2c45024a08 Rohit Maheshwari 2020-03-07 403 cxgb4_l2t_release(tx_info->l2te);
34aba2c45024a08 Rohit Maheshwari 2020-03-07 404

:::::: The code at line 391 was first introduced by commit
:::::: 62370a4f346dda9a7026445016db5f8eddd533a5 cxgb4/chcr: Add ipv6 support and statistics

:::::: TO: Rohit Maheshwari <rohitm@xxxxxxxxxxx>
:::::: CC: David S. Miller <davem@xxxxxxxxxxxxx>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip