All of lore.kernel.org
 help / color / mirror / Atom feed
From: Darren Hart <dvhart@infradead.org>
To: "Pali Rohár" <pali.rohar@gmail.com>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>,
	platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org, libsmbios-devel@lists.us.dell.com,
	Srinivas_G_Gowda@dell.com, Michael_E_Brown@dell.com,
	Gabriele Mazzotta <gabriele.mzt@gmail.com>,
	Rafael Wysocki <rjw@rjwysocki.net>,
	Linux ACPI Mailing List <linux-acpi@vger.kernel.org>,
	Mika Westerberg <mika.westerberg@intel.com>
Subject: Re: [PATCH] platform: x86: dell-laptop: Add support for keyboard backlight
Date: Fri, 21 Nov 2014 14:09:40 -0800	[thread overview]
Message-ID: <20141121220939.GA24951@vmdeb7> (raw)
In-Reply-To: <201411221946.25314@pali>

On Sat, Nov 22, 2014 at 07:46:25PM +0100, Pali Rohár wrote:

> > > 0   Completed successfully
> > > -1  Completed with error
> > > -2  Function not supported
> > > 
> > > So we can return something other too (not always -EINVAL).
> > > Do you have any idea which errno should we return for -1
> > > and -2?
> > 
> > For -1, I should think  -EIO (I/O Error)
> > For -2, I'd expect -ENXIO (No such device or address)
> > 
> 
> What about -ENOSYS for -2?

No. This specific topic came up at kernel summit this year. ENOSYS is
specifically for not implemented system calls.

> 
> > > > > +	if (convert) {
> > > > > +		/* NOTE: this switch fall down */
> > > > 
> > > > "fall down" ? As in, it intentionally doesn't have breaks?
> > > 
> > > This code convert "value" in "units" to new value in minutes
> > > units. So for unit == days it is: 24*60*60... So no breaks.
> > 
> > Right, so the language of the comment just wasn't clear, try:
> > 
> > /* Convert value from seconds to minutes */
> > 
> 
> Err... to seconds :-) But OK, I will change comment.

Oops, duh.

/* Convert value from current units to seconds. */

> 
> > > > > +		switch (unit) {
> > > > > +		case KBD_TIMEOUT_DAYS:
> > > > > +			value *= 24;
> > > > > +		case KBD_TIMEOUT_HOURS:
> > > > > +			value *= 60;
> > > > > +		case KBD_TIMEOUT_MINUTES:
> > > > > +			value *= 60;
> > > > > +			unit = KBD_TIMEOUT_SECONDS;
> > > > > +	 	}

-- 
Darren Hart
Intel Open Source Technology Center
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Darren Hart <dvhart@infradead.org>
To: "Pali Rohár" <pali.rohar@gmail.com>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>,
	platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org, libsmbios-devel@lists.us.dell.com,
	Srinivas_G_Gowda@dell.com, Michael_E_Brown@dell.com,
	Gabriele Mazzotta <gabriele.mzt@gmail.com>,
	Rafael Wysocki <rjw@rjwysocki.net>,
	Linux ACPI Mailing List <linux-acpi@vger.kernel.org>,
	Mika Westerberg <mika.westerberg@intel.com>
Subject: Re: [PATCH] platform: x86: dell-laptop: Add support for keyboard backlight
Date: Fri, 21 Nov 2014 14:09:40 -0800	[thread overview]
Message-ID: <20141121220939.GA24951@vmdeb7> (raw)
In-Reply-To: <201411221946.25314@pali>

On Sat, Nov 22, 2014 at 07:46:25PM +0100, Pali Rohár wrote:

> > > 0   Completed successfully
> > > -1  Completed with error
> > > -2  Function not supported
> > > 
> > > So we can return something other too (not always -EINVAL).
> > > Do you have any idea which errno should we return for -1
> > > and -2?
> > 
> > For -1, I should think  -EIO (I/O Error)
> > For -2, I'd expect -ENXIO (No such device or address)
> > 
> 
> What about -ENOSYS for -2?

No. This specific topic came up at kernel summit this year. ENOSYS is
specifically for not implemented system calls.

> 
> > > > > +	if (convert) {
> > > > > +		/* NOTE: this switch fall down */
> > > > 
> > > > "fall down" ? As in, it intentionally doesn't have breaks?
> > > 
> > > This code convert "value" in "units" to new value in minutes
> > > units. So for unit == days it is: 24*60*60... So no breaks.
> > 
> > Right, so the language of the comment just wasn't clear, try:
> > 
> > /* Convert value from seconds to minutes */
> > 
> 
> Err... to seconds :-) But OK, I will change comment.

Oops, duh.

/* Convert value from current units to seconds. */

> 
> > > > > +		switch (unit) {
> > > > > +		case KBD_TIMEOUT_DAYS:
> > > > > +			value *= 24;
> > > > > +		case KBD_TIMEOUT_HOURS:
> > > > > +			value *= 60;
> > > > > +		case KBD_TIMEOUT_MINUTES:
> > > > > +			value *= 60;
> > > > > +			unit = KBD_TIMEOUT_SECONDS;
> > > > > +	 	}

-- 
Darren Hart
Intel Open Source Technology Center

  reply	other threads:[~2014-11-22 19:31 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-14 12:23 [PATCH] platform: x86: dell-laptop: Add support for keyboard backlight Pali Rohár
2014-11-19 18:34 ` Darren Hart
2014-11-19 19:23   ` Matthew Garrett
2014-11-19 19:51     ` Pali Rohár
2014-11-19 19:12       ` Darren Hart
2014-11-19 20:41   ` Pali Rohár
2014-11-21 20:39     ` Darren Hart
2014-11-21 20:39       ` Darren Hart
2014-11-22 18:46       ` Pali Rohár
2014-11-21 22:09         ` Darren Hart [this message]
2014-11-21 22:09           ` Darren Hart
2014-11-23 14:48           ` Pali Rohár
2014-11-23 14:50 ` [PATCH v2] " Pali Rohár
2014-11-25 23:01   ` Darren Hart
2014-12-01 17:35   ` Pali Rohár
2014-12-03  8:43   ` Darren Hart
2014-12-04  8:50     ` Gabriele Mazzotta
2014-12-03 11:51       ` Darren Hart
2014-12-05  1:53         ` Pali Rohár
2014-12-04 10:16     ` Pali Rohár
2014-12-03 12:35       ` Darren Hart
2014-12-05  2:03     ` Pali Rohár
2014-12-03 12:49       ` Darren Hart
2014-12-05 11:53 ` [PATCH v3] " Pali Rohár
2014-12-03 18:00   ` Darren Hart
  -- strict thread matches above, loose matches on Subject: below --
2015-02-19 10:58 [PATCH] " Gabriele Mazzotta
2015-02-22 11:04 ` Pali Rohár
2015-02-26  6:06   ` Darren Hart
2015-03-06 18:05 ` Darren Hart

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=20141121220939.GA24951@vmdeb7 \
    --to=dvhart@infradead.org \
    --cc=Michael_E_Brown@dell.com \
    --cc=Srinivas_G_Gowda@dell.com \
    --cc=gabriele.mzt@gmail.com \
    --cc=libsmbios-devel@lists.us.dell.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.westerberg@intel.com \
    --cc=mjg59@srcf.ucam.org \
    --cc=pali.rohar@gmail.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.