Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3519056pxj; Sun, 20 Jun 2021 23:57:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSAVQLgm5sQTCtomZZzMlbFpIl6xoATW3ARg6YhGN4fTpSBIeOvAbHKp/+G084iaUUKYh8 X-Received: by 2002:a05:6638:380b:: with SMTP id i11mr1422561jav.57.1624258678184; Sun, 20 Jun 2021 23:57:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624258678; cv=none; d=google.com; s=arc-20160816; b=ZmDq1bI8ebeJEZBqSV4Qnkzx6+4KRpzM45847ukrsRGzBMFQg7tnolH8ErRW6pyT7M QQ4Detj8DMCEl/MW8Rsp9YhYCX1WsQgcCQA/lbsW8DpZwcr6jhk5pMtZ9bPirilKstnG 8/lHJ9eH/jckLuRZQfHhbuJxDM7Ew6uU9ioTzDM+EjrygXBIPctz2gqXae7+H073wEtT 9Zj18bEKY+cQ0tyQGPs9FrdzAL2XCss1KOU576bcLECcQKQGToveJfV9QXYSYaPzz8G4 tL4zFom7JuscSnxkZ6mD2lfrphA/70qMBRc0MLS8etCt0nEHCT6/258NaZIcEqV82JgZ oCSg== 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=LWzeXBLwSTCoqSbunlzVfzKA94bfHLT2m1zWj9xVhaQ=; b=WHJ/qxnVQLOJtgtjmf9fsLmRfcRf8sIDQ1J/661fVHUdcRdR8JSQu1PZcEX/uPIf4f xJnkjrUMCtL1OvO2lG/dPhCs7jLqfT/D6nSJtYnO0ZmK6Q5O30HczaLxFQLEEZVFpIy6 K37fGKo8lYs76hK/jDf7A6zDnzOfr76cm5pMCpTr+PFNSIGL+eTG/524I4CwAzrUEMJY UBH4KiKkGLMIzxbzMeYQljBOA6TLuPmq9VZwOCjvyp7LCH+aed1OsBU02Y2psqyjOL+S NtrhJAM7CtwFPc0WZjmF6kFDCeFeldyHtIdpLqB+j9cBiwDhTLFn6AeAq1o88WtDdp1v 2VlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PLXnUJEw; 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 e3si17585446iom.57.2021.06.20.23.57.46; Sun, 20 Jun 2021 23:57:58 -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=PLXnUJEw; 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 S229621AbhFUG7b (ORCPT + 99 others); Mon, 21 Jun 2021 02:59:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229506AbhFUG73 (ORCPT ); Mon, 21 Jun 2021 02:59:29 -0400 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88FC9C061574 for ; Sun, 20 Jun 2021 23:57:14 -0700 (PDT) Received: by mail-pl1-x631.google.com with SMTP id x22so6463207pll.11 for ; Sun, 20 Jun 2021 23:57:14 -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=LWzeXBLwSTCoqSbunlzVfzKA94bfHLT2m1zWj9xVhaQ=; b=PLXnUJEwAiNioRGRcJQ13pejdr7S9wozwiZA45+n2hNMJdgQI+vb6ncq6o+YwP9kc4 A3cGBIhbRHqu/S681fA8sNSv82vLSOkaU6TyxFZCGC5uFV9pgzFToCtl13TozkwHsHk0 bVUGHytplB+9wMYRcV7Jp9kjO3lg/gKm0a2U7usWhUyyawH+jJ5cHf85GF2Zmshn9R1C Jb56muiQmCXg9qvAjeAjXHPNdu/NUKfwWb/p04tkE6pdz7dwGMBFs3TeUSZBekuxOnlS XF1svtLt38jw8BUzrmnwnWHcBoLA/I0xbpYEPx3l5+zbEyA7FmIo4tDMB2E1IBniUaGu eV+w== 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=LWzeXBLwSTCoqSbunlzVfzKA94bfHLT2m1zWj9xVhaQ=; b=RPj3/acq3E+ci3BeLQQjFj4e5y4181VBAJj6fzHQeNUrzarLkqUihkegrev8UGXykd 54SjFyfb1bOo3Qjc2OZJuaM7yYQL6929M9Dw5wsxN6weDBLB5PIYVq5LabgXX/vEO5aR YOLjj7jGUN4N0irKSEnN7UQ8L+HMg3J2rpFENnhgcGPxohJVxj9JM2ko0iY/R/huX7S/ 2F/7K1lVbEmN6iX+sR/aF731nxax5g6nbITv0VI6E+QmihoSBu4Nm5gWHk03FVib5eoy RK8qNgEGeNFuJHk3k44tCg6/SxEXu3DqD4OkQ+GqDPZDXxC93WMh9DNgnBMkPpJbet/V iI/A== X-Gm-Message-State: AOAM532OPD9HZiXqnuMAGN4fSjqYiV+/uNrYpwRzcSsKGS+2on/YseGD E5Tn1KBJANC1oKYYN7nFfTr+iJPdAoDDlQ== X-Received: by 2002:a17:90b:10e:: with SMTP id p14mr19507729pjz.153.1624258633835; Sun, 20 Jun 2021 23:57:13 -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 d6sm15516485pgq.88.2021.06.20.23.57.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Jun 2021 23:57:13 -0700 (PDT) Date: Mon, 21 Jun 2021 14:57:09 +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: <20210621065709.6ffzqujlt26evjjz@gmail.com> References: <20210621063041.v4u35pxgglgwn2go@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 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? thanks. --jmhuang