Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp622373ybm; Fri, 29 May 2020 08:15:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHazhI/eCemsZJDXSTNd9ZRCosNc46kvkHEEJIYssJ2gk4PnmI1CcQlRq7UQod9nFV1FVY X-Received: by 2002:a17:907:2636:: with SMTP id aq22mr7871963ejc.384.1590765317890; Fri, 29 May 2020 08:15:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590765317; cv=none; d=google.com; s=arc-20160816; b=g3/0S9ufO4wBn57KInjapb4jy4itAVlvCuABkswC6sFRPGqSpiRKYVafNWbDIBeTt2 NbQqeWsw6DPVxrT+z46Wn9s2c5XoiABjb2fYxp9HYq71q+rhTTevlg8SY8RYtWSm0WI/ bWa+56rZAq3+t/6Hie5UQbiLC+jfJXmvUwMJOznjTMxx44lSF80HE5P8O13+ARWfAjhO HIBaJA0rzAFDXWxkPcRvJdwl0nX+rOiJnOsl5sEFokm0mCg5p98pDnvw7Qv7KTe6AYE+ Ge78B2N1ugIi9zkJ9ie4VcStu74tCbR/6hGZzyDfzEqDKX2kzDEV2iyFsuZ7kq1N7jrx p6Xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=tkTZBsZAneSbaqCJf1jRuh3Um5hVmZ/Vl0D2muoXmrQ=; b=uJiAZs2EkZ+dqo0XEiEWTO95B1gIUUeniSZGonxb7wB4i5+eym7OJGVgkNNhd8WJt2 6tNGG0Vhrm0POZyMSoUMO080XDswZfX53R6DPi725ryQ/VWZXsnqcmUGRF5x7WpliO0J +K1TVWSoVPCh1tN2E22u68GxeZFxOMzBuyotqFhTvlETDteQPHAFLkQ9cyf+5bkc7tmX E5+Phvt9j2l7pvkTK8FOKsDfkeDZmWEp98HPodsHD1ErJk2GwP2jKLlQgB2pT+sTTWR4 i1U7aEEHIlp79tVAjxnbmBgXDXPpE+7ZuJG0xFf2qKZsYfezIOYX+njOaLr3gQabNiKd 3yXg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p19si886476edi.567.2020.05.29.08.14.53; Fri, 29 May 2020 08:15:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727025AbgE2POE (ORCPT + 99 others); Fri, 29 May 2020 11:14:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725901AbgE2POC (ORCPT ); Fri, 29 May 2020 11:14:02 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7930C03E969; Fri, 29 May 2020 08:14:01 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: andrzej.p) with ESMTPSA id 3E3602A3AAC Subject: Re: [PATCH v4 02/11] thermal: Store thermal mode in a dedicated enum To: Guenter Roeck Cc: linux-pm@vger.kernel.org, linux-acpi@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, Emmanuel Grumbach , Heiko Stuebner , "Rafael J . Wysocki" , Vishal Kulkarni , Luca Coelho , Miquel Raynal , kernel@collabora.com, Fabio Estevam , Amit Kucheria , Chunyan Zhang , Daniel Lezcano , Allison Randal , NXP Linux Team , Darren Hart , Zhang Rui , Gayatri Kammela , Len Brown , Johannes Berg , Intel Linux Wireless , Sascha Hauer , Ido Schimmel , Baolin Wang , Jiri Pirko , Orson Zhai , Thomas Gleixner , Kalle Valo , Support Opensource , Enrico Weigelt , Peter Kaestle , Sebastian Reichel , Bartlomiej Zolnierkiewicz , Pengutronix Kernel Team , =?UTF-8?Q?Niklas_S=c3=b6derlund?= , Shawn Guo , "David S . Miller" , Andy Shevchenko References: <4493c0e4-51aa-3907-810c-74949ff27ca4@samsung.com> <20200528192051.28034-1-andrzej.p@collabora.com> <20200528192051.28034-3-andrzej.p@collabora.com> <20200529144821.GA93994@roeck-us.net> From: Andrzej Pietrasiewicz Message-ID: Date: Fri, 29 May 2020 17:13:55 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200529144821.GA93994@roeck-us.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Hi Guenter, W dniu 29.05.2020 o 16:48, Guenter Roeck pisze: > On Thu, May 28, 2020 at 09:20:42PM +0200, Andrzej Pietrasiewicz wrote: >> Prepare for storing mode in struct thermal_zone_device. >> >> Signed-off-by: Andrzej Pietrasiewicz >> --- >> drivers/acpi/thermal.c | 27 +++++++++---------- >> drivers/platform/x86/acerhdf.c | 8 ++++-- >> .../intel/int340x_thermal/int3400_thermal.c | 18 +++++-------- >> 3 files changed, 25 insertions(+), 28 deletions(-) >> @@ -544,27 +543,25 @@ static int thermal_set_mode(struct thermal_zone_device *thermal, >> enum thermal_device_mode mode) >> { >> struct acpi_thermal *tz = thermal->devdata; >> - int enable; >> >> if (!tz) >> return -EINVAL; >> >> + if (mode != THERMAL_DEVICE_DISABLED && >> + mode != THERMAL_DEVICE_ENABLED) >> + return -EINVAL; > > Personally I find this check unnecessary: The enum has no other values, > and it is verifyable that the callers provide the enum and not some other > value. It is getting removed in PATCH 10/11. >> + if (mode != THERMAL_DEVICE_ENABLED && >> + mode != THERMAL_DEVICE_DISABLED) >> return -EINVAL; > > Same as above. ditto.