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] [day] [month] [year] [list]
Message-ID: <ADE657CA350FB648AAC2C43247A983F0020698F2E3D9@AUSP01VMBX24.collaborationhost.net>
Date:	Tue, 26 Jun 2012 12:10:54 -0500
From:	H Hartley Sweeten <hartleys@...ionengravers.com>
To:	Ian Abbott <abbotti@....co.uk>, Ian Abbott <ian.abbott@....co.uk>
CC:	Linux Kernel <linux-kernel@...r.kernel.org>,
	"devel@...verdev.osuosl.org" <devel@...verdev.osuosl.org>,
	"fmhess@...rs.sourceforge.net" <fmhess@...rs.sourceforge.net>,
	"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>
Subject: RE: [PATCH 28/33] staging: comedi: cb_das16_cs: cleanup
 das16cs_ai_rinsn()

On Tuesday, June 26, 2012 2:16 AM, Ian Abbott wrote:
> On 2012-06-26 10:09, Ian Abbott wrote:
>> On 2012-06-26 01:17, H Hartley Sweeten wrote:
>>> @@ -129,7 +124,22 @@ static int das16cs_ai_rinsn(struct comedi_device *dev,
>>>    	outw(devpriv->status1, dev->iobase + 4);
>>>
>>>    	devpriv->status2 &= ~0xff00;
>>> -	devpriv->status2 |= range_bits[range];
>>> +	switch (range) {
>>> +	case 0:
>>> +		devpriv->status2 |= 0x800;
>>> +		break;
>>> +	case 1:
>>> +		devpriv->status2 |= 0x000;
>>> +		break;
>>> +	case 2:
>>> +		devpriv->status2 |= 0x100;
>>> +		break;
>>> +	case 3:
>>> +		devpriv->status2 |= 0x200;
>>> +		break;
>>> +	default:
>>> +		return -EINVAL;
>>> +	}
>>
>> Is that really an improvement?  The 'range' variable value will be in
>> range anyway (the comedi core checks beforehand in
>> comedi_check_chanlist()), and looking up the constant to OR with
>> devpriv->status2 is probably less object code (and certainly less source
>> code).
>
> I meant looking up the constant in the static array of course.  It 
> doesn't really matter if you want to do it this way though, and the 
> `static int range_bits[]` you removed should have been `static const int 
> range_bits[]` anyway.

This, and your other comment about the PCMCIA support, have
been addressed.

Thanks for the review!

Regards,
Hartley

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ