From patchwork Tue Oct 4 07:52:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Usama Anjum X-Patchwork-Id: 12997980 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CCC54C4332F for ; Tue, 4 Oct 2022 07:52:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229854AbiJDHwt (ORCPT ); Tue, 4 Oct 2022 03:52:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229643AbiJDHwr (ORCPT ); Tue, 4 Oct 2022 03:52:47 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6ED412B629; Tue, 4 Oct 2022 00:52:46 -0700 (PDT) Received: from [192.168.10.9] (unknown [39.45.148.204]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: usama.anjum) by madras.collabora.co.uk (Postfix) with ESMTPSA id 01F2D6602294; Tue, 4 Oct 2022 08:52:42 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1664869964; bh=R6l9T5BM52dcR1rvtAnSOR0sTeiXruJN2cxHdJAe5ZY=; h=Date:Cc:To:From:Subject:From; b=CkBj9peD5/eQeSHFXfLAg/YLU/jvMp4CukTv+9PnxQpjqFUwXRkWWUMmXzvVma8cb Oa9tRZOjBQGdgRkIkDekKrU4ttcqMxz+C3oInmjV49bq+OJPZht98sLxBFfdi7j+uZ tcizwg1nkwuLyUEd1mzlCAI8LvWZH9Gmq8xZD0Oay/4GPNwcvBY2kMbjyD+uZwRUI3 l9oVdntpezgHbu0iWtGr++TJoY5R7PmjoI0RCR/9ASfOB8PVWkW43des2E+Z9F1w0P k61e+iUcci6hhEo8kLXZg3gfhrLZJd/6iVVgbk6CpRaB9L9gdfS3QOYym/KjlA9Vhd 5iENahn47BRHg== Message-ID: <28270724-1c20-5b28-e5cf-ffe29a85ce4c@collabora.com> Date: Tue, 4 Oct 2022 12:52:38 +0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 Cc: usama.anjum@collabora.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, Collabora Kernel ML , kernel-janitors Content-Language: en-US To: =?utf-8?q?Tomislav_Po=C5=BEega?= , Daniel Golle , Kalle Valo From: Muhammad Usama Anjum Subject: [Bug report] Probably variable is being overwritten Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Hi, A bit in rfb0r1 is being cleared and result is stored in rfval. Then the first bit is being set without reusing the rfval. It is probably bug or dead code? The same pattern can be seen repeated below as well. rfval = rfb0r2 | 0x11; diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c index cbbb1a4849cf..4857e3818418 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c @@ -8844,7 +8844,7 @@ static void rt2800_rxiq_calibration(struct rt2x00_dev *rt2x00dev) for (ch_idx = 0; ch_idx < 2; ch_idx = ch_idx + 1) { if (ch_idx == 0) { rfval = rfb0r1 & (~0x3); - rfval = rfb0r1 | 0x1; + rfval = rfval | 0x1; rt2800_rfcsr_write_bank(rt2x00dev, 0, 1, rfval); rfval = rfb0r2 & (~0x33);