Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp769749rwb; Tue, 4 Oct 2022 10:21:04 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5kMMORS3z3/YFJTX32uFAv7ZDN2qeLEUMmuM0K3ZbTRqva3RI8MY1yzc7eUKPHhO2+OiAo X-Received: by 2002:a17:903:509:b0:179:ffcf:d275 with SMTP id jn9-20020a170903050900b00179ffcfd275mr27843481plb.150.1664904053259; Tue, 04 Oct 2022 10:20:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664904053; cv=none; d=google.com; s=arc-20160816; b=wCnsidQlJ/KTMArtQOuw8L/8VOKVU6Ie3tNcN0ySGmxQikRodwXM2iRZsdGUfnUC+r 9oGY8xh3wkWwSiN1NgvBOjGS0hvB3XdruHhOIWDPV7M6qkjEJ+sb9i4dBqwUID9CaWn9 coar1sQh4cDMuPAC2lENHuNCW3QkbXQmVmI9w/wAyeyAlg5kt+b9IPp0/nb2l35zo651 YYz2ZD4i72tArpSmmKkyUorXW8OVPIsb1/oqL9mZ2/bBFLecHu/64hiosdF4TrITjOvC 8rg84LaRTBZZJO/oWtY2huKpIq5PN3ZYFHeUzfN7ijvfL327Gsh+Pb4Hw9nXmbzc6NSO Rdfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=hpjejPDN7Dv4ZyVmvthDCLYIvbkI0yx9B7aQjkdvieU=; b=dERugHO/N416o515rhs39KKsNBo67tDW9gXRWyqui13vMcI6ZSEfwcpKkrMnomBR3X DMWak0iqviWKJml+0ZOOUHhcrJtb5SQ37A8+whZb4C0KpIDKv4j5enVsyVGSfaFh7jwd 1ilhbue3ft83XE6HwNUdMhSYDKxGwzCdRxtRRtXxmBYTtnztDHOjODBHvNwsef+73SO6 dNITYnj/axAHRrW6Xxos0mRLAFmXTbevexr/5AMpC90WNUVPn8mVIYYcKbsyvxePstT0 GBJePQtz2pecO3XCmSmGGJlW5HmhrGVhnoAvj5h0JWnVCjS4gGyV22k1PN2/C+q1AN5t IeMw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g8-20020a1709026b4800b0017f685b47b8si4317163plt.151.2022.10.04.10.20.40; Tue, 04 Oct 2022 10:20:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230144AbiJDQdL (ORCPT + 99 others); Tue, 4 Oct 2022 12:33:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230137AbiJDQdJ (ORCPT ); Tue, 4 Oct 2022 12:33:09 -0400 Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB7775E579; Tue, 4 Oct 2022 09:33:07 -0700 (PDT) Received: from localhost (127.0.0.1) (HELO v370.home.net.pl) by /usr/run/smtp (/usr/run/postfix/private/idea_relay_lmtp) via UNIX with SMTP (IdeaSmtpServer 5.0.0) id 636df6776db0d94c; Tue, 4 Oct 2022 18:33:05 +0200 Received: from kreacher.localnet (unknown [213.134.189.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by v370.home.net.pl (Postfix) with ESMTPSA id 79EDA6665F6; Tue, 4 Oct 2022 18:33:04 +0200 (CEST) From: "Rafael J. Wysocki" To: Linux ACPI Cc: Srinivas Pandruvada , Zhang Rui , Linux PM , LKML Subject: [PATCH v1 3/3] ACPI: thermal: Drop some redundant code Date: Tue, 04 Oct 2022 18:32:52 +0200 Message-ID: <1831358.tdWV9SEqCh@kreacher> In-Reply-To: <12068304.O9o76ZdvQC@kreacher> References: <12068304.O9o76ZdvQC@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 213.134.189.18 X-CLIENT-HOSTNAME: 213.134.189.18 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvfedrfeeiuddguddtvdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfjqffogffrnfdpggftiffpkfenuceurghilhhouhhtmecuudehtdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefufffkjghfggfgtgesthfuredttddtjeenucfhrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqeenucggtffrrghtthgvrhhnpedvffeuiedtgfdvtddugeeujedtffetteegfeekffdvfedttddtuefhgeefvdejhfenucfkphepvddufedrudefgedrudekledrudeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvddufedrudefgedrudekledrudekpdhhvghlohepkhhrvggrtghhvghrrdhlohgtrghlnhgvthdpmhgrihhlfhhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqpdhnsggprhgtphhtthhopeehpdhrtghpthhtoheplhhinhhugidqrggtphhisehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepshhrihhnihhvrghsrdhprghnughruhhvrggurgeslhhinhhugidrihhnthgvlhdrtghomhdprhgtphhtthhopehruhhirdiihhgrnhhgsehinhhtvghlrdgtohhmpdhrtghpthhtoheplhhinhhugidqphhmsehvghgvrhdrkhgvrhhnvghlrdhorhhg pdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhg X-DCC--Metrics: v370.home.net.pl 1024; Body=5 Fuz1=5 Fuz2=5 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki Drop some redundant initialization of local variables, a redundant return statement and a redundant "else" from the ACPI thermal driver. No functional impact. Signed-off-by: Rafael J. Wysocki --- drivers/acpi/thermal.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) Index: linux-pm/drivers/acpi/thermal.c =================================================================== --- linux-pm.orig/drivers/acpi/thermal.c +++ linux-pm/drivers/acpi/thermal.c @@ -262,7 +262,7 @@ do { \ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag) { - acpi_status status = AE_OK; + acpi_status status; unsigned long long tmp; struct acpi_handle_list devices; int valid = 0; @@ -620,8 +620,9 @@ static int thermal_get_crit_temp(struct tz->trips.critical.temperature, tz->kelvin_offset); return 0; - } else - return -EINVAL; + } + + return -EINVAL; } static int thermal_get_trend(struct thermal_zone_device *thermal, @@ -941,7 +942,7 @@ static void acpi_thermal_aml_dependency_ static int acpi_thermal_get_info(struct acpi_thermal *tz) { - int result = 0; + int result; if (!tz) return -EINVAL; @@ -1018,8 +1019,8 @@ static void acpi_thermal_check_fn(struct static int acpi_thermal_add(struct acpi_device *device) { - int result = 0; - struct acpi_thermal *tz = NULL; + struct acpi_thermal *tz; + int result; if (!device) return -EINVAL; @@ -1060,7 +1061,7 @@ end: static int acpi_thermal_remove(struct acpi_device *device) { - struct acpi_thermal *tz = NULL; + struct acpi_thermal *tz; if (!device || !acpi_driver_data(device)) return -EINVAL; @@ -1189,7 +1190,7 @@ static const struct dmi_system_id therma static int __init acpi_thermal_init(void) { - int result = 0; + int result; dmi_check_system(thermal_dmi_table); @@ -1216,8 +1217,6 @@ static void __exit acpi_thermal_exit(voi { acpi_bus_unregister_driver(&acpi_thermal_driver); destroy_workqueue(acpi_thermal_pm_queue); - - return; } module_init(acpi_thermal_init);