From patchwork Fri Feb 9 00:57:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Kaehlcke X-Patchwork-Id: 10208183 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 EB8A660247 for ; Fri, 9 Feb 2018 00:57:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DC517294F9 for ; Fri, 9 Feb 2018 00:57:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D1097295A8; Fri, 9 Feb 2018 00:57:51 +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 78C2C294F9 for ; Fri, 9 Feb 2018 00:57:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752173AbeBIA5a (ORCPT ); Thu, 8 Feb 2018 19:57:30 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:38029 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751788AbeBIA52 (ORCPT ); Thu, 8 Feb 2018 19:57:28 -0500 Received: by mail-pg0-f65.google.com with SMTP id l18so2538879pgc.5 for ; Thu, 08 Feb 2018 16:57:28 -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=DCKL6pEupj9QTJAn9vzM7Ju+vbm/jzjrRu/do3C9kAg=; b=ZAh9WhULHHN3Copq0Et8loQqQiCadOAj8GCwEQXFkRhxNZsnP/GmVCV8ZQstYhYiVp 4JmZVXw1uoCICm0anW2en48WK2vJCJZnaUIr2ouQJJM4lkh1QAog6EWjF8+gAv5MhZzj lqvN6ZTjaDQEIFTA/sZexYbMfd3LpO5V6O0faAgooT4ExdFiK3tqBfqNmXB/s7hDs6G+ Nqi7fXeQDeZUrOpjqFsAO7BPBPk/0VW/vwCykIn8Eopxwj3cHq1ZzmDu0U5WvESbYyAS 6FF19et41mHH6lGqQnIurVZXBK4yJ5jUeDamQ7GoSvpBKrySql0cCUblEFVy1ZZyi1go 6+XQ== X-Gm-Message-State: APf1xPBBWrapPjZsus+XNYjcE21iyA9yX/5uqbU3U3E+yu/hthCemQ5K Z7phLTIxno8nh6sf9mVu9TwUFA== X-Google-Smtp-Source: AH8x224kVsvZ8tIskX5mvSQwWsh2nJ6SGp2Fy2J2mpDLgn4ZYcYAE15f1xpd/sUQIYdhkMoTVFxZFg== X-Received: by 10.99.151.74 with SMTP id d10mr837347pgo.258.1518137847679; Thu, 08 Feb 2018 16:57:27 -0800 (PST) Received: from mka.mtv.corp.google.com ([2620:0:1000:1600:5ff4:666d:2881:a60]) by smtp.gmail.com with ESMTPSA id l188sm2104989pgl.72.2018.02.08.16.57.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Feb 2018 16:57:26 -0800 (PST) From: Matthias Kaehlcke To: Ping-Ke Shih , Larry Finger , 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 v2] rtlwifi: rtl8192cu: Remove variable self-assignment in rf.c Date: Thu, 8 Feb 2018 16:57:12 -0800 Message-Id: <20180209005712.29353-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; Delete the branch with the self-assignment. Signed-off-by: Matthias Kaehlcke Acked-by: Larry Finger Reviewed-by: Guenter Roeck --- Changes in v2: - Delete the 'else if' branch entirely drivers/net/wireless/realtek/rtlwifi/rtl8192cu/rf.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/rf.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/rf.c index 9cff6bc4049c..cf551785eb08 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/rf.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/rf.c @@ -299,9 +299,6 @@ static void _rtl92c_get_txpower_writeval_by_regulatory(struct ieee80211_hw *hw, writeVal = 0x00000000; if (rtlpriv->dm.dynamic_txhighpower_lvl == TXHIGHPWRLEVEL_BT1) writeVal = writeVal - 0x06060606; - else if (rtlpriv->dm.dynamic_txhighpower_lvl == - TXHIGHPWRLEVEL_BT2) - writeVal = writeVal; *(p_outwriteval + rf) = writeVal; } }