From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-vk1-f180.google.com (mail-vk1-f180.google.com [209.85.221.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1B2193FF886 for ; Wed, 7 Oct 2026 19:07:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791400050; cv=none; b=AMmGsTTCDiEdU1r11HdrpyZ0yZXy7Fn1AJQtntQVZCMdmwETbhtjCcORaRwrJTRTpItnDz+U01iuHwkI03aHUdw7h6aDh9hgNZNVIzj0uvSfSS6i3fJ0TURI0JNCuRv8jeOOQPxaZ0cFZGy62B/6VozyVAr+wb/fuwHxH7S50qk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791400050; c=relaxed/simple; bh=1fnau558rqBwopr4gCTm1ueAE/g/qgOsEp6tP/8Z6MU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=WBY1L43/BSg7vq3U+EmTiksoA1LqNHAZF2jjSC5tejGoHBUKU5FV/ZlRprlSumN+I3iJ2jJJfT34PoUDglb1ClVTklrlZO1BZ3cPpvlcMRG84tVLwKY5nHBA/L+ilv+lPI1kQZH9AO1s9FJOOHuzbih9BbE5zfRYoJdzUqITCX0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=nhbcWRxO; arc=none smtp.client-ip=209.85.221.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nhbcWRxO" Received: by mail-vk1-f180.google.com with SMTP id 71dfb90a1353d-5e507e778e4so729267e0c.1 for ; Wed, 07 Oct 2026 12:07:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1791400048; x=1792004848; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=ddp5n1+qL1RozXjR65sfg64BjVIx/uqCV0e6ynhIBi8=; b=nhbcWRxO+QH/6VHP/2xi/GLFLziBaP9Luena2m27UnMSSqfOZAePfRhn+7NJP0AzZg B4SHm+8g0mpfWNaC4uVmF163wKYYu15J2pRtmyq4A5TBydBgwxYMT92xNp3XAj4K0NNz l1+dcLCzRlTF1NJcpJl25W14A+m/9DzPPMjYcrvLkuSvWiPiczKBJb/3V4CbzZPfPcG8 QYjMuzMP5SmYRBzGnZFp2nET8TQuy8jntGEHuMerECrwt0lQp3pXFhHd/MKFGmgWEJEF IO7SLjZsSHkZulwxIqI2gbnPg37JMuejd8LcYhr5r4D72xbHAOor0EADS+5FyNNuCZ4b WG2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1791400048; x=1792004848; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=ddp5n1+qL1RozXjR65sfg64BjVIx/uqCV0e6ynhIBi8=; b=yCzngcU7kutLgYQGLtt47kepuNLPK8jkjaRovFdcYA0Pjtcxa1tt7leQHZ9qKCaYcy D+6bIqXLKJ2hj8xH3Vj/FEdvaHCHKkOO294owvXLcq3cf+t8bz8iWnQyJcU5kOngL/Kr 72ZFnkOPtMHGEfA4fINBzbV0wA5DvCpIGJZT1cnxohJruO7JYMVW4DNEzdD80CKWktKM CLyM6YIwZ2XPkZLLEYe1By1A3S5/LhYXIxQjEhS9X589JUxN7yc/GhEtldQDopqrJVM5 gHEQ7RoRtjuwXA26AyeUfVeNDpQp1pF3qBcT7EN2p5WQZKulmVcuG0NyGGRIqXt2LQYj llUw== X-Forwarded-Encrypted: i=1; AKwUvByKi4RuctSYx8NoYDNIf3JgbDbTq6aMEGlbWODrHYoAZJ55pumRwioQ9uBEXQJ6upSTEaDtD4+jcvqFn1o=@vger.kernel.org X-Gm-Message-State: AFq9FYKPmTWpzHW9CpVoMa2R/arMdOKeUNAJdJmlmzoR5yrWR2MGdN6n mUuywhnOWEchBVwblICj9Ia5ACYwS54iLQR6GVkIhpr1jIMQxHPAPMMZ X-Gm-Gg: AYBFou1fL7SVD1gzW1AxxJ5q8tzf2MJITH5lQG1qLfQlcJoujjugcN26vgow53YW9Az 092q8sFUyqF6iwTcDYg7ASMG3VwiwM6R8QyWxZOAQcKKhnXB6Ixwq0p6XXIgITHpUNI19Xj//CX EXaNSDvTQZjrSpa6nide9M7Ikt1rdaXmCl/UDmkzygFfcwshWw1SaB166tdeXu1cMHBLRd0/cSU mjEK79DYfXspNgX0pkhh03egUZiViEK7vLFVb1hAiWBxDZ7ITIS89pP2TkP/ydBfJDShkoEUg+p uA4QW0vudb2hmB8H/+pEjea6dXhlJkyaztJG00+IQA+6QwAa4QCy0MLOg80JnhPoMITHHY/ykKX 8ao8i8FUUZWoPbYSY4OD7kKCW+kVRBiEknsPTtKXk80bVc0nvtA7B6PhlzP4kJH/rPrCLCrx6Rr D2vEwjF0KixDQg0iSQ1aLwI+iLFKaDlHlNiw6n1Ck3pdosd1QycqpMdfE/YaErNgyXU8BoOlEhy KiQ4W6Zty4K7Yx8Z1BsbmdrssgatfvgUzfMF/EP46L5 X-Received: by 2002:a05:6122:310c:b0:5d9:82c1:b343 with SMTP id 71dfb90a1353d-5e6cf587159mr1287430e0c.1.1791400047865; Wed, 07 Oct 2026 12:07:27 -0700 (PDT) Received: from [192.168.60.5] ([207.115.103.98]) by smtp.gmail.com with ESMTPSA id 71dfb90a1353d-5e6c5742446sm2719928e0c.17.2026.10.07.12.07.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 07 Oct 2026 12:07:27 -0700 (PDT) Message-ID: <5331a0a0-7080-4311-84c7-433d5bebbf19@gmail.com> Date: Thu, 8 Oct 2026 03:07:22 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH v2] platform/x86: panasonic-laptop: Add platform_profile support To: =?UTF-8?Q?Ilpo_J=C3=A4rvinen?= Cc: platform-driver-x86@vger.kernel.org, Hans de Goede , Kenneth Chan , LKML References: <20261006085021.853827-1-alexyeo362@gmail.com> Content-Language: en-US From: Alex Yeo In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Thank you for taking the time to do a code review. I have made the specified changes for v3. v3: https://lore.kernel.org/platform-driver-x86/20261007190446.38862-1-alexyeo362@gmail.com/ >> @@ -130,9 +134,12 @@ >> #include >> #include >> #include >> +#include >> +#include >> #include >> #include >> #include >> +#include > > Thanks for the update. > > I no longer recall if I suggested adding sysfs.h in the earlier review > but I cannot now seem to locate anything that would be directly related to > sysfs in this patch. > Removed as no code uses that directly. Still builds with W=1 C=1. >> +static int pcc_profile_platform_profile_probe(void *drvdata, unsigned long *choices) >> +{ >> + enum platform_profile_option pp_opt; >> + struct pcc_profile *pcc = drvdata; >> + >> + for (pp_opt = 0; pp_opt < ARRAY_SIZE(pcc->quirks->platform_profiles); pp_opt++) { >> + const struct pcc_platform_profile *profile = >> + &pcc->quirks->platform_profiles[pp_opt]; >> + >> + if (profile->fan_mode != PCC_FAN_MODE_UNSET && >> + profile->tdp_mode != PCC_TDP_MODE_UNSET) { >> + set_bit(pp_opt, choices); >> + } else if (WARN_ON(profile->fan_mode != PCC_FAN_MODE_UNSET || >> + profile->tdp_mode != PCC_TDP_MODE_UNSET)) { >> + /* Both TDP and fan mode should be set */ >> + return -EINVAL; >> + } > > First check the error and return. > > Then check double UNSET case and use continue. > > Lastly, else is no longer needed for the set_bit() in the remaining cases. > The code was refactored to fit that flow. For the WARN_ON error check (first if statement), it follows the XOR pattern so != was used. Thanks