Re: [PATCH v4 02/11] thermal: Store thermal mode in a dedicated enum

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux