Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp1497565lqo; Sun, 12 May 2024 05:25:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWEePojeAY/E5ldNfe7dEU7IGHJpAid+JtPbCs1GDNCk9v0P+32EOL5MCMoot8Sys3ki/88LUfDUBRcYByJsLixj1hsKTGsFYU+7+Ny9A== X-Google-Smtp-Source: AGHT+IHe08PPfqZ59WWVAcWNaZ249ke2HcimON4iTWONnLh8WHIVm2e3JCC+cH+GJZAJVZSuF/F8 X-Received: by 2002:a05:6830:1e41:b0:6f0:2e49:b1ad with SMTP id 46e09a7af769-6f0e9113984mr8127595a34.9.1715516734597; Sun, 12 May 2024 05:25:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715516734; cv=pass; d=google.com; s=arc-20160816; b=YBZGmm27XWAP8J5G0/RuLexWOFD1/FxoIaa/x2su7IXOZmYYobrl+64A4SgXZysd4x 2w5Bp1oREkxLn8Memohgy8wGF7RHWwZIvnFmTIpvH5uNJqLRJueoiMerLKUlfgqL/FCx 3MrDiccSi3R8celKuXhoozCVyOEsDnIK4Bj5KGMDnCUUDonEvWziG3rD1EChtNnIXpB8 y0L6k/OYVJ5Q1Z2jVTNXPLG2ua632Cilnd0btTk+Hyv/gSt/cqJ9/XtReGX7VgyWQ98o FxSHyLl+4nbJBSlaUfzX6imNzD/GzIffxK9nKrAuDQPvrlwk+GCp6tjT5bOlZQeB4+CX NCeg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:organization:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=FP9dEziND649jDd2hNS7+Zbie0NH3q1x4xaRYbpLjek=; fh=TquNsOiV+zNY1csTpltVB6A9QFW5SbuNs6JlqcKCQkw=; b=qzT1dapVAfoFKRjCRo9dld8EahdANjgeRzjMKn9d3sZ5uACtCnjAKruLVSv79aCui4 oyF3bwujQnGq1EWcvCcLirdSkKyuC2xK/IEvi+swxYeb4xudS1asw2dkmmbHEX14PBoR t6l5qYlQzlQLnRi78NspGz0Nnw/URCcbF4MiL6hrHy6PprCO2Z+I6CE2YWNOOBi+mRAp fdYHOcnd+sqUh9m/ELdGiA1K6kWRkAHa/zAT/TAc1XpL/pj+ajPgWbovQ/HOIxXIvldL lT9xojp/8xaupaPhpu25y7H7uiwRNXD+XVs6CHFsUc707ttmJJAw4j3921MPbpzhLt+r 7cog==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=KNzmepNr; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-wireless+bounces-7538-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-7538-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-792bf336c42si719880585a.429.2024.05.12.05.25.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 May 2024 05:25:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-7538-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=KNzmepNr; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-wireless+bounces-7538-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-7538-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 5094C1C21119 for ; Sun, 12 May 2024 12:25:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 030F025569; Sun, 12 May 2024 12:25:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="KNzmepNr" X-Original-To: linux-wireless@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 61E65224DC for ; Sun, 12 May 2024 12:25:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.21 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715516720; cv=none; b=VKfhv7qr2moAPcTJT2oA/mKbQ4KpC1Uv5v99y+RulTmsmalwKvW5VPB1fs5Ke053l2TQ26bSSB9nxKvbF1ID3RXafARcrgfiJf7pVTgkCt6Izgm+b/eQDcmMAmprj/7TP2TLgA41BqheBECdaUVoMDsEJZVpS74d6/ikY4pp3QU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715516720; c=relaxed/simple; bh=UZxz73z3WzB52G15+Uwu/ndn2o/XysNcrmkTRzhvXjs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=rC1u3ggkfU1Fz26xVtpcxwIcb5lzhPFOZGKj/OOIyH37Ov9MhR8pdSI+ck32gb+RTAQFsi0SucRW/nQuGd40mXEntsvh0EdXo/+8K99M6qgR6A5LIhgHazP0NXDJ2L2k6fvOlWgI3R6O5wMB9ccTH21wiNcpW0dPExCZv+PQ3L0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=KNzmepNr; arc=none smtp.client-ip=198.175.65.21 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1715516719; x=1747052719; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=UZxz73z3WzB52G15+Uwu/ndn2o/XysNcrmkTRzhvXjs=; b=KNzmepNrcznUGLvrSrhfoDm9mGYNlR5GjKq5NLRNjHLfUc4xtkDBBr51 StNVhEdc21x/5oCHp6cGQAvOgX15LnhTNE3siLu8MJdV4yuOTC1n0vAnc 2XD4yigh5JgjnucXChxZxDrtdcsV9Kr5yQEaGYVoMCEdzL5KxGsnYrejt 5bVsUkSkPV8sKvbVw2Oou+9oqLJpsb890rLYV2bZbQjeS0/+CsT0yDkbF sjP+dICKbJ1lJ2GoRf1WPZKC8PeXfoFnKVw/ARRPBQO8wPDlXKKqztyep pOW6rT6jZLH3GpCUz+3Ihwgbs7tOaON+JYgsh4efDioNstuUQBAs74TH/ w==; X-CSE-ConnectionGUID: +vSZWtWFRd+5rUorJjgSaA== X-CSE-MsgGUID: d5/6nWmGTCKlb5/cq1+QWw== X-IronPort-AV: E=McAfee;i="6600,9927,11071"; a="11397188" X-IronPort-AV: E=Sophos;i="6.08,155,1712646000"; d="scan'208";a="11397188" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 May 2024 05:25:19 -0700 X-CSE-ConnectionGUID: 1Ea5epbBSWyDWLgn32WpNQ== X-CSE-MsgGUID: UCcYCtWdSAiVbnt/nwyJyg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,155,1712646000"; d="scan'208";a="34761301" Received: from weis0040.iil.intel.com ([10.12.217.108]) by ORVIESA003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 May 2024 05:25:18 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg Subject: [PATCH 03/14] wifi: iwlwifi: tracing: fix condition to allocate buf1 Date: Sun, 12 May 2024 15:24:56 +0300 Message-Id: <20240512152312.a11e6490d053.Ie090beea70d2f271bb22c9b0e287dbd342fb2a96@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240512122507.3812527-1-miriam.rachel.korenblit@intel.com> References: <20240512122507.3812527-1-miriam.rachel.korenblit@intel.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Organization: Intel Israel (74) Limited Content-Transfer-Encoding: 8bit From: Johannes Berg There's no need to allocate buf1 if we're not going to write anything to it, and the condition for writing is (correctly) "hdr_len > 0 && !iwl_trace_data()". Also allocate the event space only under the same condition. Signed-off-by: Johannes Berg Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/iwl-devtrace-iwlwifi.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-devtrace-iwlwifi.h b/drivers/net/wireless/intel/iwlwifi/iwl-devtrace-iwlwifi.h index e656bf6bc003..b9aa04cf1d83 100644 --- a/drivers/net/wireless/intel/iwlwifi/iwl-devtrace-iwlwifi.h +++ b/drivers/net/wireless/intel/iwlwifi/iwl-devtrace-iwlwifi.h @@ -4,7 +4,7 @@ * Copyright(c) 2009 - 2014 Intel Corporation. All rights reserved. * Copyright(c) 2015 Intel Mobile Communications GmbH * Copyright(c) 2016 - 2017 Intel Deutschland GmbH - * Copyright(c) 2018, 2023 Intel Corporation + * Copyright(c) 2018, 2023-2024 Intel Corporation *****************************************************************************/ #if !defined(__IWLWIFI_DEVICE_TRACE_IWLWIFI) || defined(TRACE_HEADER_MULTI_READ) @@ -88,8 +88,8 @@ TRACE_EVENT(iwlwifi_dev_tx, * for the possible padding). */ __dynamic_array(u8, buf0, buf0_len) - __dynamic_array(u8, buf1, hdr_len > 0 && iwl_trace_data(skb) ? - 0 : skb->len - hdr_len) + __dynamic_array(u8, buf1, hdr_len > 0 && !iwl_trace_data(skb) ? + skb->len - hdr_len : 0) ), TP_fast_assign( DEV_ASSIGN; -- 2.34.1