lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e48e5948-51f0-7ce7-265b-d432ea058b7e@collabora.com>
Date:   Fri, 29 May 2020 17:13:55 +0200
From:   Andrzej Pietrasiewicz <andrzej.p@...labora.com>
To:     Guenter Roeck <linux@...ck-us.net>
Cc:     linux-pm@...r.kernel.org, linux-acpi@...r.kernel.org,
        netdev@...r.kernel.org, linux-wireless@...r.kernel.org,
        platform-driver-x86@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org,
        linux-renesas-soc@...r.kernel.org,
        linux-rockchip@...ts.infradead.org,
        Emmanuel Grumbach <emmanuel.grumbach@...el.com>,
        Heiko Stuebner <heiko@...ech.de>,
        "Rafael J . Wysocki" <rjw@...ysocki.net>,
        Vishal Kulkarni <vishal@...lsio.com>,
        Luca Coelho <luciano.coelho@...el.com>,
        Miquel Raynal <miquel.raynal@...tlin.com>,
        kernel@...labora.com, Fabio Estevam <festevam@...il.com>,
        Amit Kucheria <amit.kucheria@...durent.com>,
        Chunyan Zhang <zhang.lyra@...il.com>,
        Daniel Lezcano <daniel.lezcano@...aro.org>,
        Allison Randal <allison@...utok.net>,
        NXP Linux Team <linux-imx@....com>,
        Darren Hart <dvhart@...radead.org>,
        Zhang Rui <rui.zhang@...el.com>,
        Gayatri Kammela <gayatri.kammela@...el.com>,
        Len Brown <lenb@...nel.org>,
        Johannes Berg <johannes.berg@...el.com>,
        Intel Linux Wireless <linuxwifi@...el.com>,
        Sascha Hauer <s.hauer@...gutronix.de>,
        Ido Schimmel <idosch@...lanox.com>,
        Baolin Wang <baolin.wang7@...il.com>,
        Jiri Pirko <jiri@...lanox.com>,
        Orson Zhai <orsonzhai@...il.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Kalle Valo <kvalo@...eaurora.org>,
        Support Opensource <support.opensource@...semi.com>,
        Enrico Weigelt <info@...ux.net>,
        Peter Kaestle <peter@...e.net>,
        Sebastian Reichel <sre@...nel.org>,
        Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>,
        Pengutronix Kernel Team <kernel@...gutronix.de>,
        Niklas Söderlund <niklas.soderlund@...natech.se>,
        Shawn Guo <shawnguo@...nel.org>,
        "David S . Miller" <davem@...emloft.net>,
        Andy Shevchenko <andy@...radead.org>
Subject: Re: [PATCH v4 02/11] thermal: Store thermal mode in a dedicated enum

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 <andrzej.p@...labora.com>
>> ---
>>   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(-)

<snip>

>> @@ -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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ