mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: "Derek J. Clark" <derekjohn.clark@gmail.com>
Cc: ALOK TIWARI <alok.a.tiwari@oracle.com>,
	 Hans de Goede <hdegoede@redhat.com>, Armin Wolf <W_Armin@gmx.de>,
	 Jonathan Corbet <corbet@lwn.net>,
	Mario Limonciello <superm1@kernel.org>,
	 Luke Jones <luke@ljones.dev>, Xino Ni <nijs1@lenovo.com>,
	 Zhixin Zhang <zhangzx36@lenovo.com>,
	Mia Shao <shaohz1@lenovo.com>,
	 Mark Pearson <mpearson-lenovo@squebb.ca>,
	 "Pierre-Loup A . Griffais" <pgriffais@valvesoftware.com>,
	 "Cody T . -H . Chiu" <codyit@gmail.com>,
	 John Martens <johnfanv2@gmail.com>,
	platform-driver-x86@vger.kernel.org,  linux-doc@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v6 5/6] platform/x86: Add Lenovo WMI Gamezone Driver
Date: Wed, 30 Apr 2025 10:58:35 +0300 (EEST)	[thread overview]
Message-ID: <1108c3ac-4815-814d-82b0-2ba74311d883@linux.intel.com> (raw)
In-Reply-To: <F54435E0-B3F5-4F99-9184-EE4D8D54DBD6@gmail.com>

On Tue, 29 Apr 2025, Derek J. Clark wrote:

> 
> 
> On April 28, 2025 9:39:55 PM PDT, ALOK TIWARI <alok.a.tiwari@oracle.com> wrote:
> >
> >
> >On 28-04-2025 06:48, Derek J. Clark wrote:
> >> + * Determine if the extreme thermal mode is supported by the hardware.
> >> + * Anything version 5 or lower does not. For devices wuth a version 6 or
> >
> >typo wuth
> >
> >> + * greater do a DMI check, as some devices report a version that supports
> >> + * extreme mode but have an incomplete entry in the BIOS. To ensure this
> >> + * cannot be set, quirk them to prevent assignment.
> >> + *
> >> + * Return: int.
> >
> >The function returns int.
> >But logically it's returning boolean false, true
> 
> I may have overdone it by removing all bools after the v5 review as I 
> interpreted Ilpo's comment to mean I shouldn't return any bool c types. 
> I'll wait for them to weigh in before changing this back.

Hi Derek,

That is certainly a misinterpretation.

It's perfectly fine to return bool from a function. If there's no good 
reason e.g. because of some API that requires int return, booleans should 
be returned as bool.

I was trying to say your kerneldoc said "Return: bool" for a function that 
returns int. Both "bool" and "int" are C types so there was a contradition 
in that, which is what I tried to point out. Please write "boolean" if you 
refer to a boolean which is not "bool" typed (but consider what was said 
above and if the type too can be changed to bool in that case).

-- 
 i.

> >> + */
> >> +static int lwmi_gz_extreme_supported(int profile_support_ver)
> >> +{
> >> +	const struct dmi_system_id *dmi_id;
> >> +	struct quirk_entry *quirks;
> >> +
> >> +	if (profile_support_ver < 6)
> >> +		return false;
> >> +
> >> +	dmi_id = dmi_first_match(fwbug_list);
> >> +	if (!dmi_id)
> >> +		return true;
> >> +
> >> +	quirks = dmi_id->driver_data;
> >> +	return quirks->extreme_supported;
> >> +}
> >
> >Thank,
> >Alok
> 
> Thanks,
> - Derek
> 

  reply	other threads:[~2025-04-30  7:58 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-28  1:18 [PATCH v6 0/6] platform/x86: Add Lenovo WMI Gaming Series Drivers Derek J. Clark
2025-04-28  1:18 ` [PATCH v6 1/6] platform/x86: Add Lenovo WMI Driver Documentation Derek J. Clark
2025-04-28  1:18 ` [PATCH v6 2/6] platform/x86: Add Lenovo WMI Helpers Derek J. Clark
2025-04-28 19:36   ` ALOK TIWARI
2025-04-30  3:17     ` Derek J. Clark
2025-04-28  1:18 ` [PATCH v6 3/6] platform/x86: Add Lenovo WMI Events Driver Derek J. Clark
2025-04-28 20:57   ` [External] : " ALOK TIWARI
2025-04-30  3:23     ` Derek J. Clark
2025-05-02  2:00       ` Armin Wolf
2025-04-28  1:18 ` [PATCH v6 4/6] platform/x86: Add Lenovo WMI Capability Data 01 Driver Derek J. Clark
2025-05-02  2:18   ` Armin Wolf
2025-05-02 15:51     ` Derek J. Clark
2025-05-02 21:10       ` Armin Wolf
2025-04-28  1:18 ` [PATCH v6 5/6] platform/x86: Add Lenovo WMI Gamezone Driver Derek J. Clark
2025-04-29  4:39   ` ALOK TIWARI
2025-04-30  3:26     ` Derek J. Clark
2025-04-30  7:58       ` Ilpo Järvinen [this message]
2025-04-30 10:10         ` Derek J. Clark
2025-05-02  2:26   ` Armin Wolf
2025-04-28  1:18 ` [PATCH v6 6/6] platform/x86: Add Lenovo WMI Other Mode Driver Derek J. Clark
2025-04-29 20:13   ` ALOK TIWARI
2025-04-30  3:26     ` Derek J. Clark
2025-05-02  2:32   ` Armin Wolf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1108c3ac-4815-814d-82b0-2ba74311d883@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=W_Armin@gmx.de \
    --cc=alok.a.tiwari@oracle.com \
    --cc=codyit@gmail.com \
    --cc=corbet@lwn.net \
    --cc=derekjohn.clark@gmail.com \
    --cc=hdegoede@redhat.com \
    --cc=johnfanv2@gmail.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luke@ljones.dev \
    --cc=mpearson-lenovo@squebb.ca \
    --cc=nijs1@lenovo.com \
    --cc=pgriffais@valvesoftware.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=shaohz1@lenovo.com \
    --cc=superm1@kernel.org \
    --cc=zhangzx36@lenovo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®