Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp209914ybl; Wed, 21 Aug 2019 17:47:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqyeMg5pwCEmbxOSqML3SyX5uaJ2rip0dr2WiwQLPDuflDGCtk3wKDMFXjXqjW206/BU++uP X-Received: by 2002:a17:90a:b894:: with SMTP id o20mr2741952pjr.41.1566434854619; Wed, 21 Aug 2019 17:47:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566434854; cv=none; d=google.com; s=arc-20160816; b=ESah1GIBd8Cad9EWWX5Vji0Z71km1z4CnxcBlbdbVIZzkBCT5tWKZVKOKnTWS9gFMg 7OwIGA3honDThz1lvkBxs9CBfHjDE9icjAkcT3YsxdsRw8UFxTDr+L1p/h1GgNnZcNTA /KpK0LQtx/qivP5Kj7auDf7p5RoNXqWkfHHJRBmdBMvA8HamIkk/q4aeJp9BQR3xW42A W2WVq6s6Ti6zy69a4wIOSh9b8HZGZMFpux9tM/J9UZb+3QX+Xtm8kNTBrenYIx02UDer KRGeaeKjCUcUmB04GNfwsUgdeCkK3yW3aRjK/0hcqViAxr++1vrIaUwP6Ck5g9xQ/FwN qGaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=iSHHiSeXHjHzBDkI8d7z6wDG8MJ+Uw8ooirR+HwYa/s=; b=C6HOl7+QSJieAqwa9sqVBRDvl5luTiARQdi3SZKInCWkpIRyfTLm9CfOqkfLTsAGK+ Id092en7lJd/SycaBeEQWBMLVMU8gxhh3yTDdCzt4ozcEySeLR2CWRvYcrad2MJi1Z/1 dwiHdmw6ZtotWieE7Dg0dSpns1/wiO/yP0UyrVqt0Rp550OcI64iNBlPuIdsM4yKWTn8 evOkWuuZqfvZAannUpAUmGqjA4I3E2GioqQPEaeVcU+tntAjeGxgTscDQpKqF5gPjWtx q+cHTYSbRjcalKpWqdC/HLOYCMRyx1IwlXaI0ddbelyE3mLK05g5V7fUoIJnov1VziEN 2EeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Op0ZTlKc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y1si15924921plp.204.2019.08.21.17.47.12; Wed, 21 Aug 2019 17:47:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Op0ZTlKc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728955AbfHUUzd (ORCPT + 99 others); Wed, 21 Aug 2019 16:55:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:48054 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726998AbfHUUzd (ORCPT ); Wed, 21 Aug 2019 16:55:33 -0400 Received: from localhost (wsip-184-188-36-2.sd.sd.cox.net [184.188.36.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EBC4E22CF7; Wed, 21 Aug 2019 20:55:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566420932; bh=3N06S7d+IJH7fPcRuLFfhOA0WbN6iEVHSUEKzhUzAFw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Op0ZTlKcQ72uPdMScK1pmE2ol9RArOow9WNasYr/64DCACbauO36mqWDk3iXoHlAp o2KArwFsS+X1aoDsVU5Dh3+T0ztd+dbqfJOPuN6Q6wQ03QK4YTgyvNawohH8pDEe7I JNVuPjfYpIi+AKrbyigMwNEKXcxJQbjK3xpgb5Lc= Date: Wed, 21 Aug 2019 13:55:31 -0700 From: Greg Kroah-Hartman To: Colin Ian King Cc: Jerry Chuang , John Whitmore , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: Added Realtek rtl8192u driver to staging - static analysis report. Message-ID: <20190821205531.GC17415@kroah.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 21, 2019 at 07:18:39PM +0100, Colin Ian King wrote: > Hi, > > Static analysis of linux-next picked up an issue with the following commit: > > commit 8fc8598e61f6f384f3eaf1d9b09500c12af47b37 > Author: Jerry Chuang > Date: Tue Nov 3 07:17:11 2009 -0200 > > Staging: Added Realtek rtl8192u driver to staging > > In drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c we have: > > CID 48331 (#1 of 1): Unused value (UNUSED_VALUE) assigned_pointer > > Assigning value from ieee->crypt[ieee->tx_keyidx] to crypt here, but > that stored value is not used. > > 746 crypt = ieee->crypt[ieee->tx_keyidx]; > 747 if (encrypt) > 748 beacon_buf->capability |= > cpu_to_le16(WLAN_CAPABILITY_PRIVACY); > > Pointer crypt is being assigned but is never used afterwards. Now > either this is a redundant assignment and can be removed OR maybe crypt > should be checked and there is a typo, e.g.: > > crypt = ieee->crypt[ieee->tx_keyidx]; > if (crypt) > ... > > Either way, it's not clear to me and I think the code needs cleaning up. > Any ideas? 10+ year old code, yeah!!! Just guess, who knows, no one seems to care :( greg k-h