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]
Date:	Tue, 28 Aug 2007 07:33:08 +0200
From:	Jiri Slaby <jirislaby@...il.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
CC:	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1] V4L: stk11xx, add a new webcam driver

Andrew Morton napsal(a):
> On Sun, 26 Aug 2007 07:09:02 -0700
> Jiri Slaby <jirislaby@...il.com> wrote:
> +		retok = stk11xx_check_device(dev, 500);
> +		if (retok != 1) {
> +			dev_err(&dev->udev->dev, "load microcode fail\n");
> +			return -EIO;
> +		}
> 
> Normally we'd use a return value of zero to indicate success.  So that the
> negative return value can tell people _why_ it failed.

it returns
-EIO = fail
0 = we succeeded, but the device is not ready
1 = the device is OK

Seems proper to change the 0 -> EBUSY or something and 1 -> 0 anyway, if we
check only for 1.

>> +
>> +	for (i = 0; i < 16; i++) {
>> +		stk11xx_write_reg(dev, 0x0000, 0x25);
>> +		stk11xx_write_reg(dev, 0x0000, 0x24);
>> +		stk11xx_read_reg(dev, 0x0000, &value);
>> +
>> +		dev_dbg(&dev->udev->dev, "Loop 1: Read 0x0000 = %02x\n", value);
>> +	}
>> +
>> +	ret = stk11xx_process_table(dev, table_2);
>> +	if (ret)
>> +		goto end;
>> +
>> +	for (i = 0; i < 16; i++) {
>> +		stk11xx_write_reg(dev, 0x0000, 0x25);
>> +		stk11xx_write_reg(dev, 0x0000, 0x24);
>> +		stk11xx_read_reg(dev, 0x0000, &value);
>> +
>> +		dev_dbg(&dev->udev->dev, "Loop 2: Read 0x0000 = %02x\n", value);
>> +	}
>> +
>> +	ret = stk11xx_process_table(dev, table_3);
>> +	if (ret)
>> +		goto end;
>> +
>> +	for (i = 0; i < 16; i++) {
>> +		stk11xx_write_reg(dev, 0x0000, 0x25);
>> +		stk11xx_write_reg(dev, 0x0000, 0x24);
>> +		stk11xx_read_reg(dev, 0x0000, &value);
>> +
>> +		dev_dbg(&dev->udev->dev, "Loop 3: Read 0x0000 = %02x\n", value);
>> +	}
> 
> Again, ARRAY_SIZE() would be clearer here.

No, this is only do this 16 times, no corresponding table :).

thanks for review,
-- 
Jiri Slaby (jirislaby@...il.com)
Faculty of Informatics, Masaryk University
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ