Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3566211pxj; Mon, 21 Jun 2021 01:23:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJywHxf/yY2njw4oxhb0tMqaAqW3EAIeaZbLeSE8vlFe/cETGYfZOi4ojwmFLJwNbUOtofSB X-Received: by 2002:a92:a302:: with SMTP id a2mr17116296ili.184.1624263829933; Mon, 21 Jun 2021 01:23:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624263829; cv=none; d=google.com; s=arc-20160816; b=Y1dq0iU/Je827cTAd6Z4ylyxD2mF2ODnOcegk7/cc3Vu15S+yWwJCXqV6IDBKceZU2 aXto1Eu2B7duRKbJSK01oBIoLpvY4JLz/hZbmrpP1+o1sYGhISaceNNgOZ9qm26PZD9c xjCs1mzMeNv9gQ096ExLiqTUXb+tqDQ/MtyPflmEok1DPiu/JUhZrhC/Den6jKvEQi4k feVHrRjhn/+wQAmkavENqNAHIDWXCzKa7WDyDiqdRqnm65z58eNvHusEEfbUKeCj+Y7J k4yNk//Qi1xe/kl0W8dEBD/ZskyoC9r382MvHlzIDu120EkuN1rk4wQpVdRjyQZMYozK zbjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ZfnxSoMfUVSSDlsLwp0WoW5E9lvPUyllvrQ8/9x9fLo=; b=sHIWt92yaRc1QspAFhHZKXKL03zWnOS1RPU3nNDdskGqygqKgQkeAcdWYfOrJfGvAr 3RoakUhV7RX8l6cfpMFoRganqrZLbut1sTjsUlLjrz3Q+FasBixjXbLxjiaRQ0Jm9AM7 tKnA7YvqBVSkJFWZm/dq4Tvfs08L/bjjESfP/GCDeQRHF+d9kK/UrfQB2CYr0U5PLaN5 emRlj5GhEpIr3zLasBzDOi07yWD2H01kAdlgQyaupEj0db1o37aPnuhjNcdG+O490OGk OWrLn1CARcuG0bmevlTehHe3BZub1bPACD56/HFWnWcYaZYhsDVv8nyE+4d2/BGafefU l1qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Pq1hHK9R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d6si7936964jam.40.2021.06.21.01.23.38; Mon, 21 Jun 2021 01:23:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Pq1hHK9R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230225AbhFUIY5 (ORCPT + 99 others); Mon, 21 Jun 2021 04:24:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229789AbhFUIY4 (ORCPT ); Mon, 21 Jun 2021 04:24:56 -0400 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14F81C061574 for ; Mon, 21 Jun 2021 01:22:42 -0700 (PDT) Received: by mail-pl1-x635.google.com with SMTP id v12so8125372plo.10 for ; Mon, 21 Jun 2021 01:22:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=ZfnxSoMfUVSSDlsLwp0WoW5E9lvPUyllvrQ8/9x9fLo=; b=Pq1hHK9RJgIPikajvGj85KADiwQEuKLSL5C/+AGosMjMpAuewjq3kPtHYvFliErquW Dy/C5wsHTujMyiVG705Dk14Pq40bu6NT/A+ICipcaIZ/D3OMovB1P2UUohN7CQHmYOKX hXz1gu6jk0HJAjW1XXt4efahnR9klmCmyuyX1cnyb5WpVbaJZfEqKCGY0ttXE/ESYPHg zipKK1RE3mCkmWfqVE3hJhArk9N4mwqPMG3ABYfybgsW68T7wYsRoyEhnKGuX4HabAKU MRGyZ/ZU0i4A/NhPhh75WEdCNzt0jE6FUham0iQH5/v9yMYzydQ740bMvEtw6yKJe/nj Z+EQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ZfnxSoMfUVSSDlsLwp0WoW5E9lvPUyllvrQ8/9x9fLo=; b=R6NeU1DqDcUnMspoycHa7XPD9HHlT/6lOusOVQa4B2V2UA7easxX47lwjH1P6NcQXX L2Sm55s8i0TgtRRamL/DLuipCVp6G/HKE7X01whnVl2Im9VuXsZK0klDhRU5eH/7t59l qjyXGgWBBEr9IectQ8mQrwxNF+zOcl+AlxHG5Bb1IW7xsAI+8hV3cifgA0lw9bwIKQn6 xV0cLKLGrapqbwPxVPkl4ZUaRdYd4bzmx2E1D2W9vYwiUv3+oofFHIEOdIyLL7rt0ASO tgSddbLxYhqXHw7k0HKZdg3yalTh6/fhBei8LIdanCU2SgiZETYFyZGWHU8Ut3qzAFmh 5iow== X-Gm-Message-State: AOAM533iD7KJ989+vpUzSeEjRiV0hRz4MrCJMHfrTeVm5LJJI4hMKzyq H1W3wsFZ3p8KSXLjazosh7c= X-Received: by 2002:a17:902:d645:b029:11d:d075:cf43 with SMTP id y5-20020a170902d645b029011dd075cf43mr16832526plh.14.1624263761549; Mon, 21 Jun 2021 01:22:41 -0700 (PDT) Received: from gmail.com (36-229-229-123.dynamic-ip.hinet.net. [36.229.229.123]) by smtp.gmail.com with ESMTPSA id z18sm14128683pfe.214.2021.06.21.01.22.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Jun 2021 01:22:40 -0700 (PDT) Date: Mon, 21 Jun 2021 16:22:37 +0800 From: Jhih-Ming Huang To: Greg KH Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [fbihjmeric@gmail.com: Re: drivers/staging/rtl8723bs/core/rtw_security.c:95:9: warning: variable 'crc' set but not used] Message-ID: <20210621082237.im2asbiyc65kyzol@gmail.com> References: <20210621063041.v4u35pxgglgwn2go@gmail.com> <20210621065709.6ffzqujlt26evjjz@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 21, 2021 at 10:10:27AM +0200, Greg KH wrote: > On Mon, Jun 21, 2021 at 02:57:09PM +0800, Jhih-Ming Huang wrote: > > On Mon, Jun 21, 2021 at 08:52:24AM +0200, Greg KH wrote: > > > On Mon, Jun 21, 2021 at 02:30:41PM +0800, Jhih-Ming Huang wrote: > > > > On Sat, Jun 19, 2021 at 6:27 PM kernel test robot wrote: > > > > > > > > > > tree: https://github.com/0day-ci/linux/commits/UPDATE-20210619-155350/Jhih-Ming-Huang/rtw_security-fix-cast-to-restricted-__le32/20210616-131056 > > > > > head: ed0359e3fa64928e48021387a694f211bc840ff7 > > > > > commit: ed0359e3fa64928e48021387a694f211bc840ff7 rtw_security: fix cast to restricted __le32 > > > > > date: 3 hours ago > > > > > config: sh-allmodconfig (attached as .config) > > > > > compiler: sh4-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 > > > > > # https://github.com/0day-ci/linux/commit/ed0359e3fa64928e48021387a694f211bc840ff7 > > > > > git remote add linux-review https://github.com/0day-ci/linux > > > > > git fetch --no-tags linux-review UPDATE-20210619-155350/Jhih-Ming-Huang/rtw_security-fix-cast-to-restricted-__le32/20210616-131056 > > > > > git checkout ed0359e3fa64928e48021387a694f211bc840ff7 > > > > > # save the attached .config to linux build tree > > > > > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=sh > > > > > > > > > > If you fix the issue, kindly add following tag as appropriate > > > > > Reported-by: kernel test robot > > > > > > > > > > All warnings (new ones prefixed by >>): > > > > > > > > > > drivers/staging/rtl8723bs/core/rtw_security.c: In function 'rtw_wep_decrypt': > > > > > >> drivers/staging/rtl8723bs/core/rtw_security.c:95:9: warning: variable 'crc' set but not used [-Wunused-but-set-variable] > > > > > 95 | __le32 crc; > > > > > | ^~~ > > > > > > > > > > Kconfig warnings: (for reference only) > > > > > WARNING: unmet direct dependencies detected for SND_ATMEL_SOC_PDC > > > > > Depends on SOUND && !UML && SND && SND_SOC && SND_ATMEL_SOC && HAS_DMA > > > > > Selected by > > > > > - SND_ATMEL_SOC_SSC && SOUND && !UML && SND && SND_SOC && SND_ATMEL_SOC > > > > > - SND_ATMEL_SOC_SSC_PDC && SOUND && !UML && SND && SND_SOC && SND_ATMEL_SOC && ATMEL_SSC > > > > > > > > > > > > > > > vim +/crc +95 drivers/staging/rtl8723bs/core/rtw_security.c > > > > > > > > > > 91 > > > > > 92 void rtw_wep_decrypt(struct adapter *padapter, u8 *precvframe) > > > > > 93 { > > > > > 94 /* exclude ICV */ > > > > > > 95 __le32 crc; > > > > > 96 signed int length; > > > > > 97 u32 keylength; > > > > > 98 u8 *pframe, *payload, *iv, wepkey[16]; > > > > > 99 u8 keyindex; > > > > > 100 struct rx_pkt_attrib *prxattrib = &(((union recv_frame *)precvframe)->u.hdr.attrib); > > > > > 101 struct security_priv *psecuritypriv = &padapter->securitypriv; > > > > > 102 struct arc4_ctx *ctx = &psecuritypriv->recv_arc4_ctx; > > > > > 103 > > > > > 104 pframe = (unsigned char *)((union recv_frame *)precvframe)->u.hdr.rx_data; > > > > > 105 > > > > > 106 /* start to decrypt recvframe */ > > > > > 107 if ((prxattrib->encrypt == _WEP40_) || (prxattrib->encrypt == _WEP104_)) { > > > > > 108 iv = pframe+prxattrib->hdrlen; > > > > > 109 /* keyindex =(iv[3]&0x3); */ > > > > > 110 keyindex = prxattrib->key_index; > > > > > 111 keylength = psecuritypriv->dot11DefKeylen[keyindex]; > > > > > 112 memcpy(&wepkey[0], iv, 3); > > > > > 113 /* memcpy(&wepkey[3], &psecuritypriv->dot11DefKey[psecuritypriv->dot11PrivacyKeyIndex].skey[0], keylength); */ > > > > > 114 memcpy(&wepkey[3], &psecuritypriv->dot11DefKey[keyindex].skey[0], keylength); > > > > > 115 length = ((union recv_frame *)precvframe)->u.hdr.len-prxattrib->hdrlen-prxattrib->iv_len; > > > > > 116 > > > > > 117 payload = pframe+prxattrib->iv_len+prxattrib->hdrlen; > > > > > 118 > > > > > 119 /* decrypt payload include icv */ > > > > > 120 arc4_setkey(ctx, wepkey, 3 + keylength); > > > > > 121 arc4_crypt(ctx, payload, payload, length); > > > > > 122 > > > > > 123 /* calculate icv and compare the icv */ > > > > > 124 crc = cpu_to_le32(~crc32_le(~0, payload, length - 4)); > > > > > 125 > > > > > 126 } > > > > > 127 } > > > > > 128 > > > > > > > > > > --- > > > > > 0-DAY CI Kernel Test Service, Intel Corporation > > > > > https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org > > > > > > > > This warning was introduced by my pull request, > > > > but I am fixing the sparse warning and the unused variable was > > > > declared in the previous commit. > > > > The original author did not compare the crc and payload in > > > > rtw_wep_decrypt, so the variable 'crc' was set but not used. > > > > > > > > Should I fix this in my pull request? > > > > > > We do not do "pull requests" in the kernel development process for > > > normal changes. Just send a patch like normal for this and I will be > > > glad to apply it to my trees and send it onward. > > > > > > thanks, > > > > > > greg k-h > > > > thanks for your fast reply. > > > > should I send the other patch based on my original patch or I should combine > > these two patches into one patch? > > What ever will be able to be applied to my tree is what I need. I can > not remove an existing patch from it. If I have not accepted the patch, > then a new patch is required. > > thanks, > > greg k-h got it. new patch is sent. thanks. --jmhuang