Received: by 2002:a05:7412:2a8a:b0:fc:a2b0:25d7 with SMTP id u10csp515438rdh; Wed, 7 Feb 2024 11:13:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IFPb/urHfhhIO9JX6mCcVBhSZGaSmWeyzIspIWFbNwmZbyS8Ew9CBv9mji2KKIyI03l98st X-Received: by 2002:a05:651c:10a3:b0:2d0:a464:5937 with SMTP id k3-20020a05651c10a300b002d0a4645937mr3962663ljn.0.1707333196216; Wed, 07 Feb 2024 11:13:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707333196; cv=pass; d=google.com; s=arc-20160816; b=LvmiJNw68JCjhGTx4wP+SlmDjeZPeu7EUkj1btXQyTkZTW/CWRoivyJYhs5vSId8zu VObsEYxSaRxEwpX8boxlep1bKrc4zAHOMppL8O5T5FOXqRGTWfD8LVga1P1RGlZi0S/Y ZRUn4OxVRcytzQypfy904EDn0PgOg3WDUzMmPUGe+uIeA9dmfyZFs7r59cxtFpRBBCmc 4KHcfC9A86kdTHn+pUdZ/+Fhu6vQr+XYP9h9ybJFNpWE2lcVvxfYETGEd2Yu89EDevDT crKYgA5WyKnHqYcRIs+jSXtGDVflif6LeRFAQFN3oRxZ+cfUoFrDiA+G1lnn79MNWcJj pkOw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=DF8le9HDpq93p2777y4UQBN8RGND8Kbv97g3pP965Fs=; fh=Fe3PmOK5BHmh2O2wVhoG9/VQYXG7SW6LI6/jwVIp4Oo=; b=XomgQWxpUpqYJnO+82HveFUMZb9UfP1MxsOmbKuAyl59271UCpKJuI7rFXl7ZfNza4 MzvEjXXSREBxlAbJ25J/4wws5/dhhYwYyiaaSO7EIeRwA5BF9DqCtslsCBvT0/DsULyx lbr81QCK2I8nNUHs7oQsKO26kAYR4Bk05QcBuMi3RLng7sugBjAL9oxOQWREZOACt4m6 bjQI2P9gyd1yn5b8AXShJTL99A1r1awwJeY01eFFCstZRGjRKJJhOMmdXhner2LqN+yX +ZeY20J7iscEi+jgtj9uV7xHcDFvFsapApiZfICUcsVglvwpIu1kj95UUJL1F0RkJP5x YBUQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=rjwysocki.net); spf=pass (google.com: domain of linux-wireless+bounces-3306-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3306-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCWXz7SvVvpbJagsSjKQ9Rq6ISskwRUtFr+lymJIXDARucW59s74JlPa8Sk0xZH5i/C6ZYaG8UfU6j4K64WD4UIRJcYJr9iqk+TA2DfcLg== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id v10-20020aa7d9ca000000b005601d3237c3si2406eds.505.2024.02.07.11.13.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 11:13:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-3306-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=rjwysocki.net); spf=pass (google.com: domain of linux-wireless+bounces-3306-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3306-linux.lists.archive=gmail.com@vger.kernel.org" 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 am.mirrors.kernel.org (Postfix) with ESMTPS id D5AE01F25579 for ; Wed, 7 Feb 2024 19:13:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2691385C40; Wed, 7 Feb 2024 19:13:00 +0000 (UTC) X-Original-To: linux-wireless@vger.kernel.org Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) (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 E5D7C84FB3; Wed, 7 Feb 2024 19:12:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=79.96.170.134 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707333180; cv=none; b=McAEyYxFXwRlWcukFvjLKwnNZwZ4108bF0CqGiFEyABZns+eZTzbMemdYoO/LSs76JVeVXyPv2tOYMVeSo5I+wDYL9ocR++7YHXGd3z4GwBHW5imHzLxL2p/HPa6ifUgau1n7V21fH197njSVv0iSMm4+uo4pu3edtpJiAjvBYQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707333180; c=relaxed/simple; bh=IKdzAuASVSS/yKCccM5Mg8xdrg02liH8JpWtvz0XBq8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Xl4HbFblep3004a7pyJcpCCX5YZVrfFhz6vJAZmuflWe/2LKwlfcyFKClf48k+rADLe0XOqTF3jlpZoyGwstN2V2zgM9YSSnh5JSLEXoR0p7cVUUa1ZJlG8wm3K7S6p+NnL+t6nDfuvPhcquiJbL75YQk2vmMXotJPIMQd/50bI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rjwysocki.net; spf=pass smtp.mailfrom=rjwysocki.net; arc=none smtp.client-ip=79.96.170.134 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rjwysocki.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rjwysocki.net Received: from localhost (127.0.0.1) (HELO v370.home.net.pl) by /usr/run/smtp (/usr/run/postfix/private/idea_relay_lmtp) via UNIX with SMTP (IdeaSmtpServer 5.4.0) id e8e8c8c4c6c01498; Wed, 7 Feb 2024 20:12:50 +0100 Received: from kreacher.localnet (unknown [195.136.19.94]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by cloudserver094114.home.pl (Postfix) with ESMTPSA id DD008669B2E; Wed, 7 Feb 2024 20:12:49 +0100 (CET) From: "Rafael J. Wysocki" To: Linux PM Cc: Gregory Greenman , Miri Korenblit , Kalle Valo , Johannes Berg , linux-wireless@vger.kernel.org, LKML , Daniel Lezcano , Stanislaw Gruszka Subject: [PATCH v1 1/3] iwlwifi: mvm: Drop unused fw_trips_index[] from iwl_mvm_thermal_device Date: Wed, 07 Feb 2024 20:09:15 +0100 Message-ID: <13461881.uLZWGnKmhe@kreacher> In-Reply-To: <1892445.tdWV9SEqCh@kreacher> References: <1892445.tdWV9SEqCh@kreacher> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 195.136.19.94 X-CLIENT-HOSTNAME: 195.136.19.94 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvledrtddvgdduudelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffqoffgrffnpdggtffipffknecuuegrihhlohhuthemucduhedtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkfgjfhgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhepvdffueeitdfgvddtudegueejtdffteetgeefkeffvdeftddttdeuhfegfedvjefhnecukfhppeduleehrddufeeirdduledrleegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepudelhedrudefiedrudelrdelgedphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedpnhgspghrtghpthhtohepledprhgtphhtthhopehlihhnuhigqdhpmhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehgrhgvghhorhihrdhgrhgvvghnmhgrnhesihhnthgvlhdrtghomhdprhgtphhtthhopehmihhrihgrmhdrrhgrtghhvghlrdhkohhrvghnsghlihhtsehinhhtvghlrdgtohhmpdhrtghpthhtohepkhhvrghloheskhgvrhhnvghlrdhorhhgpdhrtghpthhtohep jhhohhgrnhhnvghsrdgsvghrghesihhnthgvlhdrtghomhdprhgtphhtthhopehlihhnuhigqdifihhrvghlvghsshesvhhgvghrrdhkvghrnhgvlhdrohhrgh X-DCC--Metrics: v370.home.net.pl 1024; Body=9 Fuz1=9 Fuz2=9 From: Rafael J. Wysocki The fw_trips_index[] array in struct iwl_mvm_thermal_device is only populated, but never read, so drop it. Note that the iwl_mvm_send_temp_report_ths_cmd() code populating fw_trips_index[] is questionable, because it accesses a trips table of a thermal zone directly, which is not guaranteed to work in the future. No functional impact. Signed-off-by: Rafael J. Wysocki --- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 2 -- drivers/net/wireless/intel/iwlwifi/mvm/tt.c | 13 +------------ 2 files changed, 1 insertion(+), 14 deletions(-) Index: linux-pm/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h =================================================================== --- linux-pm.orig/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +++ linux-pm/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h @@ -539,12 +539,10 @@ struct iwl_mvm_tt_mgmt { /** *struct iwl_mvm_thermal_device - thermal zone related data * @temp_trips: temperature thresholds for report - * @fw_trips_index: keep indexes to original array - temp_trips * @tzone: thermal zone device data */ struct iwl_mvm_thermal_device { struct thermal_trip trips[IWL_MAX_DTS_TRIPS]; - u8 fw_trips_index[IWL_MAX_DTS_TRIPS]; struct thermal_zone_device *tzone; }; Index: linux-pm/drivers/net/wireless/intel/iwlwifi/mvm/tt.c =================================================================== --- linux-pm.orig/drivers/net/wireless/intel/iwlwifi/mvm/tt.c +++ linux-pm/drivers/net/wireless/intel/iwlwifi/mvm/tt.c @@ -562,7 +562,7 @@ int iwl_mvm_send_temp_report_ths_cmd(str struct temp_report_ths_cmd cmd = {0}; int ret; #ifdef CONFIG_THERMAL - int i, j, idx = 0; + int i, idx = 0; lockdep_assert_held(&mvm->mutex); @@ -588,17 +588,6 @@ int iwl_mvm_send_temp_report_ths_cmd(str /*sort cmd array*/ sort(cmd.thresholds, idx, sizeof(s16), compare_temps, NULL); - /* we should save the indexes of trips because we sort - * and compress the orginal array - */ - for (i = 0; i < idx; i++) { - for (j = 0; j < IWL_MAX_DTS_TRIPS; j++) { - if ((int)(le16_to_cpu(cmd.thresholds[i]) * 1000) == - mvm->tz_device.trips[j].temperature) - mvm->tz_device.fw_trips_index[i] = j; - } - } - send: #endif ret = iwl_mvm_send_cmd_pdu(mvm, WIDE_ID(PHY_OPS_GROUP,