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: <201411231548.53919@pali>
Date:	Sun, 23 Nov 2014 15:48:53 +0100
From:	Pali Rohár <pali.rohar@...il.com>
To:	Darren Hart <dvhart@...radead.org>
Cc:	Matthew Garrett <mjg59@...f.ucam.org>,
	platform-driver-x86@...r.kernel.org, linux-kernel@...r.kernel.org,
	libsmbios-devel@...ts.us.dell.com, Srinivas_G_Gowda@...l.com,
	Michael_E_Brown@...l.com,
	Gabriele Mazzotta <gabriele.mzt@...il.com>,
	Rafael Wysocki <rjw@...ysocki.net>,
	Linux ACPI Mailing List <linux-acpi@...r.kernel.org>,
	Mika Westerberg <mika.westerberg@...el.com>
Subject: Re: [PATCH] platform: x86: dell-laptop: Add support for keyboard backlight

On Friday 21 November 2014 23:09:40 Darren Hart wrote:
> 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.
> 

Ok, I will use -ENXIO.

> > > > > > +	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;
> > > > > > +	 	}

-- 
Pali Rohár
pali.rohar@...il.com

Download attachment "signature.asc " of type "application/pgp-signature" (199 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ