Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp309857rwe; Fri, 14 Apr 2023 03:15:06 -0700 (PDT) X-Google-Smtp-Source: AKy350a2W4jzzpPNgaLFdhxrYmJkdQWsxaWXGuRVVr88B1t8DCqcbF2Yo7qxEZCm7hR3ROvzCeON X-Received: by 2002:a05:6a20:8c9e:b0:eb:a859:cace with SMTP id k30-20020a056a208c9e00b000eba859cacemr3787670pzh.41.1681467305947; Fri, 14 Apr 2023 03:15:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681467305; cv=none; d=google.com; s=arc-20160816; b=WDWpt0hAIKhMr1FnAK1XQVuejobrt/xbQtxPjACkmEigjG8+y5BLX+2x0B7pdtUbNl TQVI0JpQJTw+svlLorOMSCz0i54Kg0q8X7AY8mb+o7XNNSpZG2LmQhwuquMgQO3V77Cw EjjEgMmlNjHWwt/P4BEHdctHWOfXpxHDlLva7rxq1fzKDDIP8ADktVelgvD/pD6yUFC0 IFUNKIYaYv8iL/xdDLbhaMhS5bB82aSK259nVZFp6FAJ49W7epS6Hx+bgwSeX7z2FHQ7 PyZS+hrGvYi6FDw344TJflFNnUG7WSVxTJDLfbm67QuLCxEJDekdJvUOJJb2GydA70hZ QT0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=QhdVRXnH/A0ghDl2slxrjdgI/Zrv5IXVv9jSul05Vbk=; b=HHVtj6nM5xI3cpyNHzniEWOQWgASXn0tKzSzTWEfgSv5r7evt+J4EolHz22aYx8S/Z O3UYxEhxBWzO0RskCIP7wpU3TNH1nvrXYzFxQtNG4ob9BKPZoccR5NQZKFHHphbz0Qox dcAbogmAqofSTwNQ2En+2lfvr5oLzonBriHV+Aepu33RiyJfpaGIBKx/L2o4N0+vJp01 9quC8NI3008ghhzybJt2z/pbqNLoBWuaKjVFiHNP7vC6+X6q4lORWTrvOHZYVljDVYQx 6AihVxLbUSQlRR0ZcTqRAhTI01dpMp45206WMuIF+VQvKyk5ttZ3JvuDGxCNaPZ5Z2+b zqUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ln2PCBD9; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k11-20020a634b4b000000b0050be915cebcsi4187025pgl.878.2023.04.14.03.14.57; Fri, 14 Apr 2023 03:15:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ln2PCBD9; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229647AbjDNKNJ (ORCPT + 62 others); Fri, 14 Apr 2023 06:13:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229636AbjDNKNI (ORCPT ); Fri, 14 Apr 2023 06:13:08 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C41D4ED0 for ; Fri, 14 Apr 2023 03:12:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681467161; x=1713003161; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=s9OP/gIZPXds2wY7KyxyQV4a6LysK11/BO5DZhuDGds=; b=ln2PCBD9Ct9aY0D6mtVmc5qlyQKAhen3ZfEJWryRMk+F+wILbc/0SV1k VcouaDi0qrZodOIF0HJ0AR9Z0R9BOwDFp1cHpF8AhVJ8HmNCC3Eow3OIN thnym/0kO68s7FYvUzSyv80lKJNUoC8PW0mdVpfBiF4SiDH612przAwRd OYib+rZ1zX6a3j8YDUD8K3CSxCnQjn9PVkNg+pblbUz1nvsNJwHmS3zwA qNMqAje4VDa8Z++j+aAANyWdt73WdZPntANT43hUKaoZlIMYQK3SfilV5 CwocGVb4NMF9rxRyjaB5UFp+kpSkfCEny5MwgCpxj8xW7regA/ya6SE+J g==; X-IronPort-AV: E=McAfee;i="6600,9927,10679"; a="346263604" X-IronPort-AV: E=Sophos;i="5.99,195,1677571200"; d="scan'208";a="346263604" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2023 03:12:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10679"; a="692351721" X-IronPort-AV: E=Sophos;i="5.99,195,1677571200"; d="scan'208";a="692351721" Received: from yalankry-mobl.ger.corp.intel.com (HELO ggreenma-mobl2.lan) ([10.214.233.156]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2023 03:12:32 -0700 From: gregory.greenman@intel.com To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Tom Rix , Gregory Greenman Subject: [PATCH 07/15] wifi: iwlwifi: fw: move memset before early return Date: Fri, 14 Apr 2023 13:11:58 +0300 Message-Id: <20230414130637.872a7175f1ff.I33802a77a91998276992b088fbe25f61c87c33ac@changeid> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230414101206.1170180-1-gregory.greenman@intel.com> References: <20230414101206.1170180-1-gregory.greenman@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Tom Rix Clang static analysis reports this representative issue dbg.c:1455:6: warning: Branch condition evaluates to a garbage value if (!rxf_data.size) ^~~~~~~~~~~~~~ This check depends on iwl_ini_get_rxf_data() to clear rxf_data but the function can return early without doing the clear. So move the memset before the early return. Fixes: cc9b6012d34b ("iwlwifi: yoyo: use hweight_long instead of bit manipulating") Signed-off-by: Tom Rix Signed-off-by: Gregory Greenman --- drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c index d5b51496bd0b..d9faaae01abd 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c +++ b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c @@ -1388,13 +1388,13 @@ static void iwl_ini_get_rxf_data(struct iwl_fw_runtime *fwrt, if (!data) return; + memset(data, 0, sizeof(*data)); + /* make sure only one bit is set in only one fid */ if (WARN_ONCE(hweight_long(fid1) + hweight_long(fid2) != 1, "fid1=%x, fid2=%x\n", fid1, fid2)) return; - memset(data, 0, sizeof(*data)); - if (fid1) { fifo_idx = ffs(fid1) - 1; if (WARN_ONCE(fifo_idx >= MAX_NUM_LMAC, "fifo_idx=%d\n", -- 2.38.1