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

From: kernel test robot
Date: Sun Sep 06 2020 - 19:44:12 EST


Hi Rohit,

FYI, the error/warning still remains.

tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: a8205e310011f09cc73cd577d7b0074c57b9bb54
commit: 76d7728db724466490c2c3dd4f84c3357f550615 crypto/chcr: IPV6 code needs to be in CONFIG_IPV6
date: 3 months ago
config: alpha-randconfig-r013-20200907 (attached as .config)
compiler: alpha-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=alpha

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

All warnings (new ones prefixed by >>):

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;
| ^~

# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=76d7728db724466490c2c3dd4f84c3357f550615
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 76d7728db724466490c2c3dd4f84c3357f550615
vim +/sk +391 drivers/crypto/chelsio/chcr_ktls.c

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