From patchwork Tue Jul 30 13:58:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 13747429 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2040.outbound.protection.outlook.com [40.107.92.40]) (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 3B24A19FA7B for ; Tue, 30 Jul 2024 13:59:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.40 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722347976; cv=fail; b=ZIMXlnHc2z4KsMwCN/3jUi48nOtcRiiSPrhFktesuqKktj9N1+D7BN4+rc2aq4ugSRocrCM0q2/sMZKWKpD1QxCM8s6fYSluvwyM64ia3DBxYvpK2+BUk8pq8FLchfjNf1rRX4uDGk4ndS9SC1EL6oO4Lgo7loWa0evs4O8WUDQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722347976; c=relaxed/simple; bh=8H2/ZGhvnKwLRYWML2bHX2Osfjz6MonZgi3J0oTxSRM=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=R/Jzc2/3R4PqbzfF1F1+vCTMyJ+UKV1brCo1omtTXchvvOWnIC2K3SS6qqNPt3kAWYktZTKv/8acjs1yRVgFNGCxH7hfbmddjQQ267H5sjySQ+i7+ZPlapu/qjFtUKggHCbpskpTi0+eipFNA2f7K8ihtk02h36RHsQnWAar2BE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=dtFz00x+; arc=fail smtp.client-ip=40.107.92.40 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="dtFz00x+" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=BBTizyqmkQr7W+9XHajxcxcErz4rYrMF/9ZpNvmDOmWXtsAb/Bfm2p9Q0uSF8qAHNLXXJzQAB7whCAK0YQ0KM8PlksRMAQ9Kb6+UAX6ACRnebT1xNkXU6akcmnqKSdZPWCBHZ0EOdgWkpAFTEjoJcPzkIUJpSwST2T0TuibRuSBiX8Lr+7D9Dhb+EMOracHjWi80GSuaVzeauCuJCuXWSLzqYGSO0j2bONeilhrfRcfFNW4ll754SjBDx0CBQmRhQf14yOyFLmQJyS87vXIvSmW0lUTcO/Wwdet1Ta9Jyzeu7ItjBy7bwuQ16gm4ch7+rh4/PYk2u03cBpyJklruQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=9sB7/h3zzk/aT5CvbeGb1srq/i+hL81OO9v/VY59oJc=; b=XsA3AeiUUgYnl8Ywmmww+ZmMwq7EhNLDtMcCHAPrrBfaGj0KQxCNfxPKTNNpamCmBnTZ4XeP4vCPd8pXWOj1HMu3o7bUI1xamtYTVnWNGTPZS6mDZ+D50i2IAQf9Ae3OWkWNxovbQdX06xL24Me0r9QALIou/xYDb962p14nkHdFMIeYeABc/SHQ8K0oDo6dakAWltffWiRQq4ylAjQRTFlF2IVQNWVjJL1mKMKenGzODLil6poUkea4uJHrO5rt5fzgjfPQ4LDyFQFnjRAnbH+sCnOgeVOd5KtsODY4QjQRzQZzG1z8o5tmdssnmre3NW3leyTdlQIGFxw17svgTA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9sB7/h3zzk/aT5CvbeGb1srq/i+hL81OO9v/VY59oJc=; b=dtFz00x+P5PEYF9Gs+Vgw+Kb/HvaoZwSg+adg7KYuvs1rGGEZJO9vdHYIcueVkPc2J8oGcc/7o4weUHy0bPtDoN6gvx4cOTfCKrhyp/asySd34lF1AeJamxPgxXwHAq71Qj/WwR2JdBpzefdVcUDxcjSlKzocBvx9p3k+MCKv3KfK/QLcwvd/eUggWvcFe6bprG34l2THLQwuvwFIgF2W/8OE8L12Qu5HnzEbcpzRCE5wZyDW1rIFyHL9JP8pX5lY/qmkkEeYBJRqBRqHlivuD9fK9Kar8jo5l+DsLF2YqT9pZ8DQOpcdmUvnE9Sa/kS5xFkeqIyaCFyupO/m+4vOw== Received: from PH8PR02CA0019.namprd02.prod.outlook.com (2603:10b6:510:2d0::27) by MN2PR12MB4453.namprd12.prod.outlook.com (2603:10b6:208:260::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.28; Tue, 30 Jul 2024 13:59:31 +0000 Received: from SA2PEPF000015CD.namprd03.prod.outlook.com (2603:10b6:510:2d0:cafe::a2) by PH8PR02CA0019.outlook.office365.com (2603:10b6:510:2d0::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.35 via Frontend Transport; Tue, 30 Jul 2024 13:59:31 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by SA2PEPF000015CD.mail.protection.outlook.com (10.167.241.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.19 via Frontend Transport; Tue, 30 Jul 2024 13:59:30 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 30 Jul 2024 06:59:16 -0700 Received: from fedora.mtl.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 30 Jul 2024 06:59:11 -0700 From: Petr Machata To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , CC: Vadim Pasternak , Ido Schimmel , Petr Machata , Subject: [PATCH net-next 01/10] mlxsw: core_thermal: Call thermal_zone_device_unregister() unconditionally Date: Tue, 30 Jul 2024 15:58:12 +0200 Message-ID: <0bd251aa8ce03d3c951983aa6b4300d8205b88a7.1722345311.git.petrm@nvidia.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF000015CD:EE_|MN2PR12MB4453:EE_ X-MS-Office365-Filtering-Correlation-Id: ca7ad653-3c16-4bea-709d-08dcb09fd54c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|82310400026|36860700013; X-Microsoft-Antispam-Message-Info: 6h98Rbitv6aeIMoq/DYa1h840mCPRjzxXw4hnLc+IA3sa7VQ+HkowsAhG1sWjDixUWT2iT3ateYQjkVdi92exstQJIgiCKPN+NVe36tBSH0Nv9i+/x4V2Lp+dsZkCJMGSocT5fIKiYWM8Cq9QWw9L6VfJbQwshmMCxAZ4Wwn4KfX/FkTLNewGfaTLIDvEi4atrd5atshfIZFZj9SjRElUacFdJsOF22YnGi7f5mMMTIHqcyNzFRJbfULS5wyQEUFAGA/aFCdWJzEA70RvHA/NcDZOrEZHwepdMvQZ7NhzB20AsoYVG28rNMu9CaW/K3kkmqimlJA2/idTXfQB5DaJE758iUKmHnAMIEB9uUwuGgxHyikcLvfdest9s51ToeFdp46Ur605zlDjPZ/pRjajv/cIgz6JaQNQufG15BhQXlWLkClYa9wOo2+v8PBQF1qXkU9wpZKhqJGb7mxeICKWJxWevXcIlbSBqhijR0J9qu3K3KjvYIKR+cEv3yOyVg5acURxFOQK2VC797TD0Q5A8HpVO59jh7+0wRGw64uqgH6PQwem2S3t3Hskxex1bgR/Syc2EVkBCI+9DQnVNh3X/iSCMgBECAvmbytYOd7NgaWrZjgMRuB933ereYzUoikojjd1aNLZLWzNPBC1e1M1b6iWd0IIXdLQFCnfbrd7tl1BG4ozcE4RNrz0aHUyoWj6ShOoq2d36cp4+ujJvccELCpvre+/BO0Fo9Huz/Z+8sp+He7EHplnuunwS1iwmW8iasAZ2U7kaaIYyK/rRC8IB0bw6WVCPQ4ozqcCB+Iywvp9Qav6jYUyFyJ3d4KG0oHjAMPzU3qvH75Dhns7i52r2fsZmqImN+8rN7RfUXMFYSVH/cXPpBT8f+VXIttGWQqHzUdBIFap2kpE7kXv6t4YMTqXr/3o7t2JvWU8pRcw87krSuEYQQIoDYSQEhDU0X28VMUImC6VMFhdZf0x92G4/TQ71KF9G+/i6sKCK/4GugPGg8v42YQHEmFxSCRogX7TEtgBVfDai8GBS7zQnkSI3vs8D1LpPTTzILezOpytHS7Lp9PchQWqTG0kzzQ0pko7up6HkDjRWtg9eAhyjkqXIKpnl+0hiJspMAURMrNhkj6YsROkUa2XAsThyJI/7c2Ft5DuldowZ6CZAmosNQxztpHKfhnfTBE0DhePLPuNH5TgCvRUL4/suQ7jpugTrmFqDtjVOo2bB5mQiDNmddYlZ8wmi0EWh8ohrcRWaTL1wYgydQBytT4B5XTP44oC+H41eWThb1HEnEF4snQ4VAY1MB9MXJyR/+m2HxpsCN1obKYOJpgoIvmFg7miO2PM9vaLBdvla7hXF99I2A49sE3nVptwXEJoeO1gyXfTjS6xSyGVQpZ85UIelvCdPyy/dVLqKAgFdPxVmflsH9WhsKL8X6ltv3U1RqZkAyjg5vII2ssfhUPkCJ1G8y0hzI+W0DK X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230040)(376014)(1800799024)(82310400026)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2024 13:59:30.3831 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ca7ad653-3c16-4bea-709d-08dcb09fd54c X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SA2PEPF000015CD.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4453 X-Patchwork-Delegate: kuba@kernel.org From: Ido Schimmel The function returns immediately if the thermal zone pointer is NULL so there is no need to check it before calling the function. Remove the check. Signed-off-by: Ido Schimmel Reviewed-by: Vadim Pasternak Signed-off-by: Petr Machata --- drivers/net/ethernet/mellanox/mlxsw/core_thermal.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c index d61478c0c632..0b38bab4eaa8 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c @@ -821,10 +821,7 @@ int mlxsw_thermal_init(struct mlxsw_core *core, err_thermal_gearboxes_init: mlxsw_thermal_modules_fini(thermal, &thermal->line_cards[0]); err_thermal_modules_init: - if (thermal->tzdev) { - thermal_zone_device_unregister(thermal->tzdev); - thermal->tzdev = NULL; - } + thermal_zone_device_unregister(thermal->tzdev); err_thermal_zone_device_register: err_thermal_cooling_device_register: for (i = 0; i < MLXSW_MFCR_PWMS_MAX; i++) @@ -845,10 +842,7 @@ void mlxsw_thermal_fini(struct mlxsw_thermal *thermal) thermal); mlxsw_thermal_gearboxes_fini(thermal, &thermal->line_cards[0]); mlxsw_thermal_modules_fini(thermal, &thermal->line_cards[0]); - if (thermal->tzdev) { - thermal_zone_device_unregister(thermal->tzdev); - thermal->tzdev = NULL; - } + thermal_zone_device_unregister(thermal->tzdev); for (i = 0; i < MLXSW_MFCR_PWMS_MAX; i++) thermal_cooling_device_unregister(thermal->cdevs[i].cdev); From patchwork Tue Jul 30 13:58:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 13747428 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2042.outbound.protection.outlook.com [40.107.223.42]) (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 BF13C1A08D3 for ; Tue, 30 Jul 2024 13:59:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.42 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722347976; cv=fail; b=Zga1Sd+6x/y1CJ9ja4YZJUimwPkNCXxmPT1vdRFN3LpuIuqXPYJmUXGvSRmvoFML3zkEvWzkEfPlFJxv9W5kTjAIiPwOi1s2VThx+wRtmAvU9NkTzgD2nM6Ryj6A5NGaLwdaG9Mjm044M+oYgCtHrkTwiIIkSR3OkYmr9o/L81U= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722347976; c=relaxed/simple; bh=nE0ErH0LLaKt8TrvPDM3ffo/gGy3CuzpPYfcoUnEBdY=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=iMrml3mtMr6ZY9+ogkclCmSNXoTNJazDeotNSYZm2HA6uNKXuj625lqYzr1LbKONq3rk6AlIewHIbmGmAiCpymRNhc9cuok7N/EkUmgHFXh4MRWaO4ajCvQ3dOF3QT+eEEqO2nL1tCZcrkAJlYkrQqm3COnyN6DsM6xBx1IaAo8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=l5M60MCt; arc=fail smtp.client-ip=40.107.223.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="l5M60MCt" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hGqfGa215Vn47jqAUrSfG/9IJ1zEVOWpo3Ad6V1wB5bOznlEeK5yU8utpYGPoQLIOqdtuW4BmlrBLq+OuUgq0+79198QjtyWe0NtAL60TLuP6MkcTM0fo8rvRVHqsntMZff7hSudjULDgPUCO5EoYFz5imrJcw6E9KjU8ccpkurXXwgxdwCdV9d4wQb0N+2yzBTAj7aSsd9Zfy2PZVWaKz2k1XeJZQAYqAigDDHEH50Wq4WdE+0yYsZf6HDhy6vYyNVP8z5/qYpi7RGk4+HhB19GSKqTE/FCPE99yV88v4Ov6a8SNQsGWNwpn/3Av/tZBFL2OOjYwjlepZRwaQZFOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=2Ff9LG8cf6Cbw2DEDcilI1j8naFOQPzgPleQ3uX2Wk8=; b=NISLsjWn5V7niBYIJh+7IG7WcsSM5V6JC0utSeTa4Frl/D2698hKGlDZv8u2gzNulCqC5rIkRKraCRNXU7xKfIPpG3TGX1TZvk1rOkiWvuTggbGhiWGUZMfta18anlWs4B/iwct5NKdMRILKKNDce7udynLzwq3fllSKv0PoyGRyvokvsLVYU+X0w6eP+N7vPbxY+Gm/h2pZPQFKReG/aY5arNT4/PGliUssFjtwbk04ONcWVLaiVDQRunot8lXulMxG8cr9ooqgidsytuStmVZuJHS6k6gsDHQ8RCEnulZnPtVFxX5VEzsY3xDfdXsuubQQitHDjlVpzckE8lRaZA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2Ff9LG8cf6Cbw2DEDcilI1j8naFOQPzgPleQ3uX2Wk8=; b=l5M60MCtbxB3gi4t54kgnoxHv9bdwzSxwDNkR767P+lnorRTz6J/LVyB610Qa7140i2W8kN9G6AxuNblNhyFvfOdrrJDosCMHKlpLB2MEkxGqoQplN068r8qEaf5u16syJjZECo4f4Cijtkr8v2AWfWeM1xzZl3zNmR8emzEXiwwPcyq1tJCM0IP7nbed2KqZixqtC1PAxi0mJqHoW662qAZCKpAtqXi5rvZZhq0V28gKJpBlh4YTWkeY+x9vPwfVrlwDGgei5jUoR29oRMDGDTj4PFBJaYxAGUKVnef0eJt8S0rnSbgyv/2Xai7kLvQ6VLTKVb+i0ht+PcS4gOTYQ== Received: from BYAPR21CA0001.namprd21.prod.outlook.com (2603:10b6:a03:114::11) by SN7PR12MB6791.namprd12.prod.outlook.com (2603:10b6:806:268::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.27; Tue, 30 Jul 2024 13:59:31 +0000 Received: from SJ1PEPF00001CE5.namprd03.prod.outlook.com (2603:10b6:a03:114:cafe::c5) by BYAPR21CA0001.outlook.office365.com (2603:10b6:a03:114::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.3 via Frontend Transport; Tue, 30 Jul 2024 13:59:31 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by SJ1PEPF00001CE5.mail.protection.outlook.com (10.167.242.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.19 via Frontend Transport; Tue, 30 Jul 2024 13:59:31 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 30 Jul 2024 06:59:21 -0700 Received: from fedora.mtl.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 30 Jul 2024 06:59:16 -0700 From: Petr Machata To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , CC: Vadim Pasternak , Ido Schimmel , Petr Machata , Subject: [PATCH net-next 02/10] mlxsw: core_thermal: Remove unnecessary check Date: Tue, 30 Jul 2024 15:58:13 +0200 Message-ID: <87f5b8f52fbac0047e0be67a76851b3bd3c6a2ba.1722345311.git.petrm@nvidia.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CE5:EE_|SN7PR12MB6791:EE_ X-MS-Office365-Filtering-Correlation-Id: 55cc16da-f54b-4abb-8889-08dcb09fd5ea X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|36860700013|376014|82310400026; X-Microsoft-Antispam-Message-Info: 1v2HghmPelx5Rlo2BKsW7vbVWHXq1sKmhwP5mdEGzH3Kiq6I0We+R47a9X/o7Km0xJdm11qz5mNxmHPIyVTVY6eO5xeGny6fW2hc0A+50te4N/40Zjf78+gAsTyD1SqUmLKXNk5n8Hp7iLe6lK7TjZ1jDTZiqdKSsoyB3y/PYqU9g1klCDiE3QKgHw9DSA2ksm7QyRn8lVGkYZggkQKYbP2//jrfbS8xFdEAtLBSFPzzSpMgrBQuORGhpzvtF9so9jazVlNESGeTXI/nCtwX6tNH51zZwnalYG3m7qAwfAEXqzf76K9JX85U1iZZk3BS/27U4+pioWQg3nDwxyokWzU0iDc3jl6SstSPJ97nntMJUa97CrshBLGI0p7EuYDc9yakIfA8UMOIKbzEz0RT3YLs/J/0SnjEFY4Sy6CVV84dEZDcuvWVvBawu/bo0APQDHI5gEoQkBjdM2B9N1UR5WLU2XAtkmssvrqQIue8XcwIr5swaS2ybm+P7b3uFWmE4ciWlBm+vG9649HpvkPdwdbMbzINFe0WcIE7FibFsnzzn/2njXSwH6+y88VJxVqEuw0Wjzo7TW0uprZ5+bwE15tKE8woM7wZ6Yd3jVdd416cP7ESeZBNSRtivg7WTHytkOOKulPyvaKs5q0wmW5GheZ1PvK0TLO0iiY3gaR/RDZ1nMid9vfkdBfLGimtBIct3q7XgXhjOnWpVxG2WABVqg2PakG0ag+VH6j9LR5L2NuwX/daI+WWrs1q1hOEuHrJ+HBiV9rNY6xUwkxJAH6kMokqaVCLMfb73hfstJii7oDMJZ7alcCfUKQS6Evddtk4XeF/mw/IevtSrdB2l+PST/T9XO5T5zhx/tCNKcEPgfr0yK12lAg1/y0uHqU5k64e2EkPPzpY9gckRzhpT4DwkYlME3gVZrNOwKMXn+eySZYGh2fR6Q0vMeSRUNH2GbTY47vrhFmqDhBXDYybnwVPxs8zj/i3zIeBDKcYz14zj6AJIE7Rzs0HXqsHKV61roriXdB9KOXN91vZB1cOU2ByKHrcTIPANNIVzkQ8YSxkXmGHBL+FsRw+DqsOwoEVoYlPLMJU/ByJDLVbKyZxF2o/apQQwy+CDMfKzA1eKdzicSTaIdYxODxlLONLwMZnaVEf1zNHEceTFByAtp9nPjGR5DmQTxcN4JyRsnhBDlNlIysgOk7/o9ZH6rcaNMhN7trTf/o5Y0jpOgH2ulzjk/+kihtQ3zJGoum1cBRc+pC/e9/sUR49TOANuGMGaC2e23l3WyCeqrKPsolvrGh6zD9RqnMMvbGPExtB+7yxVjPEeJV8wSoX2l1iHsjGuoqL1c1FZi2bm7h/JSVDFtnkidYhvYvyPEBrIbN9U4RxK+ITFZUQPO13C1nQN0uD4Xl9Sj8i9bkV9oHj6DasqNbYHkFMli9k/uPZoIT3PQDJWR+gNu2xVvCvCYYIpa+QC5J7QBbg X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230040)(1800799024)(36860700013)(376014)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2024 13:59:31.3723 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 55cc16da-f54b-4abb-8889-08dcb09fd5ea X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00001CE5.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB6791 X-Patchwork-Delegate: kuba@kernel.org From: Ido Schimmel mlxsw_thermal_modules_init() allocates an array of modules and then calls mlxsw_thermal_module_init() to initialize each entry in the array. It is therefore impossible for mlxsw_thermal_module_init() to encounter an entry that is already initialized and has its 'parent' pointer set. Remove the unnecessary check. Signed-off-by: Ido Schimmel Reviewed-by: Vadim Pasternak Signed-off-by: Petr Machata --- drivers/net/ethernet/mellanox/mlxsw/core_thermal.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c index 0b38bab4eaa8..394e4fd633ef 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c @@ -453,9 +453,6 @@ mlxsw_thermal_module_init(struct device *dev, struct mlxsw_core *core, struct mlxsw_thermal_module *module_tz; module_tz = &area->tz_module_arr[module]; - /* Skip if parent is already set (case of port split). */ - if (module_tz->parent) - return; module_tz->module = module; module_tz->slot_index = area->slot_index; module_tz->parent = thermal; From patchwork Tue Jul 30 13:58:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 13747430 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2063.outbound.protection.outlook.com [40.107.94.63]) (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 BBF2019D8A6 for ; Tue, 30 Jul 2024 13:59:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.63 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722347983; cv=fail; b=flhcv1uhHyA4A+s4jxvIBZSYofh39ex4m4fxu9R/qnr0ycqh8vlrW4COaBQFEOMJtRZ13I7wdtdgNvK4sCfdTFbFlISavrrgA8CFJ7Wf6aSKMveIeztYuIgiCvnsXHE3eLNAlSbOyUez3VgdaUq71Rq0pcJHGynYbR7UvT8ySrA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722347983; c=relaxed/simple; bh=Bj3lZJfdkSVrr6QF/Cb6LVGUhuFolVthGB0SKBq2H/k=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=CPuKMY61BLTKJWOldrWcF5p3sHObJXhWRSf/J6mNvt5PKgOBnx3W1+/oSFHbYzvMo1jn5CMfPxdTj47ZpyXNg8O42DwdJCsbMTNHe4TNpIVWKgFDRz2HUQkQ0F3q9puhiw8aaTMy3fhj3hVU/pqviW6cScxnVy83wRafE+8vnNg= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=LouQETa9; arc=fail smtp.client-ip=40.107.94.63 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="LouQETa9" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=F2P4hSOG5AUHaYE6FtAJxLwUFMJCS9vkdvYHTMTsvJrTY235ORzkqDVdhK/KtOrMz8UTnzMXowFEnPx6DMZAZVs35sD4aK7jX+62K12Y6y2oEKR6NJYBgYayvNZ//VmLF6VvLCGMYwIFkkKRXSNuMG1u6Kz4bilokWM1Gvl3PJBHek4hxMr5FhjJZ9KVpiYmSCDYEV3fxnOHwHrgfk8HLQAIuoTaQVNlpwvMEjAhkwnt2lVKva4wTpFBzYnrRMAhW3dmDAn9aLCJJcWQCrfNccODx0U2SogHTxWJ1EIth1polPAG9J5v7iIHZeIP0W0P+54XX58fz0crRR4WXPFGqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=EA/21JfFR/kAhQ+nOfRYhWRqHJiTIIm/aGA1sUmltUw=; b=TDfEwxlmtfPjH8ObA9qjwKC8NuXg8aZEYhikbrN1vMhN2SNR22yzIp9+c1iJ9d7LzuHP8Zy055Um4eLppxdfPdtdmuM1YdcIFQKZMz2139nV36rvelgpy0oSSh+3gwWhh6UeoWmFHHhxkGmhlKXrWuyUQo6NfZOK4Hlmp1Kvvve6l6HM1ZhYIMC93AneGihxsZIFAbeltxYqcV0QvUaHMlDkqkabxl0GtzTG0uvFDVak/jTBud7p25BXnDqHfrv4GveNbytneI8ux9r7tgpuAwGBzcXXAGlYGTZW8Wp+335bQ2YbhurFW4hHDbRDGjOCB0pCIJS5TQz9PmXa0gNGQg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EA/21JfFR/kAhQ+nOfRYhWRqHJiTIIm/aGA1sUmltUw=; b=LouQETa9Ob3XEncsLraviUYqhKMygFLrjCDor63FfWQ3s0u4/ka4XsNTRHh5lffyZOHWaeg+/PItQiqDtww46BenEjSWxfnaPqCDHNqAIR6kiUlXUeBecCKOXMQ9J198OgQ/g+5YfvCmumQ5e+96Vm/HMCe2B1VFIoTBW0CKG+8lvFKKPdNB44BleK2D4l9aSHhwetQEzkuuLLy20YGe8qiOBVy6ycAaEOJ4k2cZReiY4q6r4Cxd5SpGLntKuFkoMguTkrQmSMQ/Gs81UsyCs7XgItzROyiKpumFnte0eqh1Pva56+7s+FvsqQDlinI4hcXUAGK73deHvk5PRu+pAg== Received: from BY5PR16CA0029.namprd16.prod.outlook.com (2603:10b6:a03:1a0::42) by IA1PR12MB6458.namprd12.prod.outlook.com (2603:10b6:208:3aa::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.28; Tue, 30 Jul 2024 13:59:38 +0000 Received: from SJ1PEPF00001CE5.namprd03.prod.outlook.com (2603:10b6:a03:1a0:cafe::7c) by BY5PR16CA0029.outlook.office365.com (2603:10b6:a03:1a0::42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.34 via Frontend Transport; Tue, 30 Jul 2024 13:59:37 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by SJ1PEPF00001CE5.mail.protection.outlook.com (10.167.242.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.19 via Frontend Transport; Tue, 30 Jul 2024 13:59:37 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 30 Jul 2024 06:59:26 -0700 Received: from fedora.mtl.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 30 Jul 2024 06:59:21 -0700 From: Petr Machata To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , CC: Vadim Pasternak , Ido Schimmel , Petr Machata , Subject: [PATCH net-next 03/10] mlxsw: core_thermal: Remove another unnecessary check Date: Tue, 30 Jul 2024 15:58:14 +0200 Message-ID: X-Mailer: git-send-email 2.45.2 In-Reply-To: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CE5:EE_|IA1PR12MB6458:EE_ X-MS-Office365-Filtering-Correlation-Id: af3c4db5-713b-4c71-bf0e-08dcb09fd9ad X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|376014|82310400026|1800799024; X-Microsoft-Antispam-Message-Info: CQkJVxW7w0RUdYxawDI39l1jN2HXXnmfWgqmtjydcFuZTUHF4bmkXix7ofhK7UatOR/DlrBvO6wSvhBojSEt0aTohBaSRPYZ1Y+21ow3op7J5wKV2hes5YfPr7HtAurcc2wfq/NYG4SEZK9bFqBEyutfx/YUgXOmXvH50Hg6GdDbitXUstGV8l/lESkpn2+6D36MJUGjZX2Q9OmmxE6vuS2ycibTLCfTcYfcjgQ56jXi53DVMEb5KmCKrH4hO91d83AZhagMrRqm64q4kiEbt3UmfNmwH+2f0VeRJeux4yikVzu3rBadKcil/CVYcx3S4481RlexwxJCuYO8t5LbmFvEjyt2FgQv6hL9XZKjtYKBfg6sXbRiJZXDLq2OYvR+AVC2zAcTyXP4jy5A0BKBz71p29B2GOK9PkgvqOAM1Dl60toebFlniK9OQLA+vaVF2WwumQsNRAkxNcP0DTDPy/bHt/4Y74A/e9kD+b4qHZD1PF1RvkKiSgOzzL1tvV1bgOq5KrvZ+kGnpN4EE9FzeSkLtVeOy7D2DvesQXjC6fd5SJ61KulXsEmUz+tedFCVWCnunrU/LAaTvV+KR55cbLaTrKgKulAT+4y+QFFsKSqf9PTEg2MJ74+rdf8eyCPn3bVclntGU1A/gvaH+K+PSCN1XSApjdJXvzGBlhqWLeajftB5lPPkTmwM3MGGMwJEHrOOFtXsGvVOSKIWRCYYEVlsobL2qC7v9Twju0ozYfcHYV4pd10edKzaWzd6UIbQY+qJm3jbwLMK589HVDDNf9z9TLyZeYvJmXA2vK5pM6+BBQ7myKxm/GwngsfwVFicE1N0zrUDyFsI7ocrFOpvDj3MElQJk40uXR69ZlNTbKcTsdUXtZxFlbsnBhbaVhsL/SlrhclE9GfCDKcV6+RqZJQZ9D8ee1bDcyIAQjE14YJpJYXez9QVe+xjs9LzXnHVzarVysZ1LKbzi/rmW7/TOS0acOLHBKnfOdUHMch27fqYk4g7tOiVmP37dLquwwy55enK6iVrMS6R8Yd3qoQbThH7eCSa0AxzFMkQk+l7qOR/ZcflhHIFAubjcpGZKbE/djiWSdXYV90fFNOncTYy7hS+GBm8Ut8G27DG3rPGNttOgH0RLaxZ0fauEWOKWgs4sL7+3anHW4lkLoUbxyWNTmdl1LuYsSUxeul7g/ey73H/BARTqo9KUQwzaSDNIVa2UW4iyd19G+oBgWRmzsOdgpatHy/JmjK2gYBN5AAtJM1PSkgoE5piKUOAMtOSNOTo7FPMEfrzYdOXatblnhsaMrrelHRMfQeFcqfs0kmgBZ1Br9ehvwjj9vPuTBF9ey8e4eW3DuMsdoObGwM8KVS0Z3gX2jqvlVD3WRqcx4CjwWmSsstK98bJ1qGtohPIW4p+nfPpvZ8vsELbxov1e4O2TU1J7uyZ9F/PReJIi+wPWSuhnoPjer1n36uDax3A9aMA X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230040)(36860700013)(376014)(82310400026)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2024 13:59:37.6848 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: af3c4db5-713b-4c71-bf0e-08dcb09fd9ad X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00001CE5.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6458 X-Patchwork-Delegate: kuba@kernel.org From: Ido Schimmel mlxsw_thermal_modules_init() allocates an array of modules and then initializes each entry by calling mlxsw_thermal_module_init() which among other things initializes the 'parent' pointer of the entry. mlxsw_thermal_modules_init() then traverses over the array again, but skips over entries that do not have their 'parent' pointer set which is impossible given the above. Therefore, remove the unnecessary check. Signed-off-by: Ido Schimmel Reviewed-by: Vadim Pasternak Signed-off-by: Petr Machata --- drivers/net/ethernet/mellanox/mlxsw/core_thermal.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c index 394e4fd633ef..afd8fe85a94d 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c @@ -505,8 +505,6 @@ mlxsw_thermal_modules_init(struct device *dev, struct mlxsw_core *core, for (i = 0; i < area->tz_module_num; i++) { module_tz = &area->tz_module_arr[i]; - if (!module_tz->parent) - continue; err = mlxsw_thermal_module_tz_init(module_tz); if (err) goto err_thermal_module_tz_init; From patchwork Tue Jul 30 13:58:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 13747431 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2046.outbound.protection.outlook.com [40.107.96.46]) (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 C0C8A19D8A6 for ; Tue, 30 Jul 2024 13:59:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.96.46 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722347989; cv=fail; b=kbmmSnsj+ZQjbq2cRunp6Ha2365ti7zYAKUSA/rM2h2i3fkq+6HZgrfWGt5mjiuFrs5LS0+w3trDc9ACUHOj9jBu++tUU9EVFd4TACe0SkfakB9xiSGhs0SE6ETk6bol0E+C21fbNQdJhPHyHoSq3OnUtUViwR3p6NdnVCyv+p0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722347989; c=relaxed/simple; bh=uFHRf4c+7GEdxtmspE6SVCPPlOcY1mQrM+tzzy4rXR4=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=gDnRSrF3H8UVP7kISrFWu5isOtyye+j9p1nThLwsTXzetYfoNpvJTmQT684uyhGCLwXjo2KV7lOs+EnM/wHQoDpdkLQReURfL+RSV3xQB4pRChbqXPguohxaxJmiVLco+MtMABqQqBsIXxgGDk4jOl/2mR9S+ev7YixT4mxMy2U= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=IvwKo1rZ; arc=fail smtp.client-ip=40.107.96.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="IvwKo1rZ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=nCn1NkVr1xEw8Y9qk7vtbSYknG1izXGbliv7mYSRx3KeYhNM7EgkQzLjIpGkEqUa+l/5CI2Ce5sEZcQJathj1L0iuGXVKR9nbquFtbmU9KoGU85G6S1LKI/NENmdv102bolX13sGK3+pydrUPpH0cb/L7rrxSiyQQAfz8o4zCZS3iSLCP9Fs+7sIUxM+gdrjn+aWHA8uSsBwGfi16pqUCH5qzZKCBWolvkohWShkwxNnRpERvllpe/su0rpkKcowIC2PqyQUGMumu3eVctMYoAhhRuGVd+DowzlCq0T39ErmPUssKsXGF4TroYAQJi6vqckZxd3MxSUQik3phB1ytw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qc6H7wAaw7Iaa/I/xRoovHQxGxXBXkuQFlUYQJvAgv4=; b=xeMy1KWH7JeYtBbKBOnrQR57vG5ekolILZabAIvZkc02CXaN19mhdxeW5wmLhjmaB3hwNpLoEohUJrp1F/NZ77dw6MxVl7LfHmvS8loHyvjCdngpSVkBVEAt5ySQSssggvKzl/wxMJbOekU4Kgc7aqrAlz6srjWNQWVP6q48mhrvmQliI1GLNADu2uR5gqYXhTRu0TqSSTidDDfu5D9FjVzuHxurCzjpFDAQfzU0PZpj76DRUpyAmL2r+Ul0NODIYPF0yUaMN7UylK/9dBo1ELHFGjnrJKmdfPaazdSoE2wsodGWhTnSPjelMR4nwvCev4XZ/JM0+Paqln2ZUjRd+g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qc6H7wAaw7Iaa/I/xRoovHQxGxXBXkuQFlUYQJvAgv4=; b=IvwKo1rZ7iveHLG6FyFj2K7GBOl23+9lJOPHYsyQ3A56vCrzSXj/SlfHwDZGDUzmtywYEN29smAKkUTPSC3KU35MKjqE+urco1y7iHBiRqJbcJ05rRJDLLWMx+k/EHVkvWiJzD2omeRS707ZZc8F3Rl7mwVfRT3aZYfmq4EtvAmzkP+L+fg6KnsohrpnXswuYBJUdgDA1gncjNNrHl0Qyx6DL2I2eu+ADOidtZdt5ZlWHwdWkZhfPnhXks7AMtgWhWH4CZG4Q0wGUi+60qx9A/yMHL3hI6QVvNgssFBFlT0JwLop1x5aAWWavw1/wiGhO1f13yZ1dj9w1/bdUMkhyA== Received: from BY5PR16CA0033.namprd16.prod.outlook.com (2603:10b6:a03:1a0::46) by SJ2PR12MB7821.namprd12.prod.outlook.com (2603:10b6:a03:4d2::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.28; Tue, 30 Jul 2024 13:59:43 +0000 Received: from SJ1PEPF00001CE5.namprd03.prod.outlook.com (2603:10b6:a03:1a0:cafe::4f) by BY5PR16CA0033.outlook.office365.com (2603:10b6:a03:1a0::46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.35 via Frontend Transport; Tue, 30 Jul 2024 13:59:43 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by SJ1PEPF00001CE5.mail.protection.outlook.com (10.167.242.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.19 via Frontend Transport; Tue, 30 Jul 2024 13:59:43 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 30 Jul 2024 06:59:31 -0700 Received: from fedora.mtl.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 30 Jul 2024 06:59:26 -0700 From: Petr Machata To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , CC: Vadim Pasternak , Ido Schimmel , Petr Machata , Subject: [PATCH net-next 04/10] mlxsw: core_thermal: Fold two loops into one Date: Tue, 30 Jul 2024 15:58:15 +0200 Message-ID: <81756744ed532aaa9249a83fc08757accfe8b07c.1722345311.git.petrm@nvidia.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CE5:EE_|SJ2PR12MB7821:EE_ X-MS-Office365-Filtering-Correlation-Id: c463b1e1-f0c3-4ae8-6f2b-08dcb09fdd29 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|1800799024|376014|82310400026; X-Microsoft-Antispam-Message-Info: 2VdUIJwxNsbe33BwJDPiGA70icOIi1x5jOtsWUgXeRGcXMLaqtLF2b9wjhwLQGk4ZTTBGurV9C5KKEetW4AxrjTSjbsnJwj/jJiTDC5wcP42eTImXrNvkkIFnKI9SHUEAlvwKT5C8FIAHu5A1uMpqZDxuesNjCDFs7lS/sY60qyXmlujUBVdLuUslyHCWqEgHLArcHOHN+nlrKTLQKi+nNa+5Qx/RCjPToh6Qriu3OUVLfpB5ibirWDyIvkom4pkMiNDzN8Ly5JZ2BhAKatwwtptEyyoiSziyGIenF0hbBbJlK1G7GhsOSXRjeYsBjx469O1j0KmzOLX5QX/CXobDQLOC873nXn7sd2pzpsYvYR0Ha8EQRJiadqeiBDOenMo+genoGzqJ3dg7vmFngApkjfXKhrBR6UvD/af/+mU8u6LeL2/71IXGMmwwX5S52/lnj1NYJNwTNQbxDd8rlhuPL7pSBpCGIMq1BbTiivm7inFxgOe+vGhoef8fxwiBF8AL+ZnnspU/esSDasGEZ33/wMV17cIr7LD0lbIr61AkkU3Uzk8gGYCsBQnaZJjfkqMWooRYaeceiifSe/8A789WRiV3AURtX5RLxCqyTdNJ/qIoFYtmRGEfVBGzdONa2OKU26P0S0ytu232vRvq6zUBVClneCb+vUEY4h15bEOmnPs8MmiiIk3/EXnZshjlRsCPO99Chy27MFJXFrCP6oPbFwiIhppIQ78MD94m98GE6eLBzCNLrF8aIskntgrmzAI6GiakXhlouVnnY9WEy/OmE+U32Cld4T/UGlY7HXaOXy/VPlgIJ+burjhxFpO/XjJO059YV78n5Idxrbf4UJ6LHPIZ3dH0HfjZJnyOAMsQhmIMFMS/evt0Rb5Cw/KyZr/015Kbipu5/Yycpjd8V6h1Wimlc3fxETz9eqB6R8Q+ApeE7ISYgDpOtW3p1LttxyAqR3gDkdpzosxxHQnK8vuWKsNk3eaXZZ7D8D++Nfe3l6+RLj1e6mlb/HsaCIuIQVmawKatC2Ad70y+QdZ+YZWV1o5s1Z+k2nv6OJwqzk3d38ZGdcYjDZCbnaFnkd6jVV7WeLT3s8L/0BDrrJP68Xfvo+8ABTogZLaBReOUy4pOlMJQN/8NJW8Dvs/fQwCmi5qoNUQcysYVWKVFoELv7U0eGk7N7F6BqgjVzl+xURdAsGHrDofX6ap/yj3pJiWDUZRhZATn1+zzFcGR5RM235LLqkIB3G3j9v8hd2lj2dp7KW1Mb28JsBZQtkvP9HQCidVDRdh6PStKH2Apb+uiNBk3+LgGARbQy1QwMehoaLlLVZYjBpnCqjNxccAfqZwfn6lj4SWTBdWGe8yt+Gg07l9olWoUDxg1+7j1zXJmKCL9lz9qirav6TSVf4ArdqGXzs8m8PvIG/+EBs0TyUlaNXQSOmHRiwUgKUUbxNScn5x8nmdd//B4ka+VmrQXtqYp3/w X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230040)(36860700013)(1800799024)(376014)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2024 13:59:43.5286 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c463b1e1-f0c3-4ae8-6f2b-08dcb09fdd29 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00001CE5.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB7821 X-Patchwork-Delegate: kuba@kernel.org From: Ido Schimmel There is no need to traverse the same array twice. Do it once by folding both loops into one. Signed-off-by: Ido Schimmel Reviewed-by: Vadim Pasternak Signed-off-by: Petr Machata --- drivers/net/ethernet/mellanox/mlxsw/core_thermal.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c index afd8fe85a94d..b2a4eea859d1 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c @@ -500,10 +500,8 @@ mlxsw_thermal_modules_init(struct device *dev, struct mlxsw_core *core, if (!area->tz_module_arr) return -ENOMEM; - for (i = 0; i < area->tz_module_num; i++) - mlxsw_thermal_module_init(dev, core, thermal, area, i); - for (i = 0; i < area->tz_module_num; i++) { + mlxsw_thermal_module_init(dev, core, thermal, area, i); module_tz = &area->tz_module_arr[i]; err = mlxsw_thermal_module_tz_init(module_tz); if (err) From patchwork Tue Jul 30 13:58:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 13747432 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2087.outbound.protection.outlook.com [40.107.100.87]) (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 17DC41A2C04 for ; Tue, 30 Jul 2024 13:59:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.100.87 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722347999; cv=fail; b=pT6sHMEX2sSgtWE+yjdyZXrkZ3/tn+gvHw2C1DSo/j5U9acVAwuh6h3HP9RajKEZ3JaPQhONR4+mbY7rgr/vkkB+d5aIdUj16vYQh2LqdzzSxAz9OCQPJk1OFBrvahkQQlAeMMZX/lB8xc+QtOdw5WygmS/AxIn5Gf8v8KmjWcs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722347999; c=relaxed/simple; bh=Ji1v34/uUkDAQN3CIe/AoHRE7fJV+la3if05RN8m+rg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=PDc2YIs3fJKvuPuaf6uFgsZ74A4Ww14adstiWVaNrq7qG+0UgMzpYq9E8gUn+/KYeD3mOpMOzD52fp3CWECIF7YHApf8p66i3ja1NIVQMMoM1rA6vfzHkS15HS+fHWC/2dOT5ILccvOU4OlwzO6yBZYS8nC8y9jLCuCQvxHvk/0= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=oiRtoMpu; arc=fail smtp.client-ip=40.107.100.87 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="oiRtoMpu" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hLbkw/HpyfQfhJ+XGMq0S9vj1REEhPWd8gaqPWjwmEFonKn5YnwqG07XUhnAu+FD9WHzanxpjzGGJcO8EZkMRu1bu/F47o0CqaoBzI1kf0cZA0OwpFqg9LJ1Ce6DC2RFtsHAKaEg0/qkWSAdoB0Ny/Ipq0DFSz656tioezfQ4Dj4dBs7HU71Or6PjXAyBFidtP60Jya/QH6vLn9Wx5j6MhLnFxEkfoVRbkpTOjMSW7TwTptMjvGrtUr+ya3sV49Ea//hpfBApstqU9yU5FJCVAu/g3vg4+W+sim7eyUUBJOZEfJaZXK4vd7Ba6Bp3HHd+eLLV3AY9VkkMsLL5RXQeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=SsvJM7NECxB6Y9qEgqKE4cC8CJDLCjTYJVDzH9al7R8=; b=M7NNQS9jKz+zp9YVY8JewN6cy3ChXzrv4LNiChQXm7ZcWrBE3tMrplk+e30sjaKkdD7rUP2+ac2ztIxJcQgyOCIceJ6X5eFIRQ8I29ZhNjYSa2HS6B21EqTq91V+ePk1oRNfnwoLZEAJFnL/jsXSqF92I+U9/sQYIXGEEhLrO5Ah9chJSdCZPDIJ4WsBAZ2EXdmFuLA+4dl2W+o+RFsP0QyF9nAq1hqUlcfPs8o5gH9jWQZh8puenRJivfofBmZ23ffJx0LIWdLGPwPMmJgUp0qDRLx7jxCiT2243eGGQhBY4C39cgRAUtBW6DBMzGlDxlj1prrvkm7bdimQXl213A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SsvJM7NECxB6Y9qEgqKE4cC8CJDLCjTYJVDzH9al7R8=; b=oiRtoMpumD0HPq1/RJhEGU5ouUOSeFhS1V6b4j3ghBamRBxwisuzjKk7O/G38GBYOjT6AHAQD1tXris9i4kcQEubblAc6ThV4dx0wXTVik5WLQxsgAZlnCQgAHLvGCWdzm7AZaqMf0lIqidsuONJ2EnO9+36wI2XO98MS2NoPyna/5jfcRip7SZtgQM2jhF4EGfjPVQrXgA0in3pFE5X434SHL1PFeOlejFMhZyRRS6ibLehDo3lTRiM9QgBH9DlKs5n6/+aI6neGQBlw+I7ml798XqEl6n1DYqZeUyN9ypYitFK9NZjhgdDdCFgXsGfxip1fM9QvHKe6jOrlO+JAA== Received: from BYAPR01CA0011.prod.exchangelabs.com (2603:10b6:a02:80::24) by MN2PR12MB4440.namprd12.prod.outlook.com (2603:10b6:208:26e::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.28; Tue, 30 Jul 2024 13:59:52 +0000 Received: from SJ1PEPF00001CEB.namprd03.prod.outlook.com (2603:10b6:a02:80:cafe::17) by BYAPR01CA0011.outlook.office365.com (2603:10b6:a02:80::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.34 via Frontend Transport; Tue, 30 Jul 2024 13:59:51 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by SJ1PEPF00001CEB.mail.protection.outlook.com (10.167.242.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.19 via Frontend Transport; Tue, 30 Jul 2024 13:59:51 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 30 Jul 2024 06:59:35 -0700 Received: from fedora.mtl.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 30 Jul 2024 06:59:31 -0700 From: Petr Machata To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , CC: Vadim Pasternak , Ido Schimmel , Petr Machata , Subject: [PATCH net-next 05/10] mlxsw: core_thermal: Remove unused arguments Date: Tue, 30 Jul 2024 15:58:16 +0200 Message-ID: <563fc7383f61809a306b9954872219eaaf3c689b.1722345311.git.petrm@nvidia.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CEB:EE_|MN2PR12MB4440:EE_ X-MS-Office365-Filtering-Correlation-Id: 43d6c03f-a13a-4b74-1bf2-08dcb09fe1db X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|36860700013|376014|1800799024; X-Microsoft-Antispam-Message-Info: JNwmLzinPynt0JFkM1RVgUxFolYy8rv9Scjm6gZZzv8/viKKkHQGxme8EJ1IAvIpao6D6g9d2xJGHE6phYQvbghXojb/K1kJRhdFKbq1jCpG7JB/s7fTnGTMPfi2wloU+F4EMixVx0fg4zxSJb+pwjnZe3vqAjzHatx3uYUttp97chX40WEuqgBZiMJoyqklM9QVHAMMJd5CsMpUtDu65cC3RG/t/o84nXDB9ILnqGwMlY/MwBKJV3haqOoBQzlylsNu7jWS2PwlZ8LxPINprWk8850WA0MzY/9g+/9YVV0363xbKGTRiK88h+xcCjVYk0ZAGg3cAvI6HlVe9+M06hQJ2JpAE3+ibvaCJMThAjiEtU9uChpA088NCaNupxwo4WUD0STyZzgQ8I/IULAe/lqZlaquBnBUBx88AJCpaJ9SpXcuqC7sHHS8LnzklSfykK5e6RRdQ7OaxFuwBTuiS2hgVhOl6PXTpp+Ohw2vrvjTey1E7wx6ryl22IT2Unnmx2ET7V7d7sl8w3Byac7DXOK9+TGcgbxOKX0EfPyL2WSiJTAr/rxUvUKc0hhWfOEwVGOzR6bwysZkIE+leo1hBAne/q9Coah+VHtYyJiiHzD2mD6KNyOid+t6y6XAlVVGXr+G11eoZEPHeokJmxtkEOp2vx6Y/n2MM10EbJBMMcSYuKOCxQ89GmFKouPe8NsY4dUsc4QHpF7SYuWbRuD0pxiAnR08WcKydHJq72fgHElJvS27n8TvPrh0iVKwGj8g/OWf1oEv6T+ZYKAHGuOGwKJawNJemIcyL2gMZSrygD78yGnNg3FFqK2v+0wwxVOew0YwURwk/UWobmhT+kDZNuiYydZbkSdY915nFGmuz86odQP7uDvz6fsyhgR78pvdVKCyNfEU+oxvm9OA4l1vOXslmoSzbinL4wu54cLVfigLI+5zPWSQ+Ly+oEDUXq1ymVt8OS/Mp//TOafiOnAA3SMMA4isWLznlfI8SOeya7ej/B+Gu94za1GjQYzoreL1RnPibABdCgcDbEh24YsBUiKtYBLJcrpQy2vENFPAVlb2P+GoZ0IxUpF7r7nVZ8yZyiJeuUZBUTQLKRSQ8zgcisJ+W/6rjHUwnZK/tqQoroPxekhxKlFOYciZVfAgxDavHQSywFfSBc0B4XfwHfa0AmZYH65hrcEgM5nlDS10A4LRylOwopswnGNgfsGLp5S0iq/JJHO5c6jUTh8Iv73U6KouaLTisfrfUsLZd3R+qU/Jz3tXX/gvb3WqKeYc09BeKo0do+7jQzp6tWW3wQLP1b16OHBTrFr0ANZXcQj8/nH0F83cVrFOa1CG3fyUrAri5Dto+HiY2UbjLhS205EO/s3sCaaX+kIbzECoTJYoXo+PJh+0wENJ0ze0ikEuJGwhlDVh+vDOghKHq68YCEPB9TfzC9bRWzKvLB6J5w1Zk5/uYY/2JWgw4vNWbO+EBhrV X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230040)(82310400026)(36860700013)(376014)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2024 13:59:51.4039 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 43d6c03f-a13a-4b74-1bf2-08dcb09fe1db X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00001CEB.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4440 X-Patchwork-Delegate: kuba@kernel.org From: Ido Schimmel 'dev' and 'core' arguments are not used by mlxsw_thermal_module_init(). Remove them. Signed-off-by: Ido Schimmel Reviewed-by: Vadim Pasternak Signed-off-by: Petr Machata --- drivers/net/ethernet/mellanox/mlxsw/core_thermal.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c index b2a4eea859d1..95821e91da18 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c @@ -446,8 +446,7 @@ static void mlxsw_thermal_module_tz_fini(struct thermal_zone_device *tzdev) } static void -mlxsw_thermal_module_init(struct device *dev, struct mlxsw_core *core, - struct mlxsw_thermal *thermal, +mlxsw_thermal_module_init(struct mlxsw_thermal *thermal, struct mlxsw_thermal_area *area, u8 module) { struct mlxsw_thermal_module *module_tz; @@ -501,7 +500,7 @@ mlxsw_thermal_modules_init(struct device *dev, struct mlxsw_core *core, return -ENOMEM; for (i = 0; i < area->tz_module_num; i++) { - mlxsw_thermal_module_init(dev, core, thermal, area, i); + mlxsw_thermal_module_init(thermal, area, i); module_tz = &area->tz_module_arr[i]; err = mlxsw_thermal_module_tz_init(module_tz); if (err) From patchwork Tue Jul 30 13:58:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 13747433 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2073.outbound.protection.outlook.com [40.107.100.73]) (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 1DF251A2C1D for ; Tue, 30 Jul 2024 13:59:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.100.73 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722348001; cv=fail; b=ndDym9tvuy9hx112Gt1HSEOPazWAkHDbbsEaJIuHW4WoljUDmLfhzv+QWQUkFQBlkM4RpXD8pmnXe+oFcqT7Ufarv2GoX9Bm1MVaYxynSSqPRJhV4FWIt03XKITM4VbuMMoAyXMdYS+cK0l0j/pMnjDm3BdK5GO7J8AivfGpGd4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722348001; c=relaxed/simple; bh=kVd42uvWQoorMmiHsksHFhlZzQ10f2Fdh5LcnY74I1s=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=aw2tNtFgaWZKvdOk3QqK8+uDx8+G9B8lqDg6nH//qvDMXECr0T8V+z/tfGHAlP4q60491fz4kQAaV0yliczCm3gxCKHRpaksE3jjQp/vSirlAUjxdLfcKJWDkChfXjwAWYmsRwRQYIdy7f1Kq9SPEVdJT8cR3z9v9k4xp/3WiSg= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=KBycIGBz; arc=fail smtp.client-ip=40.107.100.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="KBycIGBz" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=d3jhL8uwS4shdhGqT01xSx1HMOlBnB2sip17tO8Bk3A8jwV8ZxlpsUXNtZNCMZCr6I7QneVDnzq6ggopyx0nsWUO8bxbh40resGGZLtvoCl/wnleZLCzrBWdFlBeVEgzsIYCYVVyuk1GO2DkWZg34DZy8w0eaV4VMB5NBMYDsxWJHKruFFkUsdKfazS+Blp8DhVJU++nCYEwHV21I56YMd9OfS9QHYtRHi2w6OtkRktHSozCxjhOO8mIcinoHIzAs1PLqxUAQ2OXmTRC29tMYSN3caWjcSUa/1Y/RhLWlpaRebUBIu8/e8OqRbS7DaSSEKQsNVcTTPOGfoRspruwxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=0AI3sMFSYP6r5jB3ysD51JzLgSJzOty6EkiWMw/wwsk=; b=K6rlR0u2VKvSoMbiCqkRx20qhQ+/EXGAaQIazd/740sFkwb3F19ZaIe30G/gqnDibAZB94d8gtui+fpongnSFOkUA51iHuNHqk8/j4Ev+uB6l+8fPaqzTkisTT+KCn/YzM6+n0h/Fc37C7Ci/MYuaJnkpQywHjQvIrfhq4S6cPoLe31Ey9Zp2KalOkuhxkULfV1ZquTnIDyO2DH5adfTK44CkT3hXGfNua/aI3GAi0ffmOnUXM4L8xE/OrgJr1Ei3F8FUh5RE8Dcq1s+clk+J4+g+MBlu1f5vbclKxOIkO7AIQ02pOrwZjRJw5D0k4cl+iC/EhGQyjeaKbYsfON9zA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0AI3sMFSYP6r5jB3ysD51JzLgSJzOty6EkiWMw/wwsk=; b=KBycIGBzxlUtyZ8i5yq1Lyp9QbJ9Slqy3nq/6AxioRLxAonWAakneVHoAgWAfPBqGxEIv6bu/AxjQRYmyXcSy/kv9nht+MqW1U7EGsg5ODcqHCUzioX/H6CT6/EOtfHf8DLl6mdjmwFx48At1O0u+LooVTOEkiCncG63J1E6j+z73L9+AkneKrGk5VZ4nwarraWWTO9dEbaNVECZI9nHR0rjJHPiEiywhGjaqDWgvQ158IWz4Y8sHkIWhyrDkbC0nPN/MfSCylEQt4kIycIvbdZo0WKTmEjhA2f8kitj3rtH1OnNIPUNnUyo3FPhKeg7Hn7ugoTktocXLmYiE2wTjw== Received: from BYAPR01CA0028.prod.exchangelabs.com (2603:10b6:a02:80::41) by CH3PR12MB7738.namprd12.prod.outlook.com (2603:10b6:610:14e::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.19; Tue, 30 Jul 2024 13:59:56 +0000 Received: from SJ1PEPF00001CEB.namprd03.prod.outlook.com (2603:10b6:a02:80:cafe::84) by BYAPR01CA0028.outlook.office365.com (2603:10b6:a02:80::41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.35 via Frontend Transport; Tue, 30 Jul 2024 13:59:56 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by SJ1PEPF00001CEB.mail.protection.outlook.com (10.167.242.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.19 via Frontend Transport; Tue, 30 Jul 2024 13:59:56 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 30 Jul 2024 06:59:40 -0700 Received: from fedora.mtl.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 30 Jul 2024 06:59:36 -0700 From: Petr Machata To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , CC: Vadim Pasternak , Ido Schimmel , Petr Machata , Subject: [PATCH net-next 06/10] mlxsw: core_thermal: Make mlxsw_thermal_module_{init, fini} symmetric Date: Tue, 30 Jul 2024 15:58:17 +0200 Message-ID: X-Mailer: git-send-email 2.45.2 In-Reply-To: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CEB:EE_|CH3PR12MB7738:EE_ X-MS-Office365-Filtering-Correlation-Id: d6522801-b6fe-40e7-81f0-08dcb09fe4cc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|376014|1800799024|36860700013; X-Microsoft-Antispam-Message-Info: vinI6H+FLeYDIlpQzHwIfNEyu9CXBCdhSBoENozT0tAE8uDhlUWaK93mD24Gyv17C7MtNdu1oOh7R/70q7G1Z1PM3z76DvXX9BChHUGsiiH9gND8DXXwPcPk8848LakDO1cgYjLMfz19281a+EPr6YfuDeVbuPNi7DL+z/0JXjFgCksjEbV3zZ4bL8lyLCMwgj57Z6iu80GCxCIWF8IHbh+duVEuj4grDKJnHhquMLhGl1ZVu8w8HeUNBVfoXIMA+9KOzn1z8GCIFt+bVHDuQbabXBbMPG+9VGrgAND/e4X+C4vsylm5LFSpwUesIpbsapAMGX6M/TdpzjINiReED+M0Mnz0q63bsr7X0Fe7FxUWOfCIrqDLtokk3Qs/Kp44vD0pVmyxm1NNssBYMGGZLyjqdd47SITtvYDKv2DJJBrjJgLF6/wohGyI2VV6crEbGtyqNceJfgZE/9ypgiCOumhXZ6+SfvYGJw/SszbDbDBZwrVVqTDaqdn/eY47VPsZJBVqTSTKfFX2qILcxgBoDa0Ov5IyLVSXSQR4Y3WaG4GAdex+VottzM/YgWJ3bwVGf0JwmhUXzmYXjKbvKWPCWdv5pMmlQJHo3AkBw7Yf5YRdC/RdgYYWkpcaiIYoAzzJev8ziXfdM5XiWF+INkfGHjfn3LGlg8IW2DlsnhoMY3x7IudzJy2hAIwr/AobfIICLlooEYeUGT+FX6o3D4/mRRRsoEoifFsa7HZc2jtcT52EYclZ4GBajh4C+aE9G/2DFY4plFblwCw8uY4WqPWBKel0CxAsLPRI5k+XkIcYOFzawNO4gb/5rYALmqqhzWXlL0By2HeJxBXNsrgbf8vfCU+JfKbApwSxxfOrywqSnuTi1g/To+nfj4QS8+LlvImygCk4++HQaTJmAR50ck+yfllG3gCPcUYFOP8Fwz0KAv7//rHOffLm24XHhAsk+1AntJ+JGu0YfnhalgF5baenowhHtsojZcdUK6jzqTfskqf/4FrnxLfn0U+7P1PQU9WpFcqAv7bLqVgv6nxQiEpFy2M/paFGI/yhT1Ig2jc/yZkAx1ivLe3SamGo3Xy54gB74KzAgGOpe/l05wXuQ0bUiYeMkFb6ksld0jY9E4bslZchN4fubTWpsVuWwRx5ceHPANf1zCtxpsuYTfogpXesxPv+LXDGTQa91KdXtTy/6TgpPzD/OPJ9ncpy63GuGGpkM+bgz+icKJ2x0WD8wx0cFoSoSKHqwbUKfBXhZJ9XzLdMhVJAyJolJSlqrosszm8emnnJMtsC3uD1QAokubTZYaI8l1G8YwUjSm8epCPFGq7FFdjg4ueglKSaErCSU9g/5/xSPOS5vIG/BFEK1USYu42WmrdyZXyx7R+W0UjygxyI/xqRzKAXV9mapL7GSFm8mO1rDKziEp0+yiDOjwuwQx5wyJ8y/eyZOA/JSa8gtf5kPpn8W5qvVkbOLannvxdU X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230040)(82310400026)(376014)(1800799024)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2024 13:59:56.3258 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d6522801-b6fe-40e7-81f0-08dcb09fe4cc X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00001CEB.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB7738 X-Patchwork-Delegate: kuba@kernel.org From: Ido Schimmel mlxsw_thermal_module_fini() de-initializes the module's thermal zone, but mlxsw_thermal_module_init() does not initialize it. Make both functions symmetric by moving the initialization of the module's thermal zone to mlxsw_thermal_module_init(). Signed-off-by: Ido Schimmel Reviewed-by: Vadim Pasternak Signed-off-by: Petr Machata --- drivers/net/ethernet/mellanox/mlxsw/core_thermal.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c index 95821e91da18..36b883a7ee60 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c @@ -445,7 +445,7 @@ static void mlxsw_thermal_module_tz_fini(struct thermal_zone_device *tzdev) thermal_zone_device_unregister(tzdev); } -static void +static int mlxsw_thermal_module_init(struct mlxsw_thermal *thermal, struct mlxsw_thermal_area *area, u8 module) { @@ -461,6 +461,8 @@ mlxsw_thermal_module_init(struct mlxsw_thermal *thermal, sizeof(thermal->trips)); memcpy(module_tz->cooling_states, default_cooling_states, sizeof(thermal->cooling_states)); + + return mlxsw_thermal_module_tz_init(module_tz); } static void mlxsw_thermal_module_fini(struct mlxsw_thermal_module *module_tz) @@ -477,7 +479,6 @@ mlxsw_thermal_modules_init(struct device *dev, struct mlxsw_core *core, struct mlxsw_thermal *thermal, struct mlxsw_thermal_area *area) { - struct mlxsw_thermal_module *module_tz; char mgpir_pl[MLXSW_REG_MGPIR_LEN]; int i, err; @@ -500,16 +501,14 @@ mlxsw_thermal_modules_init(struct device *dev, struct mlxsw_core *core, return -ENOMEM; for (i = 0; i < area->tz_module_num; i++) { - mlxsw_thermal_module_init(thermal, area, i); - module_tz = &area->tz_module_arr[i]; - err = mlxsw_thermal_module_tz_init(module_tz); + err = mlxsw_thermal_module_init(thermal, area, i); if (err) - goto err_thermal_module_tz_init; + goto err_thermal_module_init; } return 0; -err_thermal_module_tz_init: +err_thermal_module_init: for (i = area->tz_module_num - 1; i >= 0; i--) mlxsw_thermal_module_fini(&area->tz_module_arr[i]); kfree(area->tz_module_arr); From patchwork Tue Jul 30 13:58:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 13747434 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2075.outbound.protection.outlook.com [40.107.237.75]) (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 34A4A1A2C38 for ; Tue, 30 Jul 2024 14:00:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.237.75 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722348007; cv=fail; b=g6w4KFVJS9K22I5SuPCp3oSATbnjIpSx9u1awhfEljycioNH2oY/pRC693W66K+xzei+ZvwkgO4LZzp8+2HvdmiplLOiiORqralSVNpjQxXGH3XPZebvd8duSGjCWou2tlKQSpba1qVkFOZn68CRh63UPofIcuAf40bBisk+EGk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722348007; c=relaxed/simple; bh=ikt5hmK5nU/IZi5sgSc3KktoiRHD4+hM4F+WXDkOS/Y=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=OTgHfLkdaGg70mG6uxM/ilWZkHv+ThNv/s3+4IJQDgmG1P/ESv9Bd9JtUHHkhQAOmz9k1KmCbuuImmckEcM9AdUEPa2JBp0YlDcjzxMnhap2DxCGkd+XF4YGeN2aEo9ul0fLEpIhClTp7Pqq9dMMW8pFAzt09inlbprvAagvMN8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=GDl6DvhM; arc=fail smtp.client-ip=40.107.237.75 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="GDl6DvhM" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=P6wDvHN40fHnXbpWpoSwWQbRLLntGU1ebxXN4NU82dR6pbX+wlts4xiFFefXwqDacXdQzROnMfzXinD9glGMr4dUwX/NN15M95NEg+EP8fQedpH6HktZ16WY1QN8AxBwJSkqrdQUk0EyCxZXnovuY4+vhJ/9gbH4bvwFPN3VxqEmHJsnCsxhn5AJK+CtTSVhbo0ZPpWCUNnDctUCNFsv4+1/bTRmMV1k7UdWTe/1+RhW9kUCpAYBVnqXjUC35WlKUykpect8MebaMUoVvqvWaO96vsCPPJ1+x/upl6v40oUWDNtPohlJEVAs9EbdeA+Xt/bN/nPtm8kzTrqJpT5zKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=IlpqeaXhlnBNL1/UCThPvFKxEWR58+K1IKswpOAlhes=; b=bI/Iu/3N9r12Sc3Lw3ZMgR0/Jinn2rypEUvQUkn6kfP/RCbtfrg37UZgVDGGTXD4AG9pRzurha1TW07jVW5oTflJ6dPagpbf16i5qPj6QiXGcO67rnxzriKOh5MFbe4E9gVqHyiljgnHubV3EC2erWXmiVjWOxNLIs2T0B73eRwvqVov54siP2GIHvnwVr6pDGjwabBkMZ4PxLK11AxAFYGLGCufl90vdRlbpiIaGLTqt0BkM6PLWhlTB8iS0YNqHhB1/eMN/Uur2W9zYe/tOZJRebMIbl6SMZ4uruyJBV8NES10xEUiVvwtlfuDqNzcGFeiTuQ5gui1xJNpNpT0dA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IlpqeaXhlnBNL1/UCThPvFKxEWR58+K1IKswpOAlhes=; b=GDl6DvhMuow+qKUTwQEVS2XU6nNLM1iNcsAapXSVI2f0NgZSEarBiIhuxFmc0QrX644LDCajMO2pRUaC4H0DccuuUGfFZ/2D1pki0OPRfDA97+JYxWCwYmFGxxyeaNoUbEAlyrAqO4cBWTctXVQ4Vx5IqIZZ0+KJ5BHiyc81a6ZWTP6VV1F82QSYgvYubXDTFcM4qK2PwKwFvJ9F/g4x5EfCmMysupTsxQK6VCLYtclpbHvr6F6vdrbwnbvKE008jWE9wgI4HJ4NjB0+LKgi3AnYYXqDlmrW1LlbLNbGaboAIP02xtcH9J9SCCgD8xXQJzjWTnOarerhng2/4Wjupw== Received: from PH8PR20CA0008.namprd20.prod.outlook.com (2603:10b6:510:23c::18) by CYYPR12MB8752.namprd12.prod.outlook.com (2603:10b6:930:b9::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.28; Tue, 30 Jul 2024 14:00:01 +0000 Received: from SA2PEPF000015C6.namprd03.prod.outlook.com (2603:10b6:510:23c:cafe::86) by PH8PR20CA0008.outlook.office365.com (2603:10b6:510:23c::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.34 via Frontend Transport; Tue, 30 Jul 2024 14:00:01 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by SA2PEPF000015C6.mail.protection.outlook.com (10.167.241.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.19 via Frontend Transport; Tue, 30 Jul 2024 14:00:01 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 30 Jul 2024 06:59:45 -0700 Received: from fedora.mtl.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 30 Jul 2024 06:59:40 -0700 From: Petr Machata To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , CC: Vadim Pasternak , Ido Schimmel , Petr Machata , Subject: [PATCH net-next 07/10] mlxsw: core_thermal: Simplify rollback Date: Tue, 30 Jul 2024 15:58:18 +0200 Message-ID: <905bebc45f6e246031f0c5c177bba8efe11e05f5.1722345311.git.petrm@nvidia.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF000015C6:EE_|CYYPR12MB8752:EE_ X-MS-Office365-Filtering-Correlation-Id: bbd8e942-44a8-4e98-696a-08dcb09fe7bd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|36860700013|376014|1800799024; X-Microsoft-Antispam-Message-Info: hAqVaDGWuBbpirkMEdAu/KuhPELposCJnvXjglZhkOb1ud9my5mMAXM4OcER3aKeoK+l3RBknnkzU74D11n2hQWsJlsKQ8bPz4kNqzIte5ZBYZ5a+9LF2cVwmM6trjyIPEs0mZMG4Aj6PYczwoSQMJkVSodgdE0xyOzYlEcK5IksBhBtthipOTKjuPeGI2Y45JbdjuT8F1rd+n0ozxdMoLOk6Syh0NQwTdxHDqIKL48ABA/ANkfO66DfXCI8VKQikVxdN2wEDqWPiX8ebJK9E1o9zDtp6FTwQlb1blRmXx2v6BhF4FdKaxmSKwA2YnS3XNxTVQfrN7J1BDvXNPLe69Sl64en/bnkVU3I5mUvMqVZIK+hb26LgbZogK96BaR9ScAb/8VYQi/hUGMF4x0tBSThTQKfNxmxSrzHFGE+oEgaQFqx/xzpHzwZKDdTp30284pPx9ZqksBjFNUbLj2m06jWnsw3IFfTsni52jAj7FwoVKukfMyc8txS9fo5413iO3foB7xrcEMHHBcYUGdcrVx4edoM+e3HBV2tZ/L9X/03EBsij6tToGMRWSiKzHofJ6RPPi39OdgJAJ6vIEikwEJYh+7JK3QJMq8tnGit5WWcYrszoMfZSWQsgkWJsCAARC/XbpBsFpOkApjLGe10tkGolsyhkCpPBw89kOr8O7ED8miYxlSkzRqDrcNUbjQ+Bp0EbXGzVUqbEKgDFT6V6oPUONJOhlXgVKNOREJd9rSe5BF5Wtv0lM7Gd0ydKkEhFOQnSQzmgw9PpastcFREbCiOhJmg4AvDdIoXLN+I+fsU00MS4xkoPpROY+7OWRpcDaI7Tt7+IvUZrjNX+UNfo7vJQr/GdrkF4e+LGcwZLfIx0+B1m0VukJdfwXg1X3LaKvOHBT87nZ/wIXdEdxfePB1jmwEm+Nl+BBmmfZjDEkZLjamzlhQveZuSZm28qi0qufFb0HIrKJI5LJNFPOJCGlOzdozYHkzrZF7CqDlxEic5RWPM3uDJJaovtmYLZ8U6QwDO/VwLfRxU1mvzuYUkPYcDOYBNMNyfNfhq/XimILJIZE9oBjhmfa6qU4RPIrtPQHWvzUBshUftVFYhwt+dVraVOJKwMjSuuCxGbhJA4tpzL7TM8wZo9PwxZibOisvanUqEK70qOejWa0XsUlr6WfEYVjQTUPVh5GikYpTizqGo843f0wFfu6t+NViwg2HaGE5ZRm623y516dGRYKXRWufKllK9ZiVLymHy6L+NBA+oSvDAku+4RYSO5qSti1+X4H49/PQOEoAUgG4aT4/Tb/u2/96go9Zsviw0OFfXnEQ3dLXCtJBUAVovOx6bt9N8v7aXuNKQ4fjcgpbtcxeRE3mV97FjpqTB1ldtYFfGe5Ucw+MeH77TnCNDu8vT+xw52IryBSY4tBR9dqKXoK9I9raXp2fn/NGYeAsUnCl9kff+Ysz6+znF1iJeRbaUiNi6 X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230040)(82310400026)(36860700013)(376014)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2024 14:00:01.2600 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bbd8e942-44a8-4e98-696a-08dcb09fe7bd X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SA2PEPF000015C6.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR12MB8752 X-Patchwork-Delegate: kuba@kernel.org From: Ido Schimmel During rollback, instead of calling mlxsw_thermal_module_fini() for all the modules, only call it for modules that were successfully initialized. This is not a bug fix since mlxsw_thermal_module_fini() first checks that the module was initialized. Signed-off-by: Ido Schimmel Reviewed-by: Vadim Pasternak Signed-off-by: Petr Machata --- drivers/net/ethernet/mellanox/mlxsw/core_thermal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c index 36b883a7ee60..e9bf11a38ae9 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c @@ -509,7 +509,7 @@ mlxsw_thermal_modules_init(struct device *dev, struct mlxsw_core *core, return 0; err_thermal_module_init: - for (i = area->tz_module_num - 1; i >= 0; i--) + for (i--; i >= 0; i--) mlxsw_thermal_module_fini(&area->tz_module_arr[i]); kfree(area->tz_module_arr); return err; From patchwork Tue Jul 30 13:58:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 13747435 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2085.outbound.protection.outlook.com [40.107.102.85]) (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 4553F1A2C3A for ; Tue, 30 Jul 2024 14:00:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.102.85 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722348012; cv=fail; b=lQiisGXY+5LT8lAuvpCtPhpYEqDtY8rIlr9O1NmZgwYU0QZsojCho7AwevZPox2Pa7LX+wRHbPoZfFZigC7EMEzw43OVM4eRiacu/S+iSlQFdsMKztpbvfAOndfP+xJt7580DHj16Zn+Cp7F4A/xLQVC1587sm4puL/tUchMxt0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722348012; c=relaxed/simple; bh=uZDLtyJt9/PkRVL8+5ZjpRua9kDSrCWjFmEaRpfeFVg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=AugQNQB5IY2dLT5wuFu4oNv93j4P8VxXCZKQCoKtOgb58xEVUcsDYEUbESfrTfclF5oKpLtCBoZBO5Tirk9WYNoJranKxNrGhIbuedxK68q1zaHeEvZP3ZMqyivWHpSKpW/5IM9Zb8y/XfiY2rKsedbYMDqfTR45EumoPx496+E= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=TsY1eaYV; arc=fail smtp.client-ip=40.107.102.85 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="TsY1eaYV" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=owsGyWpfu5i+x8COGTWxdaVjlvHBo3vdDWwmM/QKnpRMcy2174rxoDZQgKRzF1BioW+f0XA88sUgKICG6352C8X+GTDztYcEJ1as/C1vtlyJWUaIu1ESNgOt6/krTpu1OQl6P2sVxlAHe9TCPciRIcJbaj4eoz9byfMlNNEF6+bZPtix4Jkvw4Xaqva254OB7CF7NxctRJDHfPk3r6tzUP2cvgO54RZid5zY9RNuAH89+g2LbrN68O2QdzVfv2tRWThj3BOuEBcGTNXW+W0/bnVkWUW6EKytpgN8LL5BIPBWxw6KO4BUbTNPoKjGrvtgzRyLPQZcd3145Me4EPXTfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=KhBlg/MXWqCT96G7XJJl1L/i7r4Tzcz8z34K31ymIgQ=; b=MtzwyojYH8KeC6fFG13aCuDqTnHydl1fUfStPuyWFrQ9P/wpKBRXtvRv1bOjtFSFmbYzB1WRjyMxuloaZiStqnom7BtVh81z3ICXIn8UpbFFJv9ZQlw8zmlBL35abLimvXvFWB0aUqaxv5hMhM/G+MfJ7Mf9efmV+02ZcwnmaV0xOIHpUa/GwhOWTa73k5AcggSG+wV4hSOF89TVUYH5s4/l7jUYw9MpuYhCdRmlZbeh5TxgSGYRWuulie8C0Q6BSRl6HAiauBm0MQ8zBaRolOpmfFl2S9ZzS3TEw7LacEO/zMCxyCOhUih7YJciJeAsiO3J7ySuzlfARX/Lf6b3ig== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KhBlg/MXWqCT96G7XJJl1L/i7r4Tzcz8z34K31ymIgQ=; b=TsY1eaYVoM0Kwk42a8FSkqoOFmIkuI2syKUH3K7tvux+X+wx+SYHAruicBQlmCOYssYG6MQiq4FM6G0C1DItsItuSnD8dCbFd/O+qVN23aorKEfV2Bg3Y2KUq19VnfabrGgo5Po8IdR7sXvDlwY4JsO4JUq6eTzcsEKkOSYyEO1Yx5CoCUh25GtWC5Ng1pvWLTVMeDqkXVHqLnzXeiYlDnkSNs9cb/WMW4dzJyqtzJRyAE80KvL6LipFFA6PrZYC2O6luVm8CgbEvKugrIeG4/t5q/AgvFf7x/Y4fjKr/glAhXCzMvBLOzanr2pnfpcUjSRABYuxJ/q9HfW7cpdFew== Received: from PH7PR17CA0039.namprd17.prod.outlook.com (2603:10b6:510:323::18) by MW6PR12MB8867.namprd12.prod.outlook.com (2603:10b6:303:249::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.26; Tue, 30 Jul 2024 14:00:08 +0000 Received: from SA2PEPF000015CA.namprd03.prod.outlook.com (2603:10b6:510:323:cafe::7e) by PH7PR17CA0039.outlook.office365.com (2603:10b6:510:323::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.35 via Frontend Transport; Tue, 30 Jul 2024 14:00:07 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by SA2PEPF000015CA.mail.protection.outlook.com (10.167.241.200) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.19 via Frontend Transport; Tue, 30 Jul 2024 14:00:07 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 30 Jul 2024 06:59:50 -0700 Received: from fedora.mtl.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 30 Jul 2024 06:59:45 -0700 From: Petr Machata To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , CC: Vadim Pasternak , Ido Schimmel , Petr Machata , Subject: [PATCH net-next 08/10] mlxsw: core_thermal: Remove unnecessary checks Date: Tue, 30 Jul 2024 15:58:19 +0200 Message-ID: <8db5fe0a3a28ba09a15d4102cc03f7e8ca7675be.1722345311.git.petrm@nvidia.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF000015CA:EE_|MW6PR12MB8867:EE_ X-MS-Office365-Filtering-Correlation-Id: 903874e6-d41b-4ade-99fb-08dcb09feb2f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|82310400026|376014|36860700013; X-Microsoft-Antispam-Message-Info: G3hUi87SCNJxVTThl1eJ8AtRt+oeVE1z7xvESx8IzbP+xspPb1Bj+yQfiyyUarE3PYqanr8zsRgiOFiEZ/JXUitQ3DBaOPgRfNMCsKO5xPnJ4TB7UYta05P+kD6APM0EP2TwIpx9juzE6wBglXcKMpgP7DgK4m0B2mnm97xOG2x8ANBzlQ0+Y4YoLHcpXUdWHmjMl7Dv/1Rzw4jjofL7ZZsKnBPy2lBQjwrDkKkRBjmQqZAULJ9/zaT+N3w/ikrMlaq5LEywfQsLHsd3vZmDRMNTBssJ7p4nXjHARGOd0Mb1sk7Z01BmBUVLcg5gCE3WIZ+/8OuH/J4M+u+iuXjpy8W2ddYCRPzLlqS/6X2pnqNZzx4rG0TUfIgQ+d1DDfuU0T6GP50zyA2WWevmyILsNB9OKwJctwJrXRPg+rvTjKB/Jx935aOlbhKBKQV6BG6BqV5ge2aW2uRgxv+gi563g4wRS1ClXLG7LQ+pa6TGKd0XnClAk+qrl+nM28y/nM6Ct/6eOZF00y9r1NAoLzcpbovdDQWKi/rjPHZ8GrYHHPc/VuFNwIKkdY0M0NcdFVTIgGiPs+eS2CNGTgAxFAHmfFrcL7OdeXwW8mLL1wL9mFXBFuLVmNTUdO2Ho3KZFcTRQBWS5kDFn627dZpDCblrsJjUggDRvPWNGqaocb8oTIbFHQcG/aduAwo8/lkTqW71t99iSRq+4JNCfY70a/R3hXRrtx3XEthz+a14OkFJ3VBHIcKQtJ5Vk1ShVWFTVUsG7BsI+E++74SEnqQh4mwP+a4sWf66hq6A5ELNac6vs6YBsIXvR5VB3Htr8z1sG8bZVoKW+MSNGl6sy2LgeWYjlWeHAH0TGmepEXj4B7WNVPy2nLPcKzusT++mmM52dLE0uFkAKViNrtxUbeWWd85j7H36iHup3aBB1JGTc/1HzPK6ZUsLlUMcRDR/WxSO6NDp88XRjfrZXsP5Z3mPiXrUwxTDKpHEViQvan0V0ZANpQWpYAkgIyv7Z74DBROk26g8QBkxVvA0EenL4BTOxaeXsX0JFwRzkDbrciBT9jqxwhS2g/XIQyXYTQoB+N2rs6tZZieWg2jhhu274x5wwXFORo/OMicyb+UghCDrl/jKDWIiLbcWna/YBNdtLUXHGhcoJ2trR9DcAWPVq00mcFKSgmOsGFS/Y+x4kGHR0M7wY1Jt6VLLFaGfFYz0iEPzVNEub6NIF9xBUxp8fMVmw2WvzwU2NAeDuPWT72bc5kN3axxD43N0C35V/u/IotmxkmQPR7597RbE0COdpkucEQFArmEGCpGR4w8jKddfg3xa/gX09ZXuwBTnwsh5dRtWCZn3WXoTm+uvLcJF0Rc2rq8rKwpFddFgvxeUnSBmM6MYE5z9tVapCmhgcWYXrF/JQoBoAOhMRi9/Qyd9cENyx+Djx6/omp0PoZgoOCVYVymgjZe8jNU6mnUWRCBsYxfNDUW0 X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230040)(1800799024)(82310400026)(376014)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2024 14:00:07.0571 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 903874e6-d41b-4ade-99fb-08dcb09feb2f X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SA2PEPF000015CA.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW6PR12MB8867 X-Patchwork-Delegate: kuba@kernel.org From: Ido Schimmel mlxsw_thermal_module_fini() cannot be invoked with a thermal module which is NULL or which is not associated with a thermal zone, so remove these checks. Signed-off-by: Ido Schimmel Reviewed-by: Vadim Pasternak Signed-off-by: Petr Machata --- drivers/net/ethernet/mellanox/mlxsw/core_thermal.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c index e9bf11a38ae9..cfbfabec816e 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c @@ -467,11 +467,9 @@ mlxsw_thermal_module_init(struct mlxsw_thermal *thermal, static void mlxsw_thermal_module_fini(struct mlxsw_thermal_module *module_tz) { - if (module_tz && module_tz->tzdev) { - mlxsw_thermal_module_tz_fini(module_tz->tzdev); - module_tz->tzdev = NULL; - module_tz->parent = NULL; - } + mlxsw_thermal_module_tz_fini(module_tz->tzdev); + module_tz->tzdev = NULL; + module_tz->parent = NULL; } static int From patchwork Tue Jul 30 13:58:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 13747436 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2087.outbound.protection.outlook.com [40.107.96.87]) (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 718CF1A2C2D for ; Tue, 30 Jul 2024 14:00:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.96.87 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722348013; cv=fail; b=C1Y1lgYFXrKNyPVj1bX/H6cx7f7HC4kGx97y/DCkZeQ87TXJ64Gp6xLU7+WBK+vDHiLX5o06UBXplI9WJPJSsgj5Mj7Vu10A9ocbU07QM4K1oJE/twWJ0xLmFcdZMKwKgA4yTVl1UT3ymhwmkoc0uKoq06I86egPpbEW/FJCjLM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722348013; c=relaxed/simple; bh=vYkSw8KRtDYPGrYi23Dw8YrXSZImnclqFqQeNm2HZVc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=NZnQi7sxVsYI6nTbEHsuURxCWujfF2AlvT9cWLRfljGMzVp/uxODb5SVk/8CLATKy9En0WNj/Qs9zVF+4ea65I/q1zDQIzA7EoQ+pYc4R/ybh4UA88pW+tfGwdPJx97AArl8s8YaPo8Se00Nt6Qju92Z1pYQDxnodvQOBCGcRGw= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=RLU+gmrS; arc=fail smtp.client-ip=40.107.96.87 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="RLU+gmrS" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TmaVtZLGp+aIiKYqra5JhTwKt+GMj4JxnC5BBr2B16gjUw8LKFkn1BK+DN1TO2wzLLC3WgknikC5LgJAlXHHsyrnDz1xT1+RZRMockm1H6FD7ckZV5+yQsAkY1bQQL8Nz73DIAWlUKHlkCj3HCvajy0HmJOEOxmeuCU/Gs3ldcdKmyEHhNVP/J0rdC0qmE5MgmO32NCto+y2cW31nyfo9MqXDdbuVLjLLSLZoGHRRJ7aR5jYuDlKvF6MbYKeeBF5aDBpcCuVhghjzjJT1Njm0jPX5gsHvZBQaTdJrYDzPMY42osMZYoLiIESu13XCN0RzT6ZtmB8iqmHhI4aTvWagQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=yg9Pc6Jo+v5GamRk1BJnttWzWug8t7q+jl6us43TI6M=; b=Mu/gdfZh+8TREZJi49VgCS25EsFd932X68NsFxKr00F61ck8m8Rym0JRR/5DhBLt9kD9N3QJYmPjzdQX9GHXz21H7HUP7UsupjaDOkmhNZi3NZB2ynmRVLprfvmhZ6r56zSkpvTemOPM3Unc6qbTWK+hcosAXgXYeJUn14J7wqT1jNWbNTZqkyJh8y4RSHUgYQw0yI0lxzXKmHZ4c12tt8nRX9EIcQicpYwFtDtICUgcPG6AF33BpCfXiMAFfAkXvGwslyOy4kwssgTBa0pTuTOS9TalzcJndWK+7xN/YhmJ/rq3C+PogCHoGKx052Fk1u6eaxeY/YSpg5yVfqdJSg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yg9Pc6Jo+v5GamRk1BJnttWzWug8t7q+jl6us43TI6M=; b=RLU+gmrSdkSOdHrBtaPebYa+pu7cerIEmLPpcdw88/m+jpZk+aX9Zck4NWSEITVmk5wT0mBugjp9RCjAOOigDqyuhSEEy3q2V/i495GxLeEGA6ypHlqNEjrMLUJxcJ1qbrTdT7DvsaqZWYPf3eJ0VS31jqAYw9W2xA8lMITshqL3LrU2ajVf0FvxABEuFW/Lf6ObKhJPPkLNUH9ZSm5U0BWhOMLxj1lo7Hc3lXcujO8VS2EbDPbBE4ftd69mrJY2RsI9zr0FHPJtzmnT7ul+05j15L8BpevQfhpr71FoPhjZRGvBFyYCyijZop/h7uxeLm1JMgtXZDlHRyAlcWECXg== Received: from SJ0PR05CA0174.namprd05.prod.outlook.com (2603:10b6:a03:339::29) by CY5PR12MB6129.namprd12.prod.outlook.com (2603:10b6:930:27::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.19; Tue, 30 Jul 2024 14:00:08 +0000 Received: from SJ1PEPF00001CEB.namprd03.prod.outlook.com (2603:10b6:a03:339:cafe::7e) by SJ0PR05CA0174.outlook.office365.com (2603:10b6:a03:339::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.19 via Frontend Transport; Tue, 30 Jul 2024 14:00:08 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by SJ1PEPF00001CEB.mail.protection.outlook.com (10.167.242.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.19 via Frontend Transport; Tue, 30 Jul 2024 14:00:08 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 30 Jul 2024 06:59:55 -0700 Received: from fedora.mtl.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 30 Jul 2024 06:59:50 -0700 From: Petr Machata To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , CC: Vadim Pasternak , Ido Schimmel , Petr Machata , Subject: [PATCH net-next 09/10] mlxsw: core_thermal: Remove unnecessary assignments Date: Tue, 30 Jul 2024 15:58:20 +0200 Message-ID: X-Mailer: git-send-email 2.45.2 In-Reply-To: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CEB:EE_|CY5PR12MB6129:EE_ X-MS-Office365-Filtering-Correlation-Id: fcfe1d33-45f0-4de9-3cf8-08dcb09fec04 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|36860700013|376014|1800799024; X-Microsoft-Antispam-Message-Info: b2mtziAHeYNFSK9cgVuEYBDueglapvDku+C5XFoRx8bkSjaJCoXO0rzwZwtwMaHhIuRD2LJa2pIwy2f36VqDZo8Kyo/0DOEr9gwHfgbKasDFaX7t3sjKkBuRRece/Dk9xyhPjilOV926uVVNKbN+k5ld8SRsBl/Gc4uOg5qIEBG1SwrQOeO493sZYUIxwzx3m1aEr0cnykCYsgtfh0Yk6go/CPYyvO7CLWSHL4LxF9rsBdeBLK/jTq3rmkaeeOxzLnYiWtjLAgG07GhrWZOoFXw3NeiTGFJTB7zrmLAvSumnp4jeT3WCnApDQZbdzCCMj03Qwvx3Do6kCAs4odft8RTBDoCtxua8DNnKW7CuVt5BhLLyL2PkizE5ex3j5BbNO76Y/kxAeTWApRTrDcQnoH7f11lXeljSuQAPxnpQHal0ijhX3LXhFxKkZ2PPdutnCKOsv7Ee43GgRt868jBzhH22tfSt2e0cLwCQE4VNCqzkbaxkP7nIVUw8Q0MeQinrja1kgGuvQRWFRBFtcKFRiget46ajA4delRqkN30fexnN1xHHUf6/gyJrrct2T1OMuO4T9jwwhDNQq645Gw9n57Y7cCKTcpw9SZUvMEuNoByASGGqaZa2ab3eaMyl47XaHI6dF0u9XQP2pQPWz0oF322c0xzVqZag8kX0k4TSlKdK0fmfQaJKGSxxD2mKRS2/IIC9/+KKcyO9T5NgxUBg0po64v3NrUB9F+VHoPr9hrVD8vav6nPG03rxYEvDG6eC2Oj9lXTZNX8hCKqtjq3TYsgy3qYkRAhBnpVsDERBsIlt679O9GFm36MpG72zl5+0MocS2qw2FhXDgCgtB/mAvJFUE2WHrEB/br/efJDq9fCvxLPEifl5KD2KMHLqaBrfAtRefP5h/zucHuMDgg5TUIENJxd9vi9Ir7046yYzfIE+ekDqDrCnJ5eWqrQnLmNzXWIgC79BX7upFGMgjOrpmuBBSqNnuP7a5OvmTtRd32u8xhg3HOeDJUzjwufv1wiNL3G75XFsbSK+A/YPBNofXl0P/lbjOw+0ZemU/PxKW2+cXAhDsKWxUh1ne04H7DLNfnd1NZ4wAOAG4CCd7WUrlHwLIprWf4UoEOs+dV8vszHBeqyQGF6u0h58lNKZb6wJRKUqdUAzgfK2OUdBeRZLsR5uBQFPQdeTQfqKo0UrWKtShCxQAyyGL69K/IyeZUsf8Lzlcb+2LMRzwzBA3ki5NGZqkvOiIiWkjB1d/bhuAj4BLR2K9ApsMIqfX1cAeqpJEA29UtA1QOra23CIaYF9w+HY44I70ZE5wCe+9wNWhKtvhl/xZ6EITNlpwePiJvJLE2y5iMykW9i2SH93AxCxYHUSD3+/cKas7STUkIytV3VSVL94Kce9soI7U1x1hJlr0EQHAq8Bfz9R/F4KpGXZVbeRt2bTvWbzPoyuFdEuF5fxcLRj+AOqsnfaa24XB+1T X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230040)(82310400026)(36860700013)(376014)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2024 14:00:08.4507 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fcfe1d33-45f0-4de9-3cf8-08dcb09fec04 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00001CEB.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6129 X-Patchwork-Delegate: kuba@kernel.org From: Ido Schimmel Setting both pointers to NULL is unnecessary since the code never checks whether these pointers are NULL or not. Remove the assignments. Signed-off-by: Ido Schimmel Reviewed-by: Vadim Pasternak Signed-off-by: Petr Machata --- drivers/net/ethernet/mellanox/mlxsw/core_thermal.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c index cfbfabec816e..269c4986ea24 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c @@ -468,8 +468,6 @@ mlxsw_thermal_module_init(struct mlxsw_thermal *thermal, static void mlxsw_thermal_module_fini(struct mlxsw_thermal_module *module_tz) { mlxsw_thermal_module_tz_fini(module_tz->tzdev); - module_tz->tzdev = NULL; - module_tz->parent = NULL; } static int From patchwork Tue Jul 30 13:58:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 13747437 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2061.outbound.protection.outlook.com [40.107.101.61]) (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 A8A3B1DFE4 for ; Tue, 30 Jul 2024 14:00:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.101.61 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722348023; cv=fail; b=kNT7D8+JHQBTlPhwP5yVombzSf5vS/UiDnlN5j8X9RMj94ZOiGLafCFcSCqh2a8t1scV4zqmpulfNV1Bj24EDY3ycxGBtlI3C+uj4iCjy1lKpf9vg5tbXI5e6kijV+yF9MfNGU6lGp4z98VNx0x01KlHBM1nyST+8y2+bSHcTaQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722348023; c=relaxed/simple; bh=hK3KGEItqJq7/zS1jwOHSeVR9IWojFjjLwk8dbiiL9o=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=X+4X3mzbbRBNpo0+TUhxt8ZMI8MfvstcZ7zY8ICJmpxW25/CKpoGe9blJtTN5SsWUldPtTApc5fOHAyn/d5BrkA5cGpGizxNlP38vbJH+yBg9JMJOahXdMUTwtKkORnJ5KSjcYhtV6/TNmnDRCZdO9JcQknoE8nxZHgC7bxtkq4= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=qplIeZwI; arc=fail smtp.client-ip=40.107.101.61 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="qplIeZwI" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=DIXpyIxVQZwVfjhCuvRIm8Mtzp7bUXMv4D3MaN0d4oUgePNAokvEpzB6pWzl0g+Mkowq3ZsesEbMnVPqXjPxO0Cj9KS8J3+MTcm19XdvW2f4qJAjsVEf5lt8hSuFLdGBMYZPuJPlTc3VH6t0ib2Mc0J49GIj0Z4Cb9ZBgGNMXYH1wezrogLXbO9II5AreHX5dh3aEF0d04F9OsrwIlzUCCQudLOpfbyQadUXvgN9erm89vXUjMZQRyi9ipQ3hIue82L55+kdom2D8cc6VeNlTOAV6dvP5z8qGhTXlpC+KzxAD8C3LiyJOYrdiQIS+z+OImet/PGTV9SP9WPqO2+cJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=YGrtKUaAkUOZrDQe0UMZUwZ7Ldul7asa0P+VoBb8Ri4=; b=wDYW8LpOdn6MB5bgm5s72NMd8Vahoja09uSbIOorRAhtjCeNNBwjd8EVqHDekyWkOkn/Gr6wzVzMqGhWOffXuiWpszP9uSWv4c1NGvT6T8pZQcxezuK4NxEiNAjiyr9x5nu2Vu1HasdeTMxRmaWfz48jiLInWblnTezw0yNzu8xuoJ/0YvhzP+84j7KtZiqcJ+it3jD2CQCTsRZubtjjnruWWejnbhsE3R4k/5UQT9J3GHc2PUYtlPeNICVjLZJDsrS/eBPCY95pZDWmrh8Oxqs6me2glhFQ6GS8RJRSgDW6/FBC2JkP5qnuvM0Wy14w5V8UHLesA6+TxseNIH82Ow== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YGrtKUaAkUOZrDQe0UMZUwZ7Ldul7asa0P+VoBb8Ri4=; b=qplIeZwIwZ/4kbLegryaI3lM7Zh1l6NgLtwkdGgXT/X2LJEUPoDfdRGNNnbDhFKv3dda/LjIl8NRs96w5d+sBTQM33pYxOzRE2wJ0hOa3x7jqZVX+a0QwAAfCww+PXx98H9zHVJrCbiXTdiMUTE4L9BMv4gtCLjVdvfWjTtFmBkDki3/XiF9EG9NTXE9jzQq7FqxFFDiBK3SsNcHjezgRYDunArbN/pHCHv7ANmLwaee/5bXMwX9NpAGDgwao0FuCAuzCJzGDy1Ch2hmDgbv9plZg06jqpfzga7S7Wtuj6Yj8daZMAV3Spgv5n5XhWkP/XEKMNBUwbcQeCUPvEeYqA== Received: from PH7PR17CA0046.namprd17.prod.outlook.com (2603:10b6:510:323::6) by DM4PR12MB6037.namprd12.prod.outlook.com (2603:10b6:8:b0::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.28; Tue, 30 Jul 2024 14:00:15 +0000 Received: from SA2PEPF000015CA.namprd03.prod.outlook.com (2603:10b6:510:323:cafe::9c) by PH7PR17CA0046.outlook.office365.com (2603:10b6:510:323::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.35 via Frontend Transport; Tue, 30 Jul 2024 14:00:14 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by SA2PEPF000015CA.mail.protection.outlook.com (10.167.241.200) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.19 via Frontend Transport; Tue, 30 Jul 2024 14:00:14 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 30 Jul 2024 07:00:00 -0700 Received: from fedora.mtl.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 30 Jul 2024 06:59:55 -0700 From: Petr Machata To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , CC: Vadim Pasternak , Ido Schimmel , Petr Machata , Subject: [PATCH net-next 10/10] mlxsw: core_thermal: Fix -Wformat-truncation warning Date: Tue, 30 Jul 2024 15:58:21 +0200 Message-ID: <583a70c6dbe75e6bf0c2c58abbb3470a860d2dc3.1722345311.git.petrm@nvidia.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF000015CA:EE_|DM4PR12MB6037:EE_ X-MS-Office365-Filtering-Correlation-Id: 4a7e5df6-a846-4757-5362-08dcb09fef97 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|1800799024|376014|82310400026; X-Microsoft-Antispam-Message-Info: =?utf-8?q?1IV5jYr1ngtAzJJIY/G710RwjSuopgS?= =?utf-8?q?3k2PpgzsRPGlb2gYSspH5xrjA0xaYmH3gD676sX0MVyo08GVhyWf+Fo9GRwlOyMJc?= =?utf-8?q?5jGlX9Suh7GGdpXRBrgk3ewVxhMF4yC52VaHQZDJKLp5CSd+Phdn6sRPnlQCvQSBW?= =?utf-8?q?CGxLoJKeKlUVhKRw/vZukWXMyuXaoSnXW8NDg1egqjX6gq4hjOGx/8vfiHqGo8a88?= =?utf-8?q?Uk5r0+Tvs4m08QXa/+vJ+77HFac1LC3zicfv6962Oj7cgPbwisdPm1BusSMqu+Ttp?= =?utf-8?q?eEeyXbbLI1rLqZRkDStD/u3oz6qEe8CLuWJGK1NWOL2ja1ybPFUvmFRjglH8NzRIJ?= =?utf-8?q?dwdVAEm4XdC/U5N9P6+zAiiaTKJySvEEtOYJ/mM5KosKhZf0P9fXvxXVMrNQ7i+CH?= =?utf-8?q?J2xUlNFTMs+24RvofnfCLP7bUP4OTGc3ghkF8LdNilx/W5EPG5Z+2Bl0gtpbvYXWw?= =?utf-8?q?0DXg3c5ytR8MKYAQc5D1Llldnu+UgbmsYXYJiZo6wxfZcmqHirvnTjP+hPX/lVjrT?= =?utf-8?q?vl1jv8JFYgOI/PGmRrv5nt2KahJgXBcur4356O1v3ycHPTFKtdsSdtfCwI1Ula8v0?= =?utf-8?q?QswRq2CyW5rwSAazxLEBeFrEUgbOpA4th2N+UWGd8bOQJD5kjNf2cIevLoAY2uRXP?= =?utf-8?q?4ju/7d1DraPno4Ixq27MqF9sOBb3rDvQzHp5I/51MumF9/QaZ4EK/jHj1b2MELoy3?= =?utf-8?q?9hU+I7xlk65gHwgF0w+km1wWKCzDFSUFwXXWcikIjOQlI5ZUNJR/uO9z0935vuzOZ?= =?utf-8?q?qeoSjB05ueeKmql5CdxiYpHkuqZ0MYVDdb/Iy+OGGo+Dg6+fCqhSRBw0glrh4y1nS?= =?utf-8?q?U8Xlit+o/nJsh61YHa0p3bGaE646Do8R3bSErDtZ6UnGzgxNdbYoWdZ0dw3f62lDb?= =?utf-8?q?SSdrLYGTBBKOJrGGC3//i3ehBrbW/MYuH31g1SHPucU60rUCv31MfS/Pwx8N/d0mW?= =?utf-8?q?jO3Qx0pD0Tzlwu02S06HVa7QKiAVAiYY9jHzHZ0sFPMNzYVLL4r/f1DJjDstFAQn4?= =?utf-8?q?tgrhMkysi1dq3eadhAGScK5Bg8pR1H4bW97++ubnzMEw3P7n81ye0IprjpfQsJN6F?= =?utf-8?q?9734H+lma6qmyhJXMdlOOf88b6NDNx849/NpAuGwT6xyDh2rynLKbDo2C3l9nhe25?= =?utf-8?q?h6TLqboBemqBDHNL7i+PGXwzqeHeDY3aIhH20co+gNO/67kyTBqvbA/hIOVlBAFyX?= =?utf-8?q?pivKKqmEZXr6C7QUphem4OjCh7zwsQuMJfMkoJbBaDEMHPeR0DJwxnlShbDKEi6Wm?= =?utf-8?q?up1CJP3zULAV6t0wqupp4JP+ctrz90tcb+y0KshkGHBLSO+fRBAwtX0UFfBBo54Nb?= =?utf-8?q?iJOiB/nh/8j5InDEe5yRv+m4MvyW5Zc+N1LvhZuMvUi1PEJS8lI+0UzKVmL0feMFp?= =?utf-8?q?E+DNNNQGZ6L?= X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230040)(36860700013)(1800799024)(376014)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2024 14:00:14.4478 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4a7e5df6-a846-4757-5362-08dcb09fef97 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SA2PEPF000015CA.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6037 X-Patchwork-Delegate: kuba@kernel.org From: Ido Schimmel The name of a thermal zone device cannot be longer than 19 characters ('THERMAL_NAME_LENGTH - 1'). The format string 'mlxsw-lc%d-module%d' can exceed this limitation if the maximum number of line cards cannot be represented using a single digit and the maximum number of transceiver modules cannot be represented using two digits. This is not the case with current systems nor future ones. Therefore, increase the size of the result buffer beyond 'THERMAL_NAME_LENGTH' and suppress the following build warning [1]. If this limitation is ever exceeded, we will know about it since the thermal core validates the thermal device's name during registration. [1] drivers/net/ethernet/mellanox/mlxsw/core_thermal.c: In function ‘mlxsw_thermal_modules_init.part.0’: drivers/net/ethernet/mellanox/mlxsw/core_thermal.c:418:70: error: ‘%d’ directive output may be truncated writing between 1 and 3 bytes into a region of size between 2 and 4 [-Werror=format-truncation=] 418 | snprintf(tz_name, sizeof(tz_name), "mlxsw-lc%d-module%d", | ^~ In function ‘mlxsw_thermal_module_tz_init’, inlined from ‘mlxsw_thermal_module_init’ at drivers/net/ethernet/mellanox/mlxsw/core_thermal.c:465:9, inlined from ‘mlxsw_thermal_modules_init.part.0’ at drivers/net/ethernet/mellanox/mlxsw/core_thermal.c:500:9: drivers/net/ethernet/mellanox/mlxsw/core_thermal.c:418:52: note: directive argument in the range [1, 256] 418 | snprintf(tz_name, sizeof(tz_name), "mlxsw-lc%d-module%d", | ^~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/mellanox/mlxsw/core_thermal.c:418:17: note: ‘snprintf’ output between 18 and 22 bytes into a destination of size 20 418 | snprintf(tz_name, sizeof(tz_name), "mlxsw-lc%d-module%d", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 419 | module_tz->slot_index, module_tz->module + 1); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Ido Schimmel Reviewed-by: Vadim Pasternak Signed-off-by: Petr Machata --- drivers/net/ethernet/mellanox/mlxsw/core_thermal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c index 269c4986ea24..303d2ce4dc1e 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c @@ -411,7 +411,7 @@ static const struct thermal_cooling_device_ops mlxsw_cooling_ops = { static int mlxsw_thermal_module_tz_init(struct mlxsw_thermal_module *module_tz) { - char tz_name[THERMAL_NAME_LENGTH]; + char tz_name[40]; int err; if (module_tz->slot_index)