]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
net: wireless: wext_compat.c: Remove redundant assignment to ps
authorYang Li <yang.lee@linux.alibaba.com>
Wed, 28 Apr 2021 09:59:05 +0000 (17:59 +0800)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 23 Jun 2021 08:57:29 +0000 (10:57 +0200)
Variable 'ps' is set to wdev->ps but this value is never read as it is
overwritten with a new value later on, hence it is a redundant
assignment and can be removed.

Cleans up the following clang-analyzer warning:

net/wireless/wext-compat.c:1170:7: warning: Value stored to 'ps' during
its initialization is never read [clang-analyzer-deadcode.DeadStores]

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Link: https://lore.kernel.org/r/1619603945-116891-1-git-send-email-yang.lee@linux.alibaba.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/wext-compat.c

index a8320dc59af7e12fc4661dc82d871a9969b8e950..50a2330de2361c610130b56151a4ffdb01d06cde 100644 (file)
@@ -1167,7 +1167,7 @@ static int cfg80211_wext_siwpower(struct net_device *dev,
 {
        struct wireless_dev *wdev = dev->ieee80211_ptr;
        struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy);
-       bool ps = wdev->ps;
+       bool ps;
        int timeout = wdev->ps_timeout;
        int err;