From patchwork Wed Feb 7 20:26:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Kaehlcke X-Patchwork-Id: 10205961 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 89323602D8 for ; Wed, 7 Feb 2018 20:27:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A38328E53 for ; Wed, 7 Feb 2018 20:27:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6E28828F16; Wed, 7 Feb 2018 20:27:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0913928E53 for ; Wed, 7 Feb 2018 20:27:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932134AbeBGU05 (ORCPT ); Wed, 7 Feb 2018 15:26:57 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:33041 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754320AbeBGU0z (ORCPT ); Wed, 7 Feb 2018 15:26:55 -0500 Received: by mail-pf0-f193.google.com with SMTP id u15so822909pfa.0 for ; Wed, 07 Feb 2018 12:26:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=sx++HXFplaW4DW/jdfpjqEu3rugMTGoZoq9IR3035Xo=; b=rfIo0VDEwaCy5ouA3OePDndtR/qgxJ5UyEuFnJ1SipHGneiVJsvBO8dsCShGxTrvVh CFcweshGwBgfIyVJDhX4yDbKtOI+N1a/e4YmPEuj+lzL4Kgjo0CKbM1utLIohcmGJI07 NMj4PznxHMzCiRT97B9Cv1kqVkooHjgE9M/I+pe9iw6E+dy3uSPK7kjmGT8plIBgMB/h qlQbuLLDaJy1Uz9py1OqCUKupnM42CPe5K8qq5HnqmQSWh//LGDka88p9kRz5mpiMl2a sSPmwM76ealhSPNQuFJ0E7OfRwmytFM5qw7IU8vtoYjHP2s2QKl9sMAm35ufmRsvfZS+ lQBw== X-Gm-Message-State: APf1xPBC0KGONObLbYX1SFt/MrdMQj0SHeBcjTLo8MFuRLM5UCGWEhJX rgWAqTmtTlsgOdWIR2w6t9zUP3j8E0A= X-Google-Smtp-Source: AH8x225fh84thlr/zvvkXNSf+CPqrN0G/LYDVa1aRqg+BJEVWYPfePRAJcGxZtUvPnD7EjEm2VKdgQ== X-Received: by 10.101.101.142 with SMTP id u14mr4482724pgv.429.1518035215167; Wed, 07 Feb 2018 12:26:55 -0800 (PST) Received: from mka.mtv.corp.google.com ([2620:0:1000:1600:5ff4:666d:2881:a60]) by smtp.gmail.com with ESMTPSA id w16sm5437063pfk.18.2018.02.07.12.26.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Feb 2018 12:26:54 -0800 (PST) From: Matthias Kaehlcke To: Ping-Ke Shih , Kalle Valo Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Guenter Roeck , Justin TerAvest , Craig Bergstrom , Matthias Kaehlcke Subject: [PATCH] rtlwifi: rtl8192cu: Remove variable self-assignment in rf.c Date: Wed, 7 Feb 2018 12:26:34 -0800 Message-Id: <20180207202634.98937-1-mka@chromium.org> X-Mailer: git-send-email 2.16.0.rc1.238.g530d649a79-goog Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In _rtl92c_get_txpower_writeval_by_regulatory() the variable writeVal is assigned to itself in an if ... else statement, apparently only to document that the branch condition is handled and that a previously read value should be returned unmodified. The self-assignment causes clang to raise the following warning: drivers/net/wireless/realtek/rtlwifi/rtl8192cu/rf.c:304:13: error: explicitly assigning value of variable of type 'u32' (aka 'unsigned int') to itself [-Werror,-Wself-assign] writeVal = writeVal; Replace the self-assignment with a semicolon, which still serves to document the 'handling' of the branch condition. Signed-off-by: Matthias Kaehlcke --- drivers/net/wireless/realtek/rtlwifi/rtl8192cu/rf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/rf.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/rf.c index 9cff6bc4049c..4db92496c122 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/rf.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/rf.c @@ -301,7 +301,7 @@ static void _rtl92c_get_txpower_writeval_by_regulatory(struct ieee80211_hw *hw, writeVal = writeVal - 0x06060606; else if (rtlpriv->dm.dynamic_txhighpower_lvl == TXHIGHPWRLEVEL_BT2) - writeVal = writeVal; + ; *(p_outwriteval + rf) = writeVal; } }